/* ==========================================
   Suez SAF Monopsony 2026 - Main Stylesheet
   Intelligence Report Design System
   ========================================== */

:root {
    --primary-color: #0ea5e9;
    --secondary-color: #0369a1;
    --accent-color: #38bdf8;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #8b5cf6;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;

    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.12);

    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;

    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-primary);
}

/* ---- Loading Screen ---- */
.loading-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, #0c4a6e 0%, #0369a1 50%, #0ea5e9 100%);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999; transition: opacity 0.6s ease;
}
.loading-screen.hidden { opacity: 0; pointer-events: none; }
.loader { text-align: center; }
.loader .pulse {
    width: 70px; height: 70px; border-radius: 50%;
    background: rgba(255,255,255,0.25);
    animation: pulse 1.5s ease-in-out infinite;
    margin: 0 auto;
}
.loader p { color: white; margin-top: 18px; font-weight: 600; font-size: 1.05rem; letter-spacing: 0.5px; }
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.6); opacity: 0.3; }
}

/* ---- Header ---- */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}
.header-container {
    max-width: 1500px; margin: 0 auto;
    padding: 0.9rem 2rem;
    display: flex; align-items: center; justify-content: space-between;
}
.logo-link {
    display: flex; align-items: center; gap: 0.6rem;
    text-decoration: none; color: var(--text-primary);
    font-weight: 800; font-size: 1.2rem;
}
.logo-icon { font-size: 1.6rem; }
.main-nav { display: flex; gap: 1.75rem; }
.nav-link {
    text-decoration: none; color: var(--text-secondary);
    font-weight: 500; font-size: 0.95rem;
    transition: color var(--transition-fast);
}
.nav-link:hover, .nav-link.active { color: var(--primary-color); }
.reports-link { color: var(--primary-color); font-weight: 700; }
.mobile-menu-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; }

/* ---- Reading Progress ---- */
.reading-progress {
    position: fixed; top: 0; left: 0; height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--info-color));
    z-index: 101; transform-origin: left; transition: width 0.1s linear;
    width: 0;
}

/* ---- Layout ---- */
.report-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    max-width: 1500px;
    margin: 0 auto;
    gap: 3rem;
    padding: 2rem 2rem;
    align-items: start;
}

/* ---- Sidebar ---- */
.sidebar {
    position: sticky; top: 75px;
    height: fit-content;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
}
.sidebar-header {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #0c4a6e, #0369a1);
    border-radius: 10px; margin-bottom: 0.75rem;
    color: white;
}
.sidebar-header h3 { font-size: 0.95rem; font-weight: 700; }
.sidebar-nav { display: flex; flex-direction: column; gap: 0.2rem; }
.sidebar-nav .nav-link {
    padding: 0.7rem 1rem; border-radius: 7px;
    font-size: 0.875rem; font-weight: 500; color: var(--text-secondary);
    transition: all var(--transition-fast);
}
.sidebar-nav .nav-link:hover { background: var(--bg-secondary); color: var(--primary-color); }
.sidebar-nav .nav-link.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white; font-weight: 600;
}
.sidebar-nav .toolkit-link {
    margin-top: 0.75rem; background: #f59e0b; color: white; font-weight: 700;
    text-align: center;
}
.sidebar-nav .toolkit-link:hover { background: #d97706; color: white; }
.metrics-widget {
    margin-top: 1.5rem; padding: 1.25rem;
    background: var(--bg-secondary); border-radius: 10px;
    border: 1px solid var(--border-color);
}
.metrics-widget h4 { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 1rem; }
.metric-item { display: flex; justify-content: space-between; align-items: center; padding: 0.65rem 0; border-bottom: 1px solid var(--border-color); }
.metric-item:last-child { border-bottom: none; }
.metric-label { font-size: 0.8rem; color: var(--text-secondary); }
.metric-value { font-weight: 700; color: var(--success-color); font-family: var(--font-mono); font-size: 0.9rem; }
.metric-value.negative { color: var(--danger-color); }
.metric-value.warning { color: var(--warning-color); }

/* ---- Main Content ---- */
.main-content { max-width: 920px; min-width: 0; padding-bottom: 4rem; }

/* ---- Hero ---- */
.hero-section { margin-bottom: 4rem; }
.classification-banner {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, #0c4a6e, #0369a1);
    color: white; border-radius: 6px; margin-bottom: 2rem;
    font-size: 0.78rem; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase;
}
.report-metadata { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.badge {
    padding: 0.35rem 0.85rem; border-radius: 9999px;
    font-size: 0.72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.sector-badge { background: #dbeafe; color: #1e40af; }
.type-badge { background: #fef3c7; color: #92400e; }
.priority-badge { background: #fee2e2; color: #991b1b; }
.geo-badge { background: #f3e8ff; color: #6b21a8; }
.hero-title { margin-bottom: 1.5rem; }
.title-main {
    display: block; font-size: 2.8rem; font-weight: 900; line-height: 1.1;
    background: linear-gradient(135deg, #0c4a6e, #0ea5e9);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.title-sub { display: block; font-size: 1.4rem; font-weight: 600; color: var(--text-secondary); margin-top: 0.75rem; line-height: 1.4; }
.hero-abstract { margin: 2rem 0; }
.lead-text { font-size: 1.125rem; line-height: 1.9; color: var(--text-secondary); }

/* Stats Dashboard */
.stats-dashboard {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem; margin: 2.5rem 0;
}
.stat-card {
    padding: 1.75rem; border-radius: 12px;
    background: var(--bg-secondary); border: 2px solid var(--border-color);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-xl); }
.stat-primary { border-color: var(--primary-color); background: linear-gradient(135deg, rgba(14,165,233,0.08), rgba(3,105,161,0.08)); }
.stat-warning { border-color: var(--warning-color); background: linear-gradient(135deg, rgba(245,158,11,0.08), rgba(251,191,36,0.08)); }
.stat-success { border-color: var(--success-color); background: linear-gradient(135deg, rgba(16,185,129,0.08), rgba(5,150,105,0.08)); }
.stat-danger { border-color: var(--danger-color); background: linear-gradient(135deg, rgba(239,68,68,0.08), rgba(220,38,38,0.08)); }
.stat-info { border-color: var(--info-color); background: linear-gradient(135deg, rgba(139,92,246,0.08), rgba(109,40,217,0.08)); }
.stat-icon { font-size: 2.25rem; margin-bottom: 0.75rem; }
.stat-number { font-size: 2.25rem; font-weight: 900; line-height: 1; margin-bottom: 0.2rem; }
.stat-unit { font-size: 0.9rem; color: var(--text-secondary); font-weight: 600; }
.stat-label { font-size: 0.85rem; color: var(--text-secondary); margin-top: 0.4rem; }

/* Sources Banner */
.sources-banner { margin-top: 2.5rem; padding: 1.25rem 1.5rem; background: var(--bg-tertiary); border-left: 4px solid var(--primary-color); border-radius: 6px; }
.sources-label { font-weight: 700; color: var(--text-secondary); font-size: 0.9rem; }
.source-logos { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.75rem; }
.source-tag { padding: 0.3rem 0.75rem; background: white; border: 1px solid var(--border-color); border-radius: 4px; font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); }

/* ---- AIO Summary ---- */
.aio-summary { background: linear-gradient(135deg, #0f172a 0%, #0c4a6e 100%); padding: 2.5rem; border-radius: 16px; margin-bottom: 3rem; color: white; }

/* ---- Section ---- */
.section-main { margin-bottom: 5rem; padding-top: 2rem; }
.section-header { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 2px solid var(--border-color); }
.section-title { font-size: 2.1rem; font-weight: 800; margin-bottom: 0.75rem; display: flex; align-items: center; gap: 1rem; line-height: 1.2; }
.section-number {
    display: inline-flex; align-items: center; justify-content: center;
    width: 50px; height: 50px; flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white; border-radius: 12px; font-size: 1.4rem; font-weight: 900;
}
.section-meta { display: flex; gap: 1rem; font-size: 0.875rem; flex-wrap: wrap; }
.reading-time, .section-priority { padding: 0.25rem 0.75rem; background: var(--bg-secondary); border-radius: 4px; font-weight: 600; }

/* Content Blocks */
.content-block { margin-bottom: 2.5rem; }
.lead-paragraph { font-size: 1.2rem; line-height: 1.85; color: var(--text-secondary); margin-bottom: 2rem; }
.highlight-block { padding: 2rem; background: linear-gradient(135deg, rgba(14,165,233,0.05), rgba(3,105,161,0.05)); border-left: 4px solid var(--primary-color); border-radius: 10px; }
.warning-block { padding: 2rem; background: rgba(245,158,11,0.07); border-left: 4px solid var(--warning-color); border-radius: 10px; }
.success-block { padding: 2rem; background: rgba(16,185,129,0.07); border-left: 4px solid var(--success-color); border-radius: 10px; }
.danger-block { padding: 2rem; background: rgba(239,68,68,0.07); border-left: 4px solid var(--danger-color); border-radius: 10px; }
.info-block { padding: 2rem; background: rgba(139,92,246,0.07); border-left: 4px solid var(--info-color); border-radius: 10px; }
.block-icon { font-size: 2rem; margin-bottom: 1rem; }
.content-block h3 { font-size: 1.4rem; font-weight: 700; margin-bottom: 1rem; color: var(--text-primary); }
.content-block h4 { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.75rem; }
.content-block p { margin-bottom: 1rem; line-height: 1.8; }
.content-block p:last-child { margin-bottom: 0; }

/* Lists */
.check-list, .arrow-list, .detailed-list { list-style: none; padding-left: 0; }
.check-list li { padding: 0.4rem 0 0.4rem 1.75rem; position: relative; }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--success-color); font-weight: 700; }
.arrow-list li { padding: 0.4rem 0 0.4rem 1.75rem; position: relative; }
.arrow-list li::before { content: "→"; position: absolute; left: 0; color: var(--primary-color); font-weight: 700; }
.detailed-list li { margin-bottom: 1rem; padding-left: 1.5rem; position: relative; }
.detailed-list li::before { content: "▸"; position: absolute; left: 0; color: var(--primary-color); }

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

/* Alert Blocks */
.alert-block { padding: 1.5rem; border-radius: 8px; border-left: 4px solid; margin: 2rem 0; }
.alert-block.warning { background: rgba(245,158,11,0.08); border-color: var(--warning-color); }
.alert-block.info { background: rgba(14,165,233,0.08); border-color: var(--primary-color); }
.alert-block.danger { background: rgba(239,68,68,0.08); border-color: var(--danger-color); }
.alert-block.success { background: rgba(16,185,129,0.08); border-color: var(--success-color); }
.alert-block h5 { margin-bottom: 0.5rem; font-size: 1rem; font-weight: 700; }

/* Math/Physics Box */
.physics-box {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 2px solid #bae6fd; border-radius: 12px;
    padding: 2rem; margin: 2rem 0;
    font-family: var(--font-mono);
    position: relative; overflow: hidden;
}
.physics-box::before {
    content: "∑";
    position: absolute; right: 1.5rem; top: 0.5rem;
    font-size: 5rem; color: rgba(14,165,233,0.1);
    font-family: serif; pointer-events: none;
}
.physics-box h4 { color: #0369a1; font-size: 1.1rem; margin-bottom: 1.25rem; font-family: var(--font-body); }
.formula-line { background: white; border-radius: 8px; padding: 1rem 1.5rem; margin: 0.75rem 0; border-left: 3px solid var(--primary-color); font-size: 0.95rem; }
.formula-result { background: #0369a1; color: white; border-radius: 8px; padding: 1rem 1.5rem; margin-top: 1rem; font-size: 1.05rem; font-weight: 700; }

/* Tables */
.table-wrapper { overflow-x: auto; margin: 2rem 0; border-radius: 10px; box-shadow: var(--shadow-md); }
.data-table { width: 100%; border-collapse: collapse; background: white; }
.data-table thead { background: linear-gradient(135deg, #0c4a6e, #0369a1); color: white; }
.data-table th, .data-table td { padding: 1rem 1.25rem; text-align: left; font-size: 0.95rem; }
.data-table th { font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; }
.data-table tbody tr { border-bottom: 1px solid var(--border-color); transition: background var(--transition-fast); }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-secondary); }
.highlight-cell { color: var(--warning-color); font-weight: 600; }
.cell-green { color: var(--success-color); font-weight: 700; }
.cell-red { color: var(--danger-color); font-weight: 700; }
.cell-blue { color: var(--primary-color); font-weight: 700; }
.total-row { background: var(--bg-tertiary) !important; font-weight: 700; }

/* Timeline */
.timeline-block { padding: 2rem; background: var(--bg-secondary); border-radius: 12px; }
.timeline-events { position: relative; padding-left: 2.5rem; }
.timeline-events::before { content: ''; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; background: var(--border-color); }
.timeline-event { position: relative; margin-bottom: 2.25rem; }
.timeline-event::before { content: ''; position: absolute; left: -2.1rem; top: 0.35rem; width: 14px; height: 14px; border-radius: 50%; background: var(--primary-color); border: 3px solid white; box-shadow: 0 0 0 2px var(--primary-color); }
.timeline-event.milestone::before { background: var(--success-color); box-shadow: 0 0 0 2px var(--success-color); }
.timeline-event.warning::before { background: var(--warning-color); box-shadow: 0 0 0 2px var(--warning-color); }
.timeline-event.crisis::before { background: var(--danger-color); box-shadow: 0 0 0 2px var(--danger-color); }
.event-date { font-weight: 800; color: var(--primary-color); font-size: 0.85rem; margin-bottom: 0.4rem; text-transform: uppercase; letter-spacing: 0.5px; }

/* Key Findings */
.key-findings { margin: 3rem 0; }
.key-findings h3 { font-size: 1.5rem; font-weight: 800; margin-bottom: 1.5rem; }
.findings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.finding-card { padding: 1.5rem; background: var(--bg-secondary); border-radius: 10px; border: 1px solid var(--border-color); transition: all var(--transition-fast); }
.finding-card:hover { border-color: var(--primary-color); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.finding-number { display: inline-block; font-size: 1.5rem; font-weight: 900; color: var(--primary-color); opacity: 0.3; margin-bottom: 0.5rem; font-family: var(--font-mono); }
.finding-card h4 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.finding-card p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; }

/* Recommendations */
.recommendations-block { padding: 2rem; background: var(--bg-secondary); border-radius: 12px; border: 1px solid var(--border-color); }
.recommendations-block h3 { font-size: 1.35rem; font-weight: 800; margin-bottom: 1.5rem; }
.recommendations-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.recommendation-card { padding: 1.5rem; border-radius: 10px; border: 1px solid var(--border-color); background: white; }
.recommendation-card h4 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.recommendation-card ul { list-style: none; padding: 0; }
.recommendation-card ul li { padding: 0.4rem 0 0.4rem 1.5rem; position: relative; font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; }
.recommendation-card ul li::before { content: "▸"; position: absolute; left: 0; color: var(--primary-color); font-weight: 700; }

/* Passenger Impact Box */
.passenger-box {
    background: linear-gradient(135deg, #faf5ff, #ede9fe);
    border: 2px solid #c4b5fd; border-radius: 12px;
    padding: 2.5rem; margin: 2rem 0;
}
.passenger-box h4 { color: #6d28d9; font-size: 1.25rem; font-weight: 800; margin-bottom: 1.25rem; }

/* Scenario Table */
.scenario-table { overflow-x: auto; margin: 2rem 0; }

/* CTA Buttons */
.next-section-cta { margin: 3rem 0; padding: 2rem; text-align: center; background: var(--bg-secondary); border-radius: 12px; }
.cta-button {
    display: inline-block; padding: 1rem 2.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white; text-decoration: none; border-radius: 8px;
    font-weight: 700; font-size: 1.05rem;
    transition: all var(--transition-fast); margin-top: 1rem;
}
.cta-button:hover { transform: translateY(-2px); box-shadow: var(--shadow-xl); }

/* Data Sources Section */
.data-sources-section { background: var(--bg-secondary); padding: 2rem; border-radius: 12px; margin-bottom: 3rem; border: 1px solid var(--border-color); }

/* Footer */
.report-footer { background: #0f172a; color: #e2e8f0; padding: 3rem 0; text-align: center; border-top: 1px solid #1e293b; width: 100%; clear: both; }
.footer-content { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.footer-content p { margin: 0.5rem 0; font-size: 0.9rem; }
.footer-content a { color: #60a5fa; text-decoration: none; transition: color 0.2s; }
.footer-content a:hover { color: #93c5fd; }

/* ---- Responsive ---- */
@media (max-width: 1100px) {
    .report-container { grid-template-columns: 240px 1fr; gap: 2rem; }
}
@media (max-width: 900px) {
    .report-container { grid-template-columns: 1fr; }
    .sidebar { position: relative; top: 0; max-height: none; }
    .title-main { font-size: 2rem; }
    .content-grid-2, .content-grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .title-main { font-size: 1.6rem; }
    .section-title { font-size: 1.5rem; }
    .stats-dashboard { grid-template-columns: 1fr 1fr; }
    .main-nav { display: none; }
    .mobile-menu-toggle { display: block; }
    .header-container { padding: 0.75rem 1rem; }
}
