/* ==========================================
   BESS & GET Hidden Costs — Intelligence Report
   Design System: Deep Teal, Slate & Danger Crimson
   ========================================== */

:root {
    --primary-color:   #0d9488;      /* Teal — Energy Storage */
    --secondary-color: #0f766e;
    --accent-color:    #14b8a6;
    --success-color:   #16a34a;
    --warning-color:   #f59e0b;
    --danger-color:    #dc2626;
    --info-color:      #2563eb;
    --slate-color:     #1e293b;

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

    --bg-primary:   #ffffff;
    --bg-secondary: #f0fdfa;
    --bg-tertiary:  #e6fffa;
    --bg-dark:      #0f172a;

    --border-color: #ccfbf1;
    --shadow-sm: 0 1px 3px rgba(13,148,136,0.07);
    --shadow-md: 0 4px 12px rgba(13,148,136,0.10);
    --shadow-lg: 0 10px 30px rgba(13,148,136,0.12);
    --shadow-xl: 0 20px 40px rgba(13,148,136,0.18);

    --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;
}

*, *::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, #0f172a 0%, #134e4a 50%, #0d9488 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(20,184,166,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;
}
.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, #0f766e, #0d9488, #14b8a6);
    z-index: 101; width: 0; transition: width 0.1s linear;
}

/* ---- 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, #0f172a, #134e4a);
    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: var(--danger-color); color: white; font-weight: 700;
    text-align: center;
}
.sidebar-nav .toolkit-link:hover { background: #b91c1c; 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); }
.metric-value.teal     { color: var(--primary-color); }
.metric-value.slate    { color: var(--slate-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, #0f172a, #0d9488);
    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: #ccfbf1; color: #134e4a; }
.type-badge      { background: #fee2e2; color: #991b1b; }
.priority-badge  { background: #fee2e2; color: #991b1b; }
.geo-badge       { background: #e0f2fe; color: #075985; }
.tech-badge      { background: #f0fdf4; color: #14532d; }
.hero-title { margin-bottom: 1.5rem; }
.title-main {
    display: block; font-size: 2.6rem; font-weight: 900; line-height: 1.1;
    background: linear-gradient(135deg, #0f172a, #0d9488, #14b8a6);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.title-sub { display: block; font-size: 1.3rem; 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(175px, 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(13,148,136,0.07), rgba(15,118,110,0.07)); }
.stat-warning { border-color: var(--warning-color); background: linear-gradient(135deg, rgba(245,158,11,0.07), rgba(217,119,6,0.07)); }
.stat-success { border-color: var(--success-color); background: linear-gradient(135deg, rgba(22,163,74,0.07), rgba(21,128,61,0.07)); }
.stat-danger  { border-color: var(--danger-color);  background: linear-gradient(135deg, rgba(220,38,38,0.07), rgba(185,28,28,0.07)); }
.stat-info    { border-color: var(--slate-color);   background: linear-gradient(135deg, rgba(30,41,59,0.07), rgba(15,23,42,0.07)); }
.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%, #134e4a 50%, #065f46 100%); padding: 2.5rem; border-radius: 16px; margin-bottom: 3rem; color: white; }

/* ---- Math / Formula Box ---- */
.data-box {
    background: linear-gradient(135deg, #0f172a, #134e4a);
    border: 1px solid rgba(13,148,136,0.5); border-radius: 12px;
    padding: 2rem; margin: 2rem 0;
    font-family: var(--font-mono);
    color: #e2e8f0;
    position: relative; overflow: hidden;
}
.data-box::before {
    content: "⚡";
    position: absolute; right: 1.5rem; top: 0.5rem;
    font-size: 6rem; color: rgba(13,148,136,0.08);
    pointer-events: none;
}
.data-box h4 { color: #5eead4; font-size: 1.1rem; margin-bottom: 1.25rem; font-family: var(--font-body); font-weight: 700; }
.formula-line { background: rgba(255,255,255,0.07); border-radius: 8px; padding: 1rem 1.5rem; margin: 0.75rem 0; border-left: 3px solid var(--primary-color); font-size: 0.92rem; color: #ccfbf1; }
.formula-result { background: linear-gradient(135deg, #dc2626, #b91c1c); color: white; border-radius: 8px; padding: 1rem 1.5rem; margin-top: 1rem; font-size: 1.05rem; font-weight: 700; }

/* Physics Box */
.physics-box {
    background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
    border: 2px solid #14b8a6; border-radius: 12px;
    padding: 2rem; margin: 2rem 0;
    position: relative; overflow: hidden;
}
.physics-box::before {
    content: "θ";
    position: absolute; right: 1.5rem; top: 0.5rem;
    font-size: 5rem; color: rgba(13,148,136,0.12);
    font-family: serif; pointer-events: none;
}
.physics-box h4 { color: #0f766e; font-size: 1.1rem; margin-bottom: 1.25rem; font-family: var(--font-body); }

/* ---- 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(13,148,136,0.07), rgba(15,118,110,0.04)); 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(22,163,74,0.07); border-left: 4px solid var(--success-color); border-radius: 10px; }
.danger-block    { padding: 2rem; background: rgba(220,38,38,0.07); border-left: 4px solid var(--danger-color); border-radius: 10px; }
.info-block      { padding: 2rem; background: rgba(37,99,235,0.06); 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(13,148,136,0.08); border-color: var(--primary-color); }
.alert-block.danger  { background: rgba(220,38,38,0.08); border-color: var(--danger-color); }
.alert-block.success { background: rgba(22,163,74,0.08); border-color: var(--success-color); }
.alert-block.slate   { background: rgba(30,41,59,0.08);  border-color: var(--slate-color); }
.alert-block h5 { margin-bottom: 0.5rem; font-size: 1rem; 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, #0f172a, #134e4a); 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); }
.cell-green  { color: var(--success-color); font-weight: 700; }
.cell-red    { color: var(--danger-color);  font-weight: 700; }
.cell-teal   { color: var(--primary-color); font-weight: 700; }
.cell-slate  { color: var(--slate-color);   font-weight: 700; }
.cell-amber  { color: var(--warning-color); font-weight: 700; }
.total-row   { background: var(--bg-tertiary) !important; font-weight: 700; }

/* 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.35; 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; }

/* Risk Matrix */
.risk-matrix { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; margin: 2rem 0; }
.risk-cell {
    padding: 1.25rem; border-radius: 10px; text-align: center;
    font-weight: 700; font-size: 0.9rem; border: 2px solid transparent;
    transition: transform var(--transition-fast);
}
.risk-cell:hover { transform: scale(1.03); }
.risk-critical  { background: rgba(220,38,38,0.12); border-color: #dc2626; color: #dc2626; }
.risk-high      { background: rgba(245,158,11,0.12); border-color: #f59e0b; color: #92400e; }
.risk-medium    { background: rgba(13,148,136,0.12); border-color: #0d9488; color: #0f766e; }
.risk-low       { background: rgba(22,163,74,0.12);  border-color: #16a34a; color: #14532d; }

/* CTA Buttons */
.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); }

/* FAQ */
.faq-item { border: 1px solid var(--border-color); border-radius: 10px; margin-bottom: 1rem; overflow: hidden; }
.faq-question {
    padding: 1.25rem 1.5rem; font-weight: 700; cursor: pointer;
    background: var(--bg-secondary); display: flex; justify-content: space-between; align-items: center;
    font-size: 1rem; transition: background var(--transition-fast);
}
.faq-question:hover { background: var(--bg-tertiary); }
.faq-answer { padding: 1.25rem 1.5rem; font-size: 0.95rem; color: var(--text-secondary); line-height: 1.8; border-top: 1px solid var(--border-color); display: none; }
.faq-answer.open { display: block; }

/* References */
.references-list { list-style: none; padding: 0; }
.references-list li { padding: 0.65rem 0; border-bottom: 1px solid var(--border-color); font-size: 0.9rem; color: var(--text-secondary); }
.references-list li:last-child { border-bottom: none; }
.references-list a { color: var(--primary-color); text-decoration: none; font-weight: 600; }
.references-list a:hover { text-decoration: underline; }
.ref-number { font-family: var(--font-mono); font-weight: 700; color: var(--primary-color); margin-right: 0.5rem; font-size: 0.8rem; }

/* 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: #5eead4; text-decoration: none; transition: color 0.2s; }
.footer-content a:hover { color: #99f6e4; }

/* Chart containers */
.chart-container { background:#fff; border-radius:14px; box-shadow:0 4px 24px rgba(13,148,136,0.10),0 1px 4px rgba(0,0,0,0.06); margin:2rem 0; overflow:hidden; border:1px solid #ccfbf1; }
.chart-header { background:linear-gradient(135deg,#0f172a,#134e4a); padding:1rem 1.5rem; display:flex; align-items:center; gap:0.75rem; }
.chart-header h4 { margin:0; color:#fff; font-size:0.95rem; font-weight:700; }
.chart-icon { font-size:1.25rem; }
.chart-subtitle { color:rgba(255,255,255,0.72); font-size:0.78rem; margin-left:auto; font-weight:500; }
.chart-body { padding:1.5rem; }
.chart-body canvas { max-height:340px; }
.chart-footer { padding:0.65rem 1.5rem; background:#f0fdfa; border-top:1px solid #ccfbf1; font-size:0.76rem; color:#64748b; }
.chart-grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:1.5rem; margin:2rem 0; }

/* ---- 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; }
    .chart-grid-2 { grid-template-columns: 1fr; }
    .risk-matrix { grid-template-columns: repeat(2,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; }
    .risk-matrix { grid-template-columns: 1fr; }
}
