/* ============================================================
   PolytopeXD — Styles
   Dark theme: gray-950 base, violet/cyan accents
   ============================================================ */

/* ===================== CANVAS ===================== */

.bg-canvas {
    background: radial-gradient(ellipse at center, #0c0a1a 0%, #030305 100%);
}

#main-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* ===================== OVERLAYS ===================== */

.overlay {
    position: absolute;
    z-index: 20;
    pointer-events: none;
}

.overlay-card {
    background: rgba(3, 7, 18, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 10px;
    padding: 12px;
    pointer-events: auto;
}

.slice-mini-canvas {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    border: 1px solid rgba(6, 182, 212, 0.2);
    display: block;
}

/* ===================== POLYTOPE SELECTOR ===================== */

.polytope-btn {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 6px;
    background: transparent;
    color: #9ca3af;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.polytope-btn:hover {
    color: #e5e7eb;
    background: rgba(139, 92, 246, 0.1);
}

.polytope-btn.active {
    color: #c4b5fd;
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
}

/* ===================== MODE TABS ===================== */

.mode-btn {
    flex: 1;
    font-size: 12px;
    font-weight: 500;
    padding: 10px 0;
    background: transparent;
    color: #6b7280;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mode-btn:hover {
    color: #d1d5db;
    background: rgba(255, 255, 255, 0.02);
}

.mode-btn.active {
    color: #a78bfa;
    border-bottom-color: #8b5cf6;
}

/* ===================== PANEL ELEMENTS ===================== */

.panel-label {
    display: block;
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.info-box {
    background: rgba(31, 41, 55, 0.4);
    border: 1px solid rgba(75, 85, 99, 0.2);
    border-radius: 8px;
    padding: 12px;
    font-size: 12px;
}

/* ===================== RANGE INPUTS ===================== */

.range-input {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: #1f2937;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #8b5cf6;
    border: 2px solid #0f172a;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.range-input::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.range-input::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #8b5cf6;
    border: 2px solid #0f172a;
    cursor: pointer;
}

/* Cyan variant */
.cyan-range::-webkit-slider-thumb {
    background: #06b6d4;
}

.cyan-range::-moz-range-thumb {
    background: #06b6d4;
}

/* ===================== ROTATION SLIDERS ===================== */

.rotation-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rotation-label {
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    color: #8b5cf6;
    width: 24px;
    text-align: right;
}

.rotation-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 3px;
    background: #1f2937;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.rotation-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #7c3aed;
    border: 1px solid #0f172a;
    cursor: pointer;
}

.rotation-slider::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #7c3aed;
    border: 1px solid #0f172a;
    cursor: pointer;
}

.rotation-value {
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    color: #6b7280;
    width: 30px;
    text-align: right;
}

/* ===================== PROJECTION BUTTONS ===================== */

.proj-btn {
    flex: 1;
    font-size: 11px;
    padding: 6px 0;
    border-radius: 6px;
    background: rgba(31, 41, 55, 0.4);
    color: #9ca3af;
    border: 1px solid rgba(75, 85, 99, 0.2);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.proj-btn:hover {
    color: #e5e7eb;
    background: rgba(139, 92, 246, 0.1);
}

.proj-btn.active {
    color: #c4b5fd;
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
}

/* ===================== CUT BUTTONS ===================== */

.cut-btn {
    font-size: 11px;
    padding: 6px 0;
    border-radius: 6px;
    background: rgba(31, 41, 55, 0.4);
    color: #9ca3af;
    border: 1px solid rgba(75, 85, 99, 0.2);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.cut-btn:hover {
    color: #e5e7eb;
    background: rgba(6, 182, 212, 0.1);
}

.cut-btn.active {
    color: #67e8f9;
    background: rgba(6, 182, 212, 0.15);
    border-color: rgba(6, 182, 212, 0.3);
}

/* ===================== CELL NAVIGATION ===================== */

.cell-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(31, 41, 55, 0.4);
    color: #d1d5db;
    border: 1px solid rgba(75, 85, 99, 0.3);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.cell-nav-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.4);
    color: #fff;
}

/* ===================== ACTION BUTTONS ===================== */

.action-btn {
    font-size: 12px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.3);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.action-btn:hover {
    background: rgba(139, 92, 246, 0.25);
    border-color: rgba(139, 92, 246, 0.5);
    color: #fff;
}

/* ===================== OPTION CHECKBOXES ===================== */

.option-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #d1d5db;
    cursor: pointer;
}

.option-check input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid #4b5563;
    background: rgba(31, 41, 55, 0.6);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.option-check input[type="checkbox"]:checked {
    background: rgba(139, 92, 246, 0.3);
    border-color: #8b5cf6;
}

.option-check input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    color: #c4b5fd;
    font-weight: 600;
}

/* ===================== PROPERTIES TABLE ===================== */

.prop-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.prop-row:nth-child(odd) {
    background: rgba(31, 41, 55, 0.2);
}

.prop-label {
    color: #9ca3af;
}

.prop-value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    color: #e5e7eb;
}

.prop-value.highlight {
    color: #a78bfa;
}

/* ===================== CELL COLORS ===================== */

.cell-highlight {
    fill: rgba(139, 92, 246, 0.3);
    stroke: #8b5cf6;
}

.cell-ghost {
    opacity: 0.15;
}

/* ===================== SCROLLBAR ===================== */

.custom-scrollbar::-webkit-scrollbar {
    width: 5px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(107, 114, 128, 0.3);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(107, 114, 128, 0.5);
}

/* ===================== ANIMATIONS ===================== */

@keyframes pulse-glow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.glow-text {
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes slice-sweep {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===================== KATEX OVERRIDES ===================== */

.katex {
    color: #c4b5fd;
    font-size: 1.1em;
}

.katex .mord.text {
    color: #d1d5db;
}

/* ===================== RESPONSIVE (minimal) ===================== */

@media (max-width: 900px) {
    aside {
        width: 320px !important;
    }

    .polytope-btn {
        font-size: 10px;
        padding: 2px 6px;
    }
}
