/* ============================================
   PROFESSIONAL DASHBOARD - CLEAN DESIGN
   ============================================ */

:root {
    /* Primary Orange - Brighter, more vibrant */
    --primary-orange: #ff8c32;
    --primary-orange-dark: #f97316;
    --primary-orange-light: #ffaa66;
    --primary-orange-subtle: rgba(255, 140, 50, 0.08);
    --primary-orange-glow: rgba(255, 140, 50, 0.12);

    /* Legacy compatibility */
    --accent-blue: #ff8c32;

    /* Success/Warning/Danger */
    --success: #10b981;
    --success-green: #10b981;
    --accent-green: #10b981;
    --warning: #fbbf24;
    --warning-amber: #fbbf24;
    --danger: #ef4444;
    --danger-red: #ef4444;
    --accent-red: #ef4444;

    /* High Contrast Backgrounds */
    --bg-base: #000000;          /* Pure black base */
    --bg-main: #000000;
    --bg-card: #141414;          /* Dark gray cards - HIGH contrast */
    --bg-card-solid: #141414;
    --bg-elevated: #1f1f1f;      /* Slightly lighter */
    --bg-input: #0a0a0a;         /* Input fields */
    --bg-card-subtle: #0f0f0f;
    --bg-overlay: #000000;

    /* Crisp Borders - NO transparency on borders */
    --border-subtle: #2a2a2a;    /* Solid gray, not transparent */
    --border-medium: #3a3a3a;
    --border-bright: #4a4a4a;
    --border-color: #2a2a2a;
    --border-emphasis: #3a3a3a;
    --border-orange: rgba(255, 140, 50, 0.7);

    /* Text - High contrast */
    --text-primary: #ffffff;
    --text-secondary: #b8b8b8;
    --text-tertiary: #8a8a8a;
    --text-muted: #5a5a5a;

    /* Ultra-Minimal Shadow System - Crisp Design */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 2px 8px rgba(0, 0, 0, 0.25);

    /* Typography Hierarchy */
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Font Sizes */
    --text-xs: 12px;
    --text-sm: 14px;
    --text-base: 16px;
    --text-lg: 18px;
    --text-xl: 20px;
    --text-2xl: 24px;
    --text-3xl: 32px;
    --text-4xl: 48px;

    /* Font Weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;

    /* Line Heights */
    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.75;

    /* Responsive Breakpoints */
    --breakpoint-sm: 640px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 1024px;
    --breakpoint-xl: 1536px;

    /* BUG FIX #2: Z-index hierarchy for proper tooltip stacking */
    --z-base: 1;
    --z-tooltip: 1100;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background: #000000; /* Pure black */
    color: var(--text-primary);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    font-weight: var(--font-normal);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Remove texture overlay */
body::before {
    display: none;
}

/* BUG FIX #3: Default text alignment - body text left-aligned, headings centered */
p, li, td, .metric-description, .section-content, .faq-item p, .footer-sources, .risk-advice, .risk-advice-inline, .status-explanation-large, .hero-description, .insight-box, .metric-interpretation {
    text-align: left;
}

/* Keep headings centered */
h1, h2, h3, h4, h5, h6, .header, .hero-phase, .status-title, .stat-label, .stat-value, .action-label, .action-text, .confidence-badge, .risk-label-inline, .risk-value-inline {
    text-align: center;
}

/* ============================================
   LAYOUT
   ============================================ */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.header h1 {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-trending {
    color: var(--primary-orange);
}

.logo-crypto {
    color: var(--text-primary);
}

.subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 400;
    text-align: center;
}

/* Header Navigation */
.header-nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
}

.nav-badge {
    background: none;
    border: none;
    padding: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-orange);
    text-decoration: none;
    transition: color 0.2s ease;
    cursor: pointer;
    font-family: inherit;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.nav-badge:hover {
    color: var(--text-primary);
}

.nav-badge:active {
    color: var(--text-primary);
}

/* Live Indicator */
.live-indicator {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.live-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-green);
    border-radius: 50%;
}

.live-text {
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Two Column Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 2rem;
    align-items: start;
}

.primary-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.secondary-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ============================================
   CARDS - MINIMAL STYLE
   ============================================ */

/* Hero Card */
/* BUG FIX #2: Add z-index for proper stacking */
.status-hero {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
    z-index: var(--z-base);
    overflow: visible;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

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

.hero-phase {
    font-size: var(--text-2xl);
    font-weight: var(--font-semibold);
    line-height: var(--leading-tight);
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.hero-subtitle {
    font-size: var(--text-sm);
    font-weight: var(--font-normal);
    line-height: var(--leading-normal);
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
    width: 100%;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hero-stat-label {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    line-height: var(--leading-normal);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-stat-value {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    line-height: var(--leading-tight);
    color: var(--text-primary);
}

/* BUG FIX #3: Left-align hero description */
.hero-description {
    font-size: var(--text-sm);
    font-weight: var(--font-normal);
    line-height: var(--leading-relaxed);
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    text-align: left;
}

.hero-confidence {
    margin-top: 0.5rem;
}

.confidence-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.confidence-badge.high {
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--accent-green);
}

.confidence-badge.medium {
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--accent-orange);
}

.confidence-badge.low {
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--accent-red);
}

/* Risk Card */
/* BUG FIX #2: Add z-index for proper stacking */
.risk-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    position: relative;
    z-index: var(--z-base);
    overflow: visible;
}

.risk-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.risk-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.risk-emoji {
    font-size: 2rem;
}

.risk-title {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.risk-level {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.risk-score-badge {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.risk-meter {
    height: 6px;
    background: var(--bg-card-subtle);
    border-radius: 3px;
    position: relative;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.risk-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
    background: var(--accent-red);
}

.risk-fill.low {
    background: var(--accent-green);
}

.risk-fill.moderate {
    background: var(--accent-orange);
}

.risk-markers {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
}

.risk-marker {
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

/* BUG FIX #3: Left-align risk advice */
.risk-advice {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: left;
}

.risk-factors-details {
    margin-top: 1rem;
}

.risk-factors-details summary {
    cursor: pointer;
    padding: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 6px;
}

.risk-factors-details summary:hover {
    background: var(--bg-card-subtle);
}

.risk-factors-list {
    padding: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Divergence Alert */
.divergence-alert {
    background: var(--bg-card);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-left: 3px solid var(--accent-orange);
    border-radius: 8px;
    padding: 1.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================
   RIGHT COLUMN
   ============================================ */

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

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

.stat-value.positive {
    color: var(--accent-green);
}

.stat-value.negative {
    color: var(--accent-red);
}

/* Tabs */
.tab-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.tab-btn {
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font-family);
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-card-subtle);
}

.tab-btn.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

/* Tab Content */
/* BUG FIX #2: Add z-index for proper stacking */
.tab-content-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    min-height: 500px;
    position: relative;
    z-index: var(--z-base);
    overflow: visible;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.tab-content h3 {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    line-height: var(--leading-tight);
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
}

.tab-content h4 {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    line-height: var(--leading-tight);
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: -0.3px;
}

/* Confidence Bar */
.confidence-container {
    margin-bottom: 2rem;
}

.confidence-bar {
    height: 4px;
    background: var(--bg-card-subtle);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.confidence-fill {
    height: 100%;
    background: var(--accent-blue);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.confidence-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Detailed Table */
.detailed-breakdown {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    margin-bottom: 1.5rem;
}

.detailed-breakdown tr {
    border-bottom: none;
}

.detailed-breakdown tr:last-child {
    border-bottom: none;
}

.detailed-breakdown td {
    padding: 16px 24px;
    font-size: 0.875rem;
    background: #0a0a0a;
    min-height: 56px;
}

.detailed-breakdown td:first-child {
    color: var(--text-secondary);
    border-radius: 4px 0 0 4px;
    padding-left: 24px;
}

.detailed-breakdown td:last-child {
    text-align: right;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
    border-radius: 0 4px 4px 0;
    padding-right: 24px;
    white-space: nowrap;
}

/* Dynamic metric row colors - matching "What We Track" section exactly */
.detailed-breakdown tr.success td {
    background: rgba(16, 185, 129, 0.06);
}

.detailed-breakdown tr.success td:first-child {
    border-left: 3px solid rgba(16, 185, 129, 0.5);
}

.detailed-breakdown tr.success .detail-value {
    color: #10b981;
}

.detailed-breakdown tr.warning td {
    background: rgba(251, 191, 36, 0.06);
}

.detailed-breakdown tr.warning td:first-child {
    border-left: 3px solid rgba(251, 191, 36, 0.5);
}

.detailed-breakdown tr.warning .detail-value {
    color: #fbbf24;
}

.detailed-breakdown tr.danger td {
    background: rgba(239, 68, 68, 0.06);
}

.detailed-breakdown tr.danger td:first-child {
    border-left: 3px solid rgba(239, 68, 68, 0.5);
}

.detailed-breakdown tr.danger .detail-value {
    color: #ef4444;
}

.detailed-breakdown tr.neutral td {
    background: rgba(156, 163, 175, 0.03);
}

.detailed-breakdown tr.neutral td:first-child {
    border-left: 3px solid rgba(156, 163, 175, 0.3);
}

.detailed-breakdown tr.neutral .detail-value {
    color: #9ca3af;
}

/* Hover effect for table rows */
.detailed-breakdown tr:hover td {
    background: rgba(255, 140, 50, 0.04);
    cursor: default;
}

.detailed-breakdown tr.success:hover td {
    background: rgba(16, 185, 129, 0.10);
}

.detailed-breakdown tr.warning:hover td {
    background: rgba(251, 191, 36, 0.10);
}

.detailed-breakdown tr.danger:hover td {
    background: rgba(239, 68, 68, 0.10);
}

.detailed-breakdown tr.neutral:hover td {
    background: rgba(156, 163, 175, 0.08);
}

/* Timestamp */
.timestamp {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* ============================================
   HISTORY TAB
   ============================================ */

.timeframe-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.timeframe-btn {
    flex: 1 1 auto;
    min-width: 60px;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid #5a5a5a; /* Accessible border: 3.3:1 contrast on black */
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font-family);
}

/* Dropdown selects for mobile */
.timeframe-dropdown,
.sentiment-dropdown {
    display: none; /* Hidden on desktop */
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-card-subtle);
    border: 2px solid var(--accent-primary); /* Orange border for attention */
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font-family);
    cursor: pointer;
    margin-bottom: 1rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ff6b35' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.timeframe-dropdown:focus,
.sentiment-dropdown:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2); /* Orange glow on focus */
}

.sentiment-dropdown {
    margin: 0;
    width: auto;
    min-width: 150px;
}

.timeframe-btn:hover {
    color: var(--text-primary);
    border-color: #8a8a8a; /* Accessible border: 5.4:1 contrast */
}

.timeframe-btn.active {
    color: white;
    background: #c2410c; /* Accessible orange: 5.17:1 contrast with white */
    border-color: #c2410c;
}

/* Mobile: Show dropdowns, hide buttons */
@media (max-width: 768px) {
    /* Hide button groups on mobile */
    .timeframe-buttons,
    .sentiment-buttons {
        display: none !important;
    }

    /* Show dropdowns on mobile */
    .timeframe-dropdown,
    .sentiment-dropdown {
        display: block !important;
    }

    /* Improve chart appearance on mobile */
    .chart-container {
        padding: 0.5rem !important; /* Minimal padding for compact appearance */
        margin-bottom: 1.5rem !important;
    }

    .chart-container canvas {
        max-height: 200px !important;
        min-height: 200px !important;
        image-rendering: -webkit-optimize-contrast !important; /* Crisp rendering */
        image-rendering: crisp-edges !important;
    }

    /* Hide chart title on mobile to save space */
    .chart-container h4 {
        font-size: 0.875rem !important;
        margin-bottom: 0.75rem !important;
    }

    /* Make sentiment dropdown more compact on mobile */
    .sentiment-dropdown {
        width: 100% !important;
        margin-bottom: 0.75rem !important;
    }

    /* Reduce historical stats spacing on mobile */
    .historical-stats {
        gap: 0.75rem !important;
        margin-bottom: 1rem !important;
    }

    .stat-card {
        padding: 0.75rem !important;
    }

    .stat-label {
        font-size: 0.75rem !important;
        margin-bottom: 0.25rem !important;
    }

    .stat-value {
        font-size: 1.25rem !important;
    }
}

.historical-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.5rem;
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
}

.stat-card .stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

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

.chart-container {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.chart-container h4 {
    margin-bottom: 1.5rem;
}

/* ============================================
   ASSETS TAB
   ============================================ */

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

.asset-column h4 {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.asset-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.asset-item {
    padding: 0.75rem;
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.asset-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.asset-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ============================================
   DATA TAB (Legacy styles removed)
   ============================================ */

/* Health grid styles moved to "Health Grid" section below */

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

/* BUG FIX #3: Left-align footer text */
.footer-sources {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
    text-align: left;
}

.footer-links {
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-separator {
    margin: 0 1rem;
    color: var(--text-tertiary);
}

.footer-copyright {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* ============================================
   MODAL
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    background: none;
    border: none;
}

.modal-close:hover {
    color: var(--text-primary);
}

/* BUG FIX #3: Left-align modal body text */
#modal-body {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    text-align: left;
}

#modal-body h2 {
    font-size: var(--text-2xl);
    font-weight: var(--font-semibold);
    line-height: var(--leading-tight);
    color: var(--text-primary);
    margin-bottom: 1rem;
    text-align: center;
}

/* BUG FIX #3: Left-align modal paragraphs */
#modal-body p {
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-normal);
    margin-bottom: 1rem;
    text-align: left;
}

#modal-body h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    text-align: left !important;
}

#modal-body ul {
    color: var(--text-secondary);
    line-height: 1.6;
}

#modal-body li {
    margin-bottom: 0.5rem;
}

#modal-body a {
    color: var(--primary-orange);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 140, 50, 0.3);
    transition: all 0.2s ease;
}

#modal-body a:hover {
    color: var(--primary-orange-light);
    border-bottom-color: var(--primary-orange);
}

.contact-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
}

/* ============================================
   RESPONSIVE - MOBILE FIRST
   ============================================ */

/* Small devices (640px and up) */
@media (min-width: 640px) {
    .hero-phase {
        font-size: var(--text-3xl);
    }

    .hero-stat-value {
        font-size: var(--text-2xl);
    }
}

/* Medium devices (768px and up) */
@media (min-width: 768px) {
    .quick-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .tab-nav {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Large devices (1024px and up) */
@media (min-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .historical-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Extra large devices (1536px and up) */
@media (min-width: 1536px) {
    .container {
        max-width: 1600px;
    }

    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Legacy max-width breakpoints (for backwards compatibility) */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .live-indicator {
        position: static;
        margin: 1rem auto;
        width: fit-content;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 2rem 1rem;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .quick-stats {
        grid-template-columns: 1fr;
    }

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

    .historical-stats {
        grid-template-columns: 1fr;
    }

    .asset-grid {
        grid-template-columns: 1fr;
    }

    .hero-stats {
        grid-template-columns: 1fr;
    }

    /* Mobile responsive for detailed breakdown table */
    .detailed-breakdown td {
        padding: 14px 16px;
        font-size: 0.8125rem;
    }

    .detailed-breakdown td:first-child {
        padding-left: 16px;
    }

    .detailed-breakdown td:last-child {
        padding-right: 16px;
        font-size: 0.9375rem;
    }

    /* Mobile responsive for metric interpretations */
    .metric-interpretation {
        padding: 14px 16px;
        font-size: 0.8125rem;
        min-height: 48px;
    }
}

/* ============================================
   SIMPLIFIED SINGLE-FOCUS LAYOUT
   ============================================ */

/* Hero Main - The One Thing */
/* LAYOUT FIX: Increase width for better use of screen space */
.hero-main {
    max-width: 800px;
    margin: 0 auto 1.5rem auto;
}

/* LAYOUT FIX: Proper spacing for main status card */
/* BUG FIX #2: Add z-index for proper stacking */
.status-large {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-top: 3px solid var(--primary-orange);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    margin-bottom: 0; /* Card itself has no bottom margin - spacing handled by wrapper */
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-height: 250px;
    justify-content: center;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: var(--z-base);
    overflow: visible;
    transition: all 0.2s ease;
}

.status-large:hover {
    box-shadow: var(--shadow-lg);
}

.status-icon-large {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.status-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.status-score {
    font-size: 4.5rem;
    font-weight: 700;
    margin: 0.75rem 0;
    color: var(--text-primary);
    line-height: 1;
}

.status-action {
    background: var(--bg-card-subtle);
    border: 1px solid #f97316;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: 0 0 20px rgba(255, 140, 50, 0.1);
    transition: all 0.2s ease;
    height: 100%; /* Match height with risk badge */
}

.status-action:hover {
    border-color: #f97316;
    box-shadow: 0 0 24px rgba(255, 140, 50, 0.15);
}

.action-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.85); /* Increased from 0.6 to 0.85 for better contrast */
    margin-bottom: 0.5rem;
    font-weight: 600; /* Increased from 500 to 600 */
    display: block;
}

.action-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* BUG FIX #3: Left-align status explanation */
.status-explanation-large {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 600px;
    margin: 1rem auto 0 auto;
    text-align: left;
}

/* ============================================
   NEW HERO CARD STYLES - OPTION B
   ============================================ */

/* Score Display */
.score-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.score-main {
    font-size: 5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary);
}

.score-divider {
    font-size: 2rem;
    color: var(--text-tertiary);
    margin: -0.5rem 0;
}

.score-total {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-tertiary);
}

/* Visual Slider */
.score-slider {
    margin: 1.5rem 0;
    width: 100%;
    max-width: 100%;
}

.slider-track {
    height: 12px;
    background: linear-gradient(to right, var(--danger) 0%, var(--warning) 50%, var(--success) 100%);
    border-radius: 6px;
    position: relative;
    margin-bottom: 0.75rem;
}

.slider-dot {
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: -4px;
    transform: translateX(-50%);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2);
    transition: left 0.3s ease;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.slider-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.slider-label-value {
    font-weight: 600;
    color: var(--text-secondary);
}

.slider-label-text {
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

/* Hero Divider */
.hero-divider {
    height: 1px;
    background: var(--border-subtle);
    width: 100%;
    margin: 0.5rem 0;
}

/* Market Summary */
.market-summary {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

/* Hero Footer - Badge Style */
.hero-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.hero-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.hero-badge:hover {
    border-color: var(--border-medium);
    box-shadow: var(--shadow-sm);
}

.hero-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.hero-badge-dot.success {
    background: var(--success);
}

.hero-badge-dot.warning {
    background: var(--warning);
}

.hero-badge-dot.danger {
    background: var(--danger);
}

.hero-badge-dot.live {
    background: var(--accent-green);
    animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.hero-badge-text {
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.hero-badge-time {
    color: var(--text-tertiary);
    font-weight: 400;
}

/* LAYOUT FIX: Add bottom spacing to create separation from expandable sections */
.risk-badge-inline {
    padding: 1.5rem;
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%; /* Match height with status-action card */
}

.risk-badge-inline:hover {
    border-color: var(--border-medium);
    box-shadow: var(--shadow-lg);
}

.risk-header-inline {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.risk-emoji-inline {
    font-size: 2rem;
}

.risk-text-inline {
    flex: 1;
}

.risk-label-inline {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85); /* Better contrast */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
    font-weight: 500;
    text-align: left;
}

.risk-value-inline {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: left;
}

/* BUG FIX #3: Left-align risk advice inline */
.risk-advice-inline {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    text-align: left;
}

/* Color variations */
.risk-badge-inline.minimal {
    border-color: rgba(16, 185, 129, 0.3);
}

.risk-badge-inline.low {
    border-color: rgba(16, 185, 129, 0.2);
}

.risk-badge-inline.moderate {
    border-color: rgba(245, 158, 11, 0.3);
}

.risk-badge-inline.high {
    border-color: rgba(244, 67, 54, 0.3);
}

.risk-badge-inline.critical {
    border-color: rgba(244, 67, 54, 0.5);
}

/* Legacy support - keeping these for any old references */
.risk-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.risk-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.125rem;
}

/* Expandable Sections - Progressive Disclosure */
/* LAYOUT FIX: Increase width to match hero section for consistent layout */
.expandable-sections {
    max-width: 1200px;
    margin: 0 auto 3rem auto;
}

/* LAYOUT FIX: Each section is a separate card with proper spacing */
/* BUG FIX #2: Add z-index for proper stacking */
.info-section {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    margin-bottom: 2rem; /* INCREASED from 1.5rem to 2rem for better separation */
    overflow: visible;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
    position: relative;
    z-index: var(--z-base);
}

.info-section:hover {
    border-color: var(--border-medium);
    box-shadow: var(--shadow-lg);
}

.info-section summary {
    padding: 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    list-style: none;
    user-select: none;
    transition: background 0.15s ease;
}

.info-section summary::-webkit-details-marker {
    display: none;
}

.info-section summary:hover {
    background: var(--bg-card-subtle);
}

.info-section summary::after {
    content: ' ▸';
    float: right;
    transition: transform 0.2s ease;
}

.info-section[open] summary::after {
    transform: rotate(90deg);
}

/* BUG FIX #3: Left-align section content */
.section-content {
    padding: 1rem 1.5rem 1.5rem 1.5rem;
    border-top: none;
    text-align: left;
}

/* Comparison Grid */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: center;
    margin: 2rem 0;
}

.comparison-item {
    text-align: center;
}

.comparison-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.comparison-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.comparison-mood {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    display: inline-block;
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Color-coded mood badges based on sentiment */
.comparison-mood.extreme-fear,
.comparison-mood.fearful {
    background: rgba(220, 38, 38, 0.15);
    color: #ef4444;
    border-color: rgba(220, 38, 38, 0.3);
}

.comparison-mood.fear {
    background: rgba(255, 140, 50, 0.15);
    color: #f97316;
    border-color: rgba(255, 140, 50, 0.6);
}

.comparison-mood.neutral {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.3);
}

.comparison-mood.bullish,
.comparison-mood.greedy {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.3);
}

.comparison-mood.bearish {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.comparison-divider {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-tertiary);
}

/* Divergence Comparison Layout */
.divergence-comparison {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: center;
    margin: 2rem 0 1.5rem 0;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.divergence-side {
    background: var(--bg-card-subtle);
    border: 1px solid rgba(255, 140, 50, 0.6);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.divergence-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.divergence-sublabel {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
}

.divergence-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.divergence-badge {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    display: inline-block;
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.divergence-divider {
    display: flex;
    align-items: center;
    justify-content: center;
}

.divergence-gap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 140, 50, 0.1);
    border: 1px solid rgba(255, 140, 50, 0.7);
    padding: 1rem 1.5rem;
    border-radius: 12px;
}

.divergence-gap-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.divergence-gap-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

/* Color-coded mood badges */
.divergence-badge.extreme-fear,
.retail-mood.extreme-fear,
.comparison-mood.extreme-fear {
    background: rgba(220, 38, 38, 0.15);
    color: #ef4444;
    border-color: rgba(220, 38, 38, 0.3);
}

.divergence-badge.fear,
.retail-mood.fear,
.comparison-mood.fear {
    background: rgba(255, 140, 50, 0.15);
    color: #f97316;
    border-color: rgba(255, 140, 50, 0.6);
}

.divergence-badge.neutral,
.retail-mood.neutral,
.comparison-mood.neutral {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.3);
}

.divergence-badge.greed,
.retail-mood.greed,
.comparison-mood.greed {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
}

.divergence-badge.extreme-greed,
.retail-mood.extreme-greed,
.comparison-mood.extreme-greed {
    background: rgba(5, 150, 105, 0.15);
    color: #059669;
    border-color: rgba(5, 150, 105, 0.3);
}

/* BUG FIX #3: Left-align insight box text */
.insight-box {
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: 1.5rem;
    text-align: left;
}

/* Metric Explainers */
.metric-explainer {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.metric-explainer:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.metric-explainer h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

/* BUG FIX #3: Left-align metric explainer text */
.metric-explainer p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
    text-align: left;
}

.metric-current {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

/* Timeframe Selector */
.timeframe-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.timeframe-btn {
    flex: 1 1 auto;
    min-width: 60px;
    padding: 0.75rem;
    background: var(--bg-card-subtle);
    border: 1px solid #5a5a5a; /* Accessible border: 3.3:1 contrast */
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.timeframe-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: #8a8a8a; /* Accessible border: 5.4:1 contrast */
}

.timeframe-btn.active {
    background: #c2410c; /* Accessible orange: 5.17:1 contrast with white */
    color: white;
    border-color: #c2410c;
}

/* Historical Stats */
.historical-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Current Score Card - Matches other stat cards */
.stat-card.current-score-card {
    /* Removed orange styling to match other cards */
}

.stat-card.current-score-card .stat-value {
    font-size: 1.5rem;
    /* Inherits default white color from .stat-card .stat-value */
}

.stat-card.current-score-card .stat-label {
    /* Inherits default tertiary color from .stat-card .stat-label */
}

/* Chart Container */
.chart-container {
    margin-bottom: 2rem;
}

.chart-container h4 {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.chart-container canvas {
    max-height: 300px;
}

/* Confidence Container */
.confidence-container {
    margin-bottom: 2rem;
}

.confidence-bar {
    height: 3px;
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-green) 0%, #22c55e 100%);
    transition: width 0.3s ease;
}

.confidence-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Detailed Breakdown Table */
.detailed-breakdown {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

.detailed-breakdown tbody tr {
    border-bottom: 1px solid var(--border-color);
}

.detailed-breakdown tbody tr:last-child {
    border-bottom: none;
}

.detailed-breakdown td {
    padding: 1rem 0;
    font-size: 0.9375rem;
}

.detailed-breakdown td:first-child {
    color: var(--text-secondary);
}

.detail-value {
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
}

/* Timestamp */
.timestamp {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    text-align: center;
    margin-top: 2rem;
}

/* Asset Grid */
.asset-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}

.asset-column h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.helper-text {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-tertiary);
    opacity: 0.7;
}

.asset-list {
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    min-height: 150px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.asset-breakdown-note {
    padding: 0.75rem 1rem;
    background: rgba(100, 181, 246, 0.05);
    border-left: 3px solid var(--accent-blue);
    border-radius: 4px;
    margin-bottom: 1rem;
}

.asset-breakdown-note small {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Section Intro */
.section-intro {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    text-align: left;
    max-width: 100%;
}

/* Asset Breakdown Grid */
.asset-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.asset-breakdown-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 140, 50, 0.6);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.asset-breakdown-card:hover {
    border-color: rgba(255, 140, 50, 0.8);
    box-shadow: 0 0 0 1px rgba(255, 140, 50, 0.2);
}

.asset-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.asset-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.bullish-icon {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--color-success);
}

.bearish-icon {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--color-danger);
}

.activity-icon {
    background: rgba(255, 140, 50, 0.1);
    border: 1px solid rgba(255, 140, 50, 0.4);
    color: var(--primary-orange);
}

.asset-card-title {
    flex: 1;
}

.asset-card-title h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
}

.asset-card-subtitle {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin: 0;
}

.asset-breakdown-card .asset-list {
    background: transparent;
    border: none;
    padding: 0;
    min-height: 120px;
}

/* Data Sources Inline */
.data-sources-inline {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: 0.5rem 0;
}

.source-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    transition: all 0.2s ease;
}

.source-badge:hover {
    border-color: rgba(255, 140, 50, 0.4);
    background: rgba(255, 140, 50, 0.05);
}

.source-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-success);
    flex-shrink: 0;
    animation: pulseGlow 2s ease infinite;
    box-shadow: 0 0 4px var(--color-success);
}

.source-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Simple Footer */
.site-footer {
    max-width: 700px;
    margin: 3rem auto 0 auto;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.site-footer p {
    margin: 0.5rem 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
}

.site-footer .disclaimer {
    text-align: center;
}

.site-footer a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

.site-footer a:hover {
    color: var(--accent-blue);
}

/* Divergence Alert */
.divergence-alert {
    max-width: 900px;
    margin: 0 auto 2rem auto;
    padding: 1.5rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    color: var(--accent-red);
    font-weight: 500;
    text-align: center;
}

/* ============================================
   DYNAMIC UX ENHANCEMENTS
   ============================================ */

/* Score Scale */
.score-scale {
    margin: 2rem auto 1.5rem auto; /* Center the scale */
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    max-width: 600px; /* Limit width */
    width: 100%;
}

.scale-bar {
    position: relative;
    height: 8px;
    border-radius: 4px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.scale-zones {
    display: flex;
    height: 100%;
}

.zone {
    flex: 1;
}

.zone.bearish {
    background: linear-gradient(90deg, #ef4444, #f59e0b);
}

.zone.neutral {
    background: #f59e0b;
}

.zone.bullish {
    background: linear-gradient(90deg, #f59e0b, #10b981);
}

.scale-indicator {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: #ffffff;
    border: 2px solid var(--bg-card);
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
    z-index: 10;
    transition: left 0.5s ease;
}

.scale-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85); /* Increased from 0.5 to 0.85 for better contrast */
    font-weight: 500; /* Slightly bolder for readability */
}

.scale-labels span {
    text-align: center;
    line-height: 1.4;
}

.scale-labels small {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.75); /* Increased from 0.4 to 0.75 */
    font-weight: 400;
}

/* Metric Interpretations */
.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.metric-value-container {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.metric-value {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    line-height: var(--leading-tight);
    font-family: 'Courier New', monospace;
    color: var(--text-primary);

    /* Add subtle background for better readability */
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid rgba(245, 158, 11, 0.3); /* Orange border to match design */
    display: inline-block;
}

.timeframe-badge {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(255, 140, 50, 0.15);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 140, 50, 0.4);
}

.metric-description {
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-relaxed);
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

/* BUG FIX #3: Left-align metric interpretation */
.metric-interpretation {
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid var(--border-emphasis);
    border-radius: 4px;
    font-size: var(--text-sm);
    font-weight: var(--font-normal);
    line-height: var(--leading-normal);
    margin-top: 0.75rem;
    margin-bottom: 12px;
    text-align: left;
    min-height: 56px;
    display: flex;
    align-items: center;
}

.metric-interpretation.positive {
    border-left-color: var(--accent-green);
    background: rgba(16, 185, 129, 0.06);
}

.metric-interpretation.negative {
    border-left-color: var(--accent-red);
    background: rgba(239, 68, 68, 0.06);
}

.metric-interpretation.neutral {
    border-left-color: var(--accent-orange);
    background: rgba(245, 158, 11, 0.06);
}

/* Insight Box Interpretation */
.insight-box.interpretation {
    margin-top: 1.5rem;
    padding: 1.25rem 1.5rem;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid #2a2a2a;
    border-left: 3px solid #3b82f6;
    border-radius: 6px;
}

.insight-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #60a5fa;
    font-size: 1rem;
}

.insight-box.interpretation p {
    margin: 0;
    font-size: 0.9375rem;
    color: #d1d5db;
    line-height: 1.6;
}

/* ========================================
   DESKTOP HOVER EFFECTS
   ======================================== */
@media (min-width: 769px) {
    /* Hero card hover */
    .status-large {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .status-large:hover {
        transform: translateY(-2px);
        border-color: var(--border-medium);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    }

    /* Market stat cards hover */
    .market-stat {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .market-stat:hover {
        transform: translateY(-2px);
        border-color: var(--border-medium);
        background: var(--bg-elevated);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    /* Insights widget hover */
    .insight-item {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .insight-item:hover {
        transform: translateY(-2px);
        border-color: rgba(59, 130, 246, 0.4);
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
        box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
    }

    /* Status and risk grid cards hover */
    .status-action {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .status-action:hover {
        transform: translateY(-1px);
        border-color: rgba(255, 140, 50, 0.7);
        box-shadow: 0 0 28px rgba(255, 140, 50, 0.7);
    }

    .risk-badge-inline {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .risk-badge-inline:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    /* Expandable sections already have hover - enhance them */
    .info-section {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .info-section:hover {
        transform: translateY(-2px);
        border-color: var(--border-medium);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    }
}

@media (max-width: 768px) {
    .status-large {
        padding: 2rem 1.5rem;
        gap: 1.5rem;
    }

    .status-icon-large {
        font-size: 3rem;
    }

    .status-title {
        font-size: 1.5rem;
    }

    .status-score {
        font-size: 3rem;
    }

    .score-scale {
        padding: 1rem;
        margin: 1rem auto;
    }

    .status-action {
        padding: 1rem;
        margin-top: 1rem;
    }

    .action-text {
        font-size: 1rem;
    }

    .comparison-grid {
        grid-template-columns: 1fr auto 1fr;
        gap: 1rem;
    }

    .comparison-divider {
        /* Keep horizontal on mobile - DO NOT rotate */
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0;
        padding: 0;
        font-size: 1rem;
    }

    /* Divergence comparison mobile layout */
    .divergence-comparison {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 1.5rem 0 1rem 0;
    }

    .divergence-divider {
        justify-content: center;
        width: 100%;
    }

    .divergence-gap {
        padding: 0.75rem 1.25rem;
    }

    .divergence-gap-label {
        font-size: 0.65rem;
    }

    .divergence-gap-value {
        font-size: 1.75rem;
    }

    .divergence-side {
        padding: 1rem;
    }

    .divergence-value {
        font-size: 2rem;
    }

    .historical-stats {
        grid-template-columns: 1fr;
    }

    .asset-grid {
        grid-template-columns: 1fr;
    }

    .data-sources-inline {
        gap: 0.5rem;
        justify-content: flex-start;
        padding: 0;
    }

    .source-badge {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
        flex: 0 0 calc(50% - 0.25rem);
        min-width: 0;
    }

    .source-label {
        font-size: 0.8125rem;
    }

    .source-dot {
        width: 7px;
        height: 7px;
    }

    .asset-breakdown-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .asset-breakdown-card {
        padding: 1.25rem;
    }

    .asset-card-icon {
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
    }

    .score-scale {
        padding: 1rem;
    }

    .scale-labels {
        font-size: 0.7rem;
    }

    .scale-labels small {
        display: none; /* Hide sub-labels on mobile for readability */
    }

    /* Chart containers on tablets */
    .chart-container canvas {
        max-height: 250px !important;
    }

    /* Metric headers stack vertically */
    .metric-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1.5rem 0.75rem;
    }

    .status-hero {
        padding: 1.5rem 1rem;
    }

    .risk-card {
        padding: 1.25rem;
    }

    .tab-content-wrapper {
        padding: 1.25rem;
    }

    .status-large {
        padding: 1.5rem 1rem;
        min-height: auto;
        gap: 1rem;
    }

    .status-title {
        font-size: 1.125rem;
    }

    .status-score {
        font-size: 1.75rem;
    }

    .action-text {
        font-size: 0.9375rem;
    }

    .status-explanation-large {
        font-size: 0.875rem;
        line-height: 1.4;
    }

    /* Hide desktop share button on mobile */
    .hero-share-btn-desktop {
        display: none !important;
    }

    /* Show mobile share badge in footer */
    .hero-badge-share {
        display: flex !important;
    }

    /* 2x2 Grid Layout for Hero Footer Badges */
    .hero-footer {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    /* New Hero Card Mobile Styles */
    .score-main {
        font-size: 4rem;
    }

    .score-divider {
        font-size: 1.5rem;
    }

    .score-total {
        font-size: 1.25rem;
    }

    .market-summary {
        font-size: 0.9375rem;
    }

    .hero-badge {
        font-size: 0.8125rem;
    }

    .current-status-box {
        padding: 0.75rem;
        margin: 0.75rem 0;
    }

    .current-status-label {
        font-size: 0.75rem;
        margin-bottom: 0.375rem;
    }

    .current-status-value {
        font-size: 1rem;
    }

    .risk-badge-inline {
        padding: 0.75rem;
        margin: 0.75rem 0;
    }

    .risk-label-inline {
        font-size: 0.75rem;
        margin-bottom: 0.375rem;
    }

    .risk-level-inline {
        font-size: 0.9375rem;
    }

    .risk-advice-inline {
        font-size: 0.8125rem;
        margin-top: 0.375rem;
    }

    .info-section summary {
        padding: 1rem;
        font-size: 0.9375rem;
    }

    .section-content {
        padding: 0 1rem 1rem 1rem;
    }

    .health-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    /* Improve mobile button spacing */
    .share-button {
        padding: 0.75rem 1.25rem;
        font-size: 0.9375rem;
    }
}

/* ============================================
   FAQ SECTION - AI/LLM OPTIMIZATION
   ============================================ */

.faq-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.faq-item {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid var(--accent-blue);
    border-radius: 4px;
}

.faq-item h3 {
    margin: 0 0 0.75rem 0;
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    line-height: var(--leading-tight);
    color: var(--text-primary);
    text-align: left;
}

/* BUG FIX #3: Left-align FAQ answers */
.faq-item p {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-relaxed);
    color: var(--text-secondary);
    text-align: left;
}

/* FAQ links - match article link styling with brand orange */
.faq-content a {
    color: var(--primary-orange);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 140, 50, 0.3);
    transition: all 0.2s ease;
}

.faq-content a:hover {
    color: var(--primary-orange-light);
    border-bottom-color: var(--primary-orange-light);
}

/* ============================================
   FIRST-TIME USER ONBOARDING
   ============================================ */

/* Overlay that covers entire screen */
.onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: none; /* Hidden by default - shown via JS after 3s delay */
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.onboarding-overlay.active {
    display: flex;
    opacity: 1;
}

/* Modal container - dark gray with orange border to match site theme */
.onboarding-modal {
    background: #1a1f26;
    border-radius: 12px;
    padding: 3rem;
    max-width: 600px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 2px solid #f97316;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.onboarding-overlay.active .onboarding-modal {
    opacity: 1;
}

/* Individual onboarding steps */
.onboarding-step {
    display: none;
    text-align: center;
}

.onboarding-step.active {
    display: block;
    animation: slideIn 0.3s ease;
}

/* Large emoji icon */
.onboarding-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    line-height: 1;
}

/* Step heading */
.onboarding-modal h2 {
    font-size: var(--text-3xl);
    font-weight: var(--font-semibold);
    line-height: var(--leading-tight);
    margin-bottom: 1rem;
    color: #fff;
}

/* Step body text */
.onboarding-modal p {
    font-size: var(--text-lg);
    font-weight: var(--font-normal);
    line-height: var(--leading-relaxed);
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
}

/* Highlighted detail box - dark background with orange accent */
.onboarding-detail {
    background: #0f1419;
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid #f97316;
    border: 1px solid #2a2a2a;
    border-left: 3px solid #f97316;
    margin-top: 1rem;
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-normal);
}

/* Bullet list for step 2 */
.onboarding-list {
    text-align: left;
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.onboarding-list li {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    border-left: 2px solid rgba(255, 140, 50, 0.6);
}

/* Next and Start buttons - orange to match site theme */
.onboarding-next,
.onboarding-start {
    background: #c2410c;
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1.5rem;
    transition: all 0.2s ease;
}

.onboarding-next:hover,
.onboarding-start:hover {
    background: #9a3412;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(194, 65, 12, 0.4);
}

/* Skip button in top right */
.onboarding-skip {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    transition: color 0.2s ease;
}

.onboarding-skip:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .onboarding-modal {
        padding: 2rem 1.5rem;
        width: 95%;
    }

    .onboarding-modal h2 {
        font-size: 1.4rem;
    }

    .onboarding-modal p {
        font-size: 0.95rem;
    }

    .onboarding-icon {
        font-size: 3rem;
    }

    .onboarding-next,
    .onboarding-start {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .onboarding-modal {
        padding: 1.5rem 1rem;
    }

    .onboarding-modal h2 {
        font-size: 1.2rem;
    }

    .onboarding-icon {
        font-size: 2.5rem;
    }

    .onboarding-list li {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }
}

/* ============================================
   TOOLTIPS FOR TECHNICAL TERMS
   ============================================ */

/* Small ⓘ icon trigger - Clean Design */
/* BUG FIX #2: Ensure tooltip trigger has proper z-index */
.tooltip-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 24px;
    width: 24px;
    height: 24px;
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: 'Georgia', serif;
    font-style: italic;
    color: var(--text-secondary);
    cursor: help;
    margin-left: 0.5rem;
    position: relative;
    z-index: var(--z-tooltip);
    vertical-align: middle;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.tooltip-trigger svg {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.tooltip-trigger:hover {
    background: var(--bg-card);
    border-color: var(--border-medium);
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
}

.tooltip-trigger:hover svg {
    color: var(--text-primary);
}

/* Tooltip popup - Clean Design */
/* BUG FIX #2: Use z-tooltip variable for proper stacking */
.tooltip-trigger:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    width: 250px;
    text-align: left;
    line-height: 1.4;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-medium);
    z-index: var(--z-tooltip);
    font-weight: normal;
    font-style: normal;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    white-space: normal;
    pointer-events: none;
}

/* Tooltip arrow - Clean Design */
/* BUG FIX #2: Ensure arrow is above tooltip */
.tooltip-trigger:hover::before {
    content: '';
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--border-medium);
    z-index: calc(var(--z-tooltip) + 1);
}

/* Mobile responsive tooltips */
@media (max-width: 768px) {
    .tooltip-trigger:hover::after {
        width: 200px;
        font-size: 0.8rem;
        padding: 0.65rem 0.85rem;
        /* Prevent overflow on mobile */
        left: auto;
        right: 0;
        transform: none;
        max-width: calc(100vw - 2rem);
    }

    .tooltip-trigger:hover::before {
        border-width: 5px;
        /* Align arrow with adjusted tooltip */
        left: auto;
        right: 1rem;
        transform: none;
    }
}

@media (max-width: 480px) {
    .tooltip-trigger {
        min-width: 20px;
        min-height: 20px;
        width: 20px;
        height: 20px;
        font-size: 0.65rem;
        line-height: 20px;
    }

    .tooltip-trigger:hover::after {
        width: 180px;
        max-width: calc(100vw - 2rem);
        left: auto;
        right: 0;
        transform: none;
        font-size: 0.75rem;
    }
}

/* ============================================
   SECTION ICON CONTAINERS (Glass Style)
   ============================================ */

/* Clean container for section header icons */
.section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    font-size: 1.2rem;
    margin-right: 0.75rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.section-icon:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-medium);
}

/* ============================================
   HEALTH/STATUS DOTS (Risk Indicators)
   ============================================ */

/* Base colored dot indicator */
.health-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

/* Risk level colors - Clean design */
.health-dot.minimal {
    background: #10b981;
}

.health-dot.low {
    background: #22c55e;
}

.health-dot.moderate {
    background: #f59e0b;
}

.health-dot.high {
    background: #ef4444;
}

.health-dot.critical {
    background: #dc2626;
}

/* Historical Context Example Styling */
.historical-example {
    background: rgba(255, 140, 50, 0.08);
    border: 1px solid #2a2a2a;
    border-left: 3px solid #f97316;
    border-radius: 6px;
    padding: 1.25rem 1.5rem;
    margin-top: 1.5rem;
}

.example-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.example-icon {
    width: 20px;
    height: 20px;
    color: #fb923c;
    flex-shrink: 0;
}

.example-header h4 {
    margin: 0;
    font-size: 1rem;
    color: #fb923c;
    font-weight: 600;
}

.example-text {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .historical-example {
        padding: 1rem;
    }

    .example-header h4 {
        font-size: 0.95rem;
    }

    .example-text {
        font-size: 0.9rem;
    }
}

/* ============================================
   SHARE BUTTON
   ============================================ */

/* Hero Share Button - Desktop Only (Top Right) */
.hero-share-btn-desktop {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    z-index: 10;
}

.hero-share-btn-desktop:hover {
    background: var(--bg-card-subtle);
    border-color: var(--border-medium);
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
    transform: scale(1.05);
}

.hero-share-btn-desktop:active {
    transform: scale(0.95);
}

.hero-share-btn-desktop svg {
    transition: color 0.2s ease;
}

/* Hero Share Badge - Mobile Footer Badge */
.hero-badge-share {
    display: none; /* Hidden on desktop */
    cursor: pointer;
    transition: all 0.2s ease;
    /* Inherit badge styles */
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid rgba(255, 140, 50, 0.4);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.hero-badge-share:hover {
    background: rgba(255, 140, 50, 0.15);
    border-color: rgba(255, 140, 50, 0.6);
    transform: translateY(-1px);
}

.hero-badge-share:active {
    transform: translateY(0);
}

.hero-badge-share svg {
    flex-shrink: 0;
    color: var(--text-secondary);
}

/* ============================================
   CUSTOM SHARE MODAL
   ============================================ */
.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.share-modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    position: relative;
    animation: slideUp 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.share-modal h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

.share-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.share-modal-close:hover {
    background: rgba(255, 140, 50, 0.15);
    color: var(--primary-orange);
}

.share-platforms {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.share-platform-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid;
}

.share-platform-btn svg {
    flex-shrink: 0;
}

/* X (Twitter) Button */
.twitter-btn {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

.twitter-btn:hover {
    background: #1a1a1a;
    border-color: #333333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Telegram Button */
.telegram-btn {
    background: #0088cc;
    color: #ffffff;
    border-color: #0088cc;
}

.telegram-btn:hover {
    background: #0099dd;
    border-color: #00aaee;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.4);
}

/* Copy Button */
.copy-btn {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: rgba(255, 140, 50, 0.4);
}

.copy-btn:hover {
    background: rgba(255, 140, 50, 0.15);
    border-color: rgba(255, 140, 50, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 140, 50, 0.2);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .share-modal {
        padding: 1.5rem;
    }

    .share-modal h3 {
        font-size: 1.125rem;
        margin-bottom: 1.25rem;
    }

    .share-platform-btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

/* ============================================
   SIMPLIFIED "HOW IT WORKS" MODAL
   ============================================ */

.modal-section {
    max-width: 700px;
    margin: 0 auto;
    text-align: left;
}

.modal-section h3 {
    text-align: left !important;
}

.modal-intro {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.9);
}

.how-it-works-simple {
    margin-bottom: 2rem;
}

.how-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.how-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: var(--accent-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
}

.how-content h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.05rem;
}

.how-content p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.8);
}

.how-score,
.how-divergence {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.how-score h4,
.how-divergence h4 {
    margin-bottom: 1rem;
    font-size: 1.15rem;
}

.how-score p,
.how-divergence p {
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
}

.how-score ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.how-score ul li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.8);
}

.modal-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 768px) {
    .how-item {
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .how-number {
        width: 35px;
        height: 35px;
        font-size: 1.1rem;
    }

    .how-content h4 {
        font-size: 1rem;
    }

    .how-content p {
        font-size: 0.9rem;
    }
}

/* ============================================
   CARD ENTRANCE ANIMATIONS & DEPTH
   ============================================ */

/* Animations removed for clean, crisp design */

/* Chart Container Depth */
.chart-container {
    background: var(--bg-card-solid);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-sm);
}

.chart-container canvas {
    border-radius: 8px;
}

/* Metric Cards - Clean Design */
/* BUG FIX #2: Add z-index for proper stacking */
.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.25rem;
    position: relative;
    z-index: var(--z-base);
    overflow: visible;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
}

.metric-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--border-medium);
}

/* Metric badges - Clean Design */
.floating-metric {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.125rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    font-weight: 600;
    transition: all 0.2s ease;
}

.floating-metric:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-medium);
}

/* ============================================
   STATUS ICON SYSTEM - Clean CSS Icons
   ============================================ */

/* Base status icon */
.status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 6px;
    position: relative;
    flex-shrink: 0;
    vertical-align: middle;
}

/* Success checkmark */
.status-success {
    background: var(--accent-green);
}

.status-success::after {
    content: '✓';
    position: absolute;
    color: #000;
    font-size: 11px;
    font-weight: 700;
    left: 50%;
    top: 48%;
    transform: translate(-50%, -50%);
}

/* Warning scale */
.status-warning {
    background: var(--warning);
}

.status-warning::after {
    content: '⚡';
    position: absolute;
    font-size: 10px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* Danger indicator */
.status-danger {
    background: var(--danger);
}

.status-danger::after {
    content: '!';
    position: absolute;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    left: 50%;
    top: 48%;
    transform: translate(-50%, -50%);
}

/* Info indicator */
.status-info {
    background: var(--accent-blue);
}

.status-info::after {
    content: 'i';
    position: absolute;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    font-style: italic;
    font-family: Georgia, serif;
    left: 50%;
    top: 48%;
    transform: translate(-50%, -50%);
}

/* Chart up (bullish) */
.status-chart-up {
    background: var(--accent-green);
}

.status-chart-up::after {
    content: '↗';
    position: absolute;
    color: #000;
    font-size: 13px;
    font-weight: 700;
    left: 50%;
    top: 46%;
    transform: translate(-50%, -50%);
}

/* Chart down (bearish) */
.status-chart-down {
    background: var(--danger);
}

.status-chart-down::after {
    content: '↘';
    position: absolute;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    left: 50%;
    top: 48%;
    transform: translate(-50%, -50%);
}

/* Neutral face */
.status-neutral {
    background: var(--warning);
}

.status-neutral::after {
    content: '—';
    position: absolute;
    color: #000;
    font-size: 11px;
    font-weight: 700;
    left: 50%;
    top: 46%;
    transform: translate(-50%, -50%);
}

/* ============================================
   LOADING SKELETON STATES
   ============================================ */

/* Skeleton loader animation */
@keyframes skeleton-pulse {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.6;
    }
}

/* Base skeleton styles */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-card) 0%,
        var(--bg-elevated) 50%,
        var(--bg-card) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: 4px;
}

/* Skeleton for metric cards */
.skeleton-metric-card {
    height: 120px;
    width: 100%;
    border-radius: 8px;
}

/* Loading overlay for Historical Trends section */
.historical-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.historical-loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-orange);
    border-radius: 50%;
    animation: spinner-rotate 0.8s linear infinite;
}

@keyframes spinner-rotate {
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Skeleton for hero section */
.skeleton-hero {
    height: 200px;
    width: 100%;
    border-radius: 12px;
    margin-bottom: 2rem;
}

/* Skeleton for text lines */
.skeleton-text {
    height: 16px;
    width: 100%;
    margin-bottom: 0.5rem;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.medium {
    width: 80%;
}

/* Skeleton for stat values */
.skeleton-stat {
    height: 32px;
    width: 120px;
    margin-bottom: 0.5rem;
}

/* Skeleton for charts */
.skeleton-chart {
    height: 300px;
    width: 100%;
    border-radius: 8px;
}

/* Loading state container */
.loading-state {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2rem;
}

/* Hide content while loading */
.is-loading .content {
    display: none;
}

.is-loading .skeleton {
    display: block;
}

.content .skeleton {
    display: none;
}

/* ============================================
   KEYBOARD NAVIGATION & FOCUS STATES
   ============================================ */

/* Focus visible styles for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--primary-orange);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Button focus states */
button:focus-visible,
.btn:focus-visible,
.share-btn:focus-visible {
    outline: 2px solid var(--primary-orange);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(255, 140, 50, 0.1);
}

/* Link focus states */
a:focus-visible {
    outline: 2px solid var(--primary-orange);
    outline-offset: 2px;
    text-decoration: underline;
}

/* Interactive card focus states */
.status-large:focus-visible,
.info-section:focus-visible,
.metric-card:focus-visible {
    outline: 2px solid var(--primary-orange);
    outline-offset: 2px;
    transform: scale(1.005);
    box-shadow: 0 0 0 4px rgba(255, 140, 50, 0.1);
}

/* Tab navigation focus states */
.tab-nav button:focus-visible {
    outline: 2px solid var(--primary-orange);
    outline-offset: -2px;
    z-index: 1;
}

/* Timeframe button focus states */
.timeframe-btn:focus-visible {
    outline: 2px solid var(--primary-orange);
    outline-offset: -2px;
}

/* Tooltip trigger focus states */
.tooltip-trigger:focus-visible {
    outline: 2px solid var(--primary-orange);
    outline-offset: 2px;
    background: var(--bg-card);
    border-color: var(--primary-orange);
}

/* Modal close button focus state */
.close-btn:focus-visible {
    outline: 2px solid var(--primary-orange);
    outline-offset: 2px;
    transform: scale(1.1);
}

/* Skip to main content link (for screen readers) */
.skip-to-main {
    position: absolute;
    left: -9999px;
    z-index: 999;
    padding: 1rem;
    background: var(--bg-card);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 4px;
}

.skip-to-main:focus {
    left: 1rem;
    top: 1rem;
    outline: 2px solid var(--primary-orange);
    outline-offset: 2px;
}

/* Screen reader only utility class */
.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;
}

/* Screen reader only but focusable */
.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* ============================================
   MOBILE TOUCH STATES
   ============================================ */

/* Touch states for mobile devices (no hover capability) */
@media (hover: none) {
    /* Share button */
    .share-btn:active {
        background: var(--bg-card);
        border-color: var(--border-medium);
        color: var(--text-primary);
        transform: scale(0.98);
    }

    /* Tooltip triggers */
    .tooltip-trigger:active {
        background: var(--bg-card);
        border-color: var(--border-medium);
        transform: scale(0.95);
    }

    /* Timeframe buttons */
    .timeframe-btn:active {
        background: var(--bg-card);
        transform: scale(0.97);
    }

    /* Info section summaries */
    .info-section summary:active {
        background: var(--bg-card-subtle);
    }

    /* Health items */
    .health-item:active {
        border-color: var(--border-medium);
        transform: translateX(2px);
    }

    /* Status action box */
    .status-action:active {
        border-color: var(--border-medium);
        transform: scale(0.99);
    }

    /* Risk badge */
    .risk-badge-inline:active {
        border-color: var(--border-medium);
        transform: scale(0.99);
    }

    /* Card hover states become touch states */
    .status-large:active,
    .info-section:active,
    .metric-card:active {
        transform: scale(0.995);
    }
}
