/* ---- Gradients ---- */
.gradient-text {
    background: linear-gradient(135deg, #FDAC0D, #D0F300);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gradient-bg {
    background: linear-gradient(135deg, #FDAC0D, #D0F300);
}

/* ---- Theme semantic classes (dark = default) ---- */
.th-bg-body      { background: #0a0a0f; }
.th-bg-sidebar   { background: #0e0e14; }
.th-bg-card      { background: #111118; }
.th-bg-card-alt  { background: #06060a; }
.th-text-primary { color: #fff; }
.th-text-body    { color: #cbd5e1; }
.th-text-muted   { color: #64748b; }
.th-border       { border-color: rgba(255,255,255,0.05); }
.th-border-b     { border-bottom: 1px solid rgba(255,255,255,0.05); }
.th-border-r     { border-right: 1px solid rgba(255,255,255,0.05); }

/* ---- Light theme overrides ---- */
body.light-theme {
    background: #f8f9fb !important;
    color: #475569 !important;
}

body.light-theme .th-bg-body      { background: #f8f9fb; }
body.light-theme .th-bg-sidebar   { background: #ffffff; }
body.light-theme .th-bg-card      { background: #ffffff; }
body.light-theme .th-bg-card-alt  { background: #f1f5f9; }
body.light-theme .th-text-primary { color: #0f172a; }
body.light-theme .th-text-body    { color: #475569; }
body.light-theme .th-text-muted   { color: #94a3b8; }
body.light-theme .th-border       { border-color: rgba(0,0,0,0.08); }
body.light-theme .th-border-b     { border-bottom-color: rgba(0,0,0,0.08); }
body.light-theme .th-border-r     { border-right-color: rgba(0,0,0,0.08); }

/* Tailwind utility overrides for light theme */
body.light-theme .bg-dark-900     { background: #f8f9fb !important; }
body.light-theme .bg-dark-950     { background: #f1f5f9 !important; }
body.light-theme .bg-dark-200     { background: #ffffff !important; }
body.light-theme .bg-dark-100     { background: #ffffff !important; }
body.light-theme .bg-dark-50      { background: #f8f9fb !important; }

body.light-theme .text-white       { color: #0f172a !important; }
body.light-theme .text-slate-300   { color: #475569 !important; }
body.light-theme .text-slate-400   { color: #64748b !important; }
body.light-theme .text-slate-500   { color: #94a3b8 !important; }
body.light-theme .text-slate-600   { color: #94a3b8 !important; }

body.light-theme .border-white\/5  { border-color: rgba(0,0,0,0.07) !important; }
body.light-theme .border-white\/10 { border-color: rgba(0,0,0,0.10) !important; }
body.light-theme .border-r.border-white\/5 { border-right-color: rgba(0,0,0,0.07) !important; }

body.light-theme .bg-white\/5     { background: rgba(0,0,0,0.03) !important; }
body.light-theme .bg-white\/\[0\.03\] { background: rgba(0,0,0,0.025) !important; }
body.light-theme .bg-white\/\[0\.02\] { background: rgba(0,0,0,0.015) !important; }

body.light-theme .hover\:bg-white\/10:hover { background: rgba(0,0,0,0.06) !important; }
body.light-theme .hover\:bg-white\/\[0\.03\]:hover { background: rgba(0,0,0,0.03) !important; }

body.light-theme .shadow-brand-500\/20 { --tw-shadow-color: rgba(253,172,13,0.10) !important; }

body.light-theme .glow-brand {
    box-shadow: 0 0 60px rgba(253, 172, 13, 0.06), 0 4px 24px rgba(0,0,0,0.06);
}

body.light-theme .chat-bubble.bg-white\/5 {
    background: rgba(0,0,0,0.04) !important;
}

/* Burbuja de snippet del chat flotante */
#float-chat-bubble {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
body.light-theme #float-chat-bubble {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.10) !important;
    color: #475569 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Chat flotante: fondo y texto legibles en tema claro */
body.light-theme #float-chat-panel {
    background: #ffffff !important;
    border-color: rgba(0,0,0,0.10) !important;
}
body.light-theme #float-chat-panel .border-white\/5 {
    border-color: rgba(0,0,0,0.08) !important;
}
body.light-theme #float-chat-box {
    background: #f8f9fb !important;
    color: #334155 !important;
}
body.light-theme #float-chat-box .chat-bubble {
    color: inherit !important;
}
body.light-theme #float-chat-box .text-slate-300 {
    color: #475569 !important;
}
body.light-theme #float-chat-input {
    background: rgba(0,0,0,0.04) !important;
    border-color: rgba(0,0,0,0.12) !important;
    color: #0f172a !important;
}
body.light-theme #float-chat-input::placeholder {
    color: #64748b !important;
}
body.light-theme #float-chat-panel .text-white {
    color: #0f172a !important;
}
body.light-theme #float-chat-btn.focus\:ring-offset-dark-900:focus {
    --tw-ring-offset-color: #f8f9fb;
}

body.light-theme .border-b.border-white\/5 { border-bottom-color: rgba(0,0,0,0.07) !important; }
body.light-theme .border-t.border-white\/5 { border-top-color: rgba(0,0,0,0.07) !important; }
body.light-theme .border-l-2.border-white\/10 { border-left-color: rgba(0,0,0,0.10) !important; }
body.light-theme .divide-white\/5 > * + * { border-color: rgba(0,0,0,0.06) !important; }

body.light-theme .border-dashed.border-white\/10 { border-color: rgba(0,0,0,0.12) !important; }
body.light-theme .border-dashed.border-white\/5 { border-color: rgba(0,0,0,0.08) !important; }

/* Navigation in light theme */
body.light-theme .nav-active {
    background: rgba(253, 172, 13, 0.08);
}

body.light-theme .nav-btn.text-slate-500 { color: #64748b !important; }
body.light-theme .nav-btn:hover { color: #334155 !important; }

/* Problem card dots (showcase): visible in light theme (inactive = dark dots) */
body.light-theme #problem-case-dots button:not(.gradient-bg) {
    background: rgba(0, 0, 0, 0.2) !important;
}
body.light-theme #problem-case-dots button:not(.gradient-bg):hover {
    background: rgba(0, 0, 0, 0.35) !important;
}

/* Slider in light theme */
body.light-theme .slider-input::-webkit-slider-thumb {
    border-color: #ffffff;
    box-shadow: 0 0 10px rgba(253, 172, 13, 0.4), 0 1px 4px rgba(0,0,0,0.15);
}
body.light-theme .slider-input::-moz-range-thumb {
    border-color: #ffffff;
    box-shadow: 0 0 10px rgba(253, 172, 13, 0.4), 0 1px 4px rgba(0,0,0,0.15);
}
/* Slider track zones */
.slider-track-base {
    background: rgba(255, 255, 255, 0.08);
}
.slider-track-surcharge {
    background: rgba(239, 68, 68, 0.20);
}
body.light-theme .slider-track-base {
    background: rgba(0, 0, 0, 0.12);
}
body.light-theme .slider-track-surcharge {
    background: rgba(239, 68, 68, 0.15);
}

/* Scrollbar for light */
body.light-theme .custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.10);
}

/* ---- Navigation ---- */
.nav-active {
    color: #FDAC0D !important;
    border-left: 4px solid #FDAC0D;
    background: rgba(253, 172, 13, 0.06);
}

.sidebar-hide {
    transform: translateX(-100%);
}

@media (min-width: 1024px) {
    .sidebar-hide {
        transform: translateX(0);
    }
}

/* ---- Scrollbar ---- */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}

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

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

/* ---- Chat ---- */
.chat-bubble {
    max-width: 85%;
    border-radius: 1.25rem;
    margin-bottom: 0.75rem;
}

/* ---- Glow ---- */
.glow-brand {
    box-shadow: 0 0 60px rgba(253, 172, 13, 0.08), 0 0 120px rgba(208, 243, 0, 0.04);
}

/* ---- Theme transition ---- */
body, body * {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ---- Range slider (dark theme) ---- */
.slider-input {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    z-index: 2;
}

.slider-input::-webkit-slider-runnable-track {
    height: 6px;
    background: transparent;
    border-radius: 3px;
}

.slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #FDAC0D;
    cursor: pointer;
    margin-top: -7px;
    border: 3px solid #0a0a0f;
    box-shadow: 0 0 10px rgba(253, 172, 13, 0.3);
    transition: box-shadow 0.2s;
}

.slider-input.in-surcharge::-webkit-slider-thumb {
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.4), 0 0 6px rgba(253, 172, 13, 0.3);
}

.slider-input::-moz-range-track {
    height: 6px;
    background: transparent;
    border-radius: 3px;
}

.slider-input::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #FDAC0D;
    cursor: pointer;
    border: 3px solid #0a0a0f;
    box-shadow: 0 0 10px rgba(253, 172, 13, 0.3);
    transition: box-shadow 0.2s;
}

.slider-input.in-surcharge::-moz-range-thumb {
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.4), 0 0 6px rgba(253, 172, 13, 0.3);
}

/* ---- Annotation reveal (Plan e Inversión) ---- */
.annotation-reveal {
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.annotation-reveal.is-visible {
    opacity: 1;
    transform: scale(1);
}

/* Annotation theme: invert for dark mode, normal for light */
.annotation-reveal img {
    transition: filter 0.3s ease;
}
body:not(.light-theme) .annotation-reveal img {
    filter: invert(1) !important;
}
body.light-theme .annotation-reveal img {
    filter: none !important;
}

/* ---- Timeline dots alignment ---- */
.timeline-dot {
    position: absolute;
    left: -1.35rem;
    top: 0.3rem;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #FDAC0D, #D0F300);
}
