/* ═══════════════════════════════════════════════════════════
   Cardamom Intelligence — Main Stylesheet
   ═══════════════════════════════════════════════════════════ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

code, .monospace {
    font-family: 'Fira Code', 'Courier New', monospace;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover { color: var(--accent-green); }

/* ── Container ─────────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 5rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
}

.section-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ── Loading Screen ────────────────────────────────────────── */
.loading-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content { text-align: center; }

.loader-icon {
    font-size: 4rem;
    animation: bounce 1s infinite;
}

.loader-content h2 {
    font-size: 1.5rem;
    margin: 1rem 0;
    color: var(--text-primary);
}

.loader-bar {
    width: 200px;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem auto;
}

.loader-progress {
    width: 40%;
    height: 100%;
    background: var(--gradient-hero);
    border-radius: 4px;
    animation: loadProgress 1.5s ease-in-out infinite;
}

.loader-text {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 0.75rem 0;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: var(--bg-nav);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.navbar.scrolled {
    padding: 0.5rem 0;
    box-shadow: 0 4px 30px rgba(0,0,0,0.15);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.nav-icon { font-size: 1.5rem; }

.nav-links {
    display: flex;
    gap: 0.25rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.currency-selector select {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    outline: none;
}

.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background: var(--bg-secondary);
}

.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-hamburger span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* ── Hero Section ──────────────────────────────────────────── */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 1.5rem 4rem;
    overflow: hidden;
    background: var(--gradient-hero);
}

.hero-particles {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 2;
    max-width: 900px;
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255,255,255,0.95);
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    color: white;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.gradient-text {
    background: linear-gradient(135deg, #fbbf24, #f59e0b, #047857);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255,255,255,0.85);
    margin-bottom: 2.5rem;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.hero-stat {
    text-align: center;
    padding: 1rem 1.5rem;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 16px;
    min-width: 130px;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: white;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.75);
    margin-top: 0.25rem;
    font-weight: 500;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-updated {
    margin-top: 2rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn:focus-visible {
    outline: 3px solid var(--accent-blue);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--accent-green);
    color: white;
    border-color: var(--accent-green);
}

.btn-primary:hover {
    background: #065f46;
    border-color: #065f46;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(4,120,87,0.35);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-outline {
    background: transparent;
    border-color: rgba(255,255,255,0.3);
    color: white;
}

.btn-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-2px);
}

/* Dark-theme-aware outline buttons */
.section .btn-outline {
    border-color: var(--border-color);
    color: var(--text-primary);
}

.section .btn-outline:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 14px;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

.btn-generate {
    width: 100%;
    max-width: 500px;
    margin: 0 auto 2rem;
    display: flex;
}

/* ── Glass Card ────────────────────────────────────────────── */
.glass-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.3s ease;
}

.glass-card:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 8px 40px rgba(59,130,246,0.08);
}

/* ── Data Section ──────────────────────────────────────────── */
.data-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.data-card {
    text-align: center;
    padding: 2.5rem 2rem;
}

.data-card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.data-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.data-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.data-status {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--accent-green);
}

.data-summary {
    text-align: center;
}

.summary-grid {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.summary-item {
    text-align: center;
    padding: 1rem 1.5rem;
    background: var(--bg-tertiary);
    border-radius: 12px;
    min-width: 120px;
}

.summary-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 0.25rem;
}

/* ── Progress Bar ──────────────────────────────────────────── */
.progress-container {
    max-width: 500px;
    margin: 0 auto 2rem;
    text-align: center;
}

.progress-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--gradient-hero);
    border-radius: 6px;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ── Hero Recommendation ───────────────────────────────────── */
.hero-recommendation {
    margin-bottom: 2.5rem;
}

.recommendation-card {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%) !important;
    border: none !important;
    text-align: center;
    padding: 3rem 2rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.recommendation-card::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: shimmer 3s ease-in-out infinite;
}

.rec-header {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.rec-badge {
    display: inline-block;
    padding: 0.3rem 1rem;
    background: rgba(255,255,255,0.2);
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

.rec-confidence {
    display: inline-block;
    padding: 0.3rem 1rem;
    background: rgba(255,255,255,0.15);
    border-radius: 50px;
    font-size: 0.875rem;
}

.rec-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.rec-date {
    font-size: 3rem;
    font-weight: 900;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.rec-price {
    font-size: 2.5rem;
    font-weight: 800;
    color: #d1fae5;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.rec-savings {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.rec-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    padding: 1rem;
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
}

/* ── Metrics Grid ──────────────────────────────────────────── */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.metric-card {
    text-align: center;
    padding: 1.5rem;
    border-left: 4px solid var(--accent-blue);
}

.metric-icon { font-size: 1.5rem; }

.metric-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0.5rem 0 0.25rem;
}

.metric-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.metric-delta {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.metric-delta.positive { color: var(--accent-red); }
.metric-delta.negative { color: var(--accent-green); }

/* ── Analysis Section ──────────────────────────────────────── */
.analysis-section {
    margin-bottom: 2.5rem;
}

.analysis-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.analysis-points {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.analysis-point {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border-left: 3px solid var(--accent-blue);
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.6;
    transition: transform 0.2s ease;
}

.analysis-point:hover {
    transform: translateX(4px);
}

/* ── Chart Tabs ────────────────────────────────────────────── */
.tabs-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    border-radius: 8px 8px 0 0;
}

.tab-btn:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.tab-btn.active { color: var(--accent-green); border-bottom-color: var(--accent-green); background: var(--bg-tertiary); }

.tab-content { display: none; }
.tab-content.active { display: block; }

.chart-container {
    width: 100%;
    min-height: 400px;
    border-radius: 12px;
    overflow: hidden;
}

.calendar-legend,
.pie-insights,
.confidence-breakdown {
    margin-top: 1rem;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 4px;
}

.legend-dot.green { background: #047857; }
.legend-dot.red { background: #ef4444; }

/* ── No Data Placeholder ──────────────────────────────────── */
.no-data-message {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* ── Calculator ────────────────────────────────────────────── */
.calculator-card {
    max-width: 800px;
    margin: 0 auto;
}

.calc-input-group {
    margin-bottom: 1.5rem;
}

.calc-input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.calc-input-group input[type="number"] {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-family: inherit;
    font-weight: 700;
    outline: none;
    transition: border-color 0.2s ease;
}

.calc-input-group input[type="number"]:focus {
    border-color: var(--accent-green);
}

.calc-range {
    width: 100%;
    margin-top: 0.5rem;
}

.calc-results {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.calc-result-card {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: 14px;
    border: 2px solid transparent;
}

.calc-result-card.highlight { border-color: var(--accent-green); }
.calc-result-card.savings { border-color: var(--accent-blue); background: rgba(59,130,246,0.08); }

.calc-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.calc-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.calc-sub {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ── Table ─────────────────────────────────────────────────── */
.table-controls {
    margin-bottom: 1.5rem;
}

.filter-group {
    margin-bottom: 1rem;
}

.filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.filter-chips {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.chip {
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.chip.active {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: white;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.forecast-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.forecast-table th {
    padding: 1rem;
    text-align: left;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    border-bottom: 2px solid var(--border-color);
}

.forecast-table th:hover { color: var(--text-primary); }

.forecast-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    white-space: nowrap;
}

.forecast-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.forecast-table tbody tr.strong-buy { border-left: 4px solid #047857; }
.forecast-table tbody tr.buy { border-left: 4px solid #059669; }
.forecast-table tbody tr.accumulate { border-left: 4px solid #fbbf24; }
.forecast-table tbody tr.wait { border-left: 4px solid #ef4444; }

.table-footer {
    padding: 0.75rem 1rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
}

/* ── What-If Analysis ──────────────────────────────────────── */
.whatif-container {
    max-width: 1000px;
    margin: 0 auto;
}

.preset-scenarios {
    margin-bottom: 2rem;
}

.preset-scenarios h4 {
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.preset-btns {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.whatif-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.whatif-group h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.slider-group {
    margin-bottom: 1.25rem;
}

.slider-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.styled-range {
    width: 100%;
    height: 6px;
    border-radius: 6px;
    appearance: none;
    -webkit-appearance: none;
    background: var(--bg-tertiary);
    outline: none;
    cursor: pointer;
}

.styled-range::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-green);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.styled-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-green);
    cursor: pointer;
    border: 2px solid white;
}

.toggle-group {
    margin-bottom: 1rem;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.toggle-label input { display: none; }

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: 24px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.toggle-label input:checked + .toggle-switch {
    background: var(--accent-green);
}

.toggle-label input:checked + .toggle-switch::after {
    transform: translateX(20px);
}

.whatif-results {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.whatif-result-card {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: 14px;
}

.whatif-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.whatif-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.whatif-delta {
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.25rem;
    display: block;
}

.whatif-signal {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
}

/* ── Export Section ─────────────────────────────────────────── */
.export-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.export-card {
    text-align: center;
    padding: 2.5rem 2rem;
}

.export-icon { font-size: 3rem; margin-bottom: 1rem; }

.export-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.export-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

/* ── Footer ────────────────────────────────────────────────── */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 1.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-col h4 {
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.footer-col p,
.footer-col li {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 2;
}

.footer-col ul { list-style: none; }

.footer-col a {
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.footer-col a:hover { color: var(--accent-green); }

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.footer-bottom p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-note { margin-top: 0.25rem; }

/* ── Back to Top ───────────────────────────────────────────── */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: var(--accent-green);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 20px rgba(16,185,129,0.4);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-4px);
}

/* ── Toast ─────────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    animation: slideUp 0.3s ease, fadeOut 0.3s ease 3s forwards;
    white-space: nowrap;
}

.toast.success {
    background: var(--accent-green);
    color: white;
}

.toast.error {
    background: var(--accent-red);
    color: white;
}

.toast.info {
    background: var(--accent-blue);
    color: white;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-hamburger { display: flex; }

    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border-color);
        padding: 1rem;
        gap: 0.25rem;
    }

    .hero-stats { gap: 1rem; }
    .hero-stat { min-width: 100px; padding: 0.75rem 1rem; }
    .stat-value { font-size: 1.5rem; }

    .rec-date { font-size: 2rem; }
    .rec-price { font-size: 1.75rem; }

    .metrics-grid { grid-template-columns: repeat(2, 1fr); }

    .calc-results { grid-template-columns: 1fr; }
    .whatif-results { grid-template-columns: 1fr; }
    .whatif-grid { grid-template-columns: 1fr; }

    .section { padding: 3rem 0; }
    .section-header h2 { font-size: 1.75rem; }
}

@media (max-width: 480px) {
    .hero-actions { flex-direction: column; }
    .hero-actions .btn { width: 100%; }
    .hero-stat { min-width: 80px; }
    .metrics-grid { grid-template-columns: 1fr; }
    .tabs-header { gap: 0.25rem; }
    .tab-btn { padding: 0.5rem 0.75rem; font-size: 0.8rem; }
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Focus / A11y ──────────────────────────────────────────── */
:focus-visible {
    outline: 3px solid var(--accent-blue);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border-width: 0;
}

/* ── High Contrast Mode ────────────────────────────────────── */
@media (prefers-contrast: high) {
    .glass-card { border-width: 2px; }
    .btn { border-width: 3px; }
    .recommendation-card { border: 3px solid white !important; }
}

/* ── Reduced Motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
}
