/* === Base Styles === */
body {
    font-family: 'Inter', sans-serif;
    background-color: #FDFBF7;
    color: #334155;
    transition: background-color 0.3s, color 0.3s;
}

/* === Dark Mode === */
body.dark {
    background-color: #0f172a;
    color: #e2e8f0;
}
body.dark .card,
body.dark aside,
body.dark .bg-white {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}
body.dark .bg-gray-50,
body.dark .bg-slate-50,
body.dark .bg-gray-100 {
    background-color: #1e293b !important;
}
body.dark .text-slate-800,
body.dark .text-slate-700,
body.dark .text-slate-600 {
    color: #e2e8f0 !important;
}
body.dark .text-gray-500,
body.dark .text-gray-400 {
    color: #94a3b8 !important;
}
body.dark .border-gray-200,
body.dark .border-gray-100,
body.dark .border-gray-300 {
    border-color: #334155 !important;
}
body.dark input[type="text"],
body.dark input[type="number"] {
    background-color: #0f172a;
    color: #e2e8f0;
    border-color: #475569;
}
body.dark .mobile-header {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

/* === Navigation === */
.nav-item.active {
    background-color: #E2E8F0;
    color: #1E293B;
    font-weight: 600;
    border-left: 4px solid #334155;
}
body.dark .nav-item.active {
    background-color: #334155;
    color: #f1f5f9;
    border-left-color: #60a5fa;
}

/* === Cards === */
.card {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s;
}
.card:hover {
    transform: translateY(-2px);
}

/* === Charts === */
.chart-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    height: 300px;
    max-height: 400px;
}
@media (min-width: 768px) {
    .chart-container { height: 350px; }
}

/* === Custom Scrollbar === */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #F1F5F9; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* === Tabs === */
.tab-btn.active {
    border-bottom: 2px solid #334155;
    color: #1E293B;
}

/* === Animations === */
.animate-fade-in {
    animation: fadeIn 0.5s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === Search Highlight === */
.highlight {
    background-color: #fef08a;
    padding: 2px;
    border-radius: 2px;
}

/* === Bar Charts === */
.bar-container {
    height: 24px;
    background-color: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
}
.bar-segment {
    height: 100%;
    transition: width 0.5s ease;
}

/* === Glossary Tooltips === */
.glossary-term {
    border-bottom: 1px dashed #64748b;
    cursor: help;
    position: relative;
}
.glossary-term:hover .glossary-tip {
    display: block;
}
.glossary-tip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #f1f5f9;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    width: 260px;
    z-index: 50;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    line-height: 1.4;
    font-weight: 400;
}
.glossary-tip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
}

/* === Checklist === */
.checklist-item {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}
.checklist-item.checked {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
    opacity: 0.7;
}
.checklist-item.checked .checklist-label {
    text-decoration: line-through;
    color: #94a3b8;
}

/* === Collapsible Case Studies === */
.case-toggle {
    cursor: pointer;
    user-select: none;
}
.case-toggle .chevron {
    transition: transform 0.3s ease;
    display: inline-block;
}
.case-toggle.open .chevron {
    transform: rotate(180deg);
}
.case-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
}
.case-body.open {
    max-height: 2000px;
}

/* === Animated Counter === */
.counter-value {
    transition: all 0.3s ease;
}

/* === Progress Ring (Checklist) === */
.progress-ring {
    width: 36px;
    height: 36px;
}
.progress-ring circle {
    transition: stroke-dashoffset 0.5s ease;
}

/* === Smooth scroll for main === */
main {
    scroll-behavior: smooth;
}

/* === Comparator Detail Popup === */
.detail-popup {
    display: none;
    position: absolute;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    z-index: 40;
    min-width: 220px;
    font-size: 12px;
}
.comparator-row:hover .detail-popup {
    display: block;
}

/* === Sidebar active indicator dot === */
.nav-item .nav-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: transparent;
    display: inline-block;
    margin-right: 6px;
    transition: background 0.2s;
}
.nav-item.active .nav-dot {
    background: #3b82f6;
}

/* === Quick Links Cards on Dashboard === */
.quick-link {
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}
.quick-link:hover {
    border-color: #3b82f6;
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

/* === Scroll to top button === */
.scroll-top-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #334155;
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 30;
    transition: opacity 0.2s;
    font-size: 18px;
    border: none;
}
.scroll-top-btn.visible {
    display: flex;
}
body.dark .scroll-top-btn {
    background: #60a5fa;
}

/* === Print Styles === */
@media print {
    aside, .mobile-header, #mobile-menu, .no-print, button {
        display: none !important;
    }
    main {
        padding: 0 !important;
        margin: 0 !important;
    }
    section {
        display: block !important;
        page-break-inside: avoid;
    }
    .card {
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }
    body {
        background: white;
    }
}

/* === Wizard === */
.wizard-step {
    animation: fadeIn 0.3s ease-out;
}
.wizard-option {
    cursor: pointer;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.25rem 1rem;
    transition: all 0.2s ease;
    text-align: center;
    background: white;
}
.wizard-option:hover {
    border-color: #93c5fd;
    background-color: #eff6ff;
}
.wizard-option.selected {
    border-color: #3b82f6;
    background-color: #eff6ff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
body.dark .wizard-option {
    border-color: #334155;
    background-color: #1e293b;
}
body.dark .wizard-option:hover {
    border-color: #60a5fa;
    background-color: #172554;
}
body.dark .wizard-option.selected {
    border-color: #60a5fa;
    background-color: #172554;
}
.wizard-progress-line {
    height: 3px;
    background: #e2e8f0;
    flex: 1;
    transition: background 0.3s;
}
.wizard-progress-line.completed {
    background: #10b981;
}
.wizard-alert {
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid;
    margin-bottom: 8px;
    font-size: 14px;
}
.wizard-alert.warning { background: #fef3c7; border-color: #f59e0b; color: #92400e; }
.wizard-alert.danger { background: #fef2f2; border-color: #ef4444; color: #991b1b; }
.wizard-alert.info { background: #eff6ff; border-color: #3b82f6; color: #1e40af; }
body.dark .wizard-alert.warning { background: #451a03; color: #fde68a; }
body.dark .wizard-alert.danger { background: #450a0a; color: #fecaca; }
body.dark .wizard-alert.info { background: #172554; color: #bfdbfe; }

/* Wizard CTA gradient */
.wizard-cta {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    border-radius: 1rem;
    color: white;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.wizard-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.3);
}

/* === Disclaimer Banner === */
.disclaimer-banner {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 12px;
    color: #92400e;
}
