/* ═══════════════════════════════════════════════════════
   Forzapodden Statistik — Light Design System
   Brand: Blue (#3D7BAD / #8DC8E8) + Orange (#E88A2D)
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    /* Surfaces */
    --bg-page: #F8FAFC;
    --bg-card: #FFFFFF;
    --bg-card-alt: #EFF6FB;
    --bg-hover: #F1F5F9;

    /* Text */
    --text-primary: #0F1D2E;
    --text-secondary: #475569;
    --text-muted: #94A3B8;

    /* Brand (from Forzapodden logo) */
    --brand-blue: #3D7BAD;
    --brand-blue-light: #8DC8E8;
    --brand-orange: #E88A2D;
    --brand-orange-hover: #D47A20;
    --brand-blue-bg: rgba(61, 123, 173, 0.08);
    --brand-orange-bg: rgba(232, 138, 45, 0.08);

    /* Platform */
    --youtube: #FF0000;
    --youtube-bg: rgba(255, 0, 0, 0.08);
    --spotify: #1DB954;
    --spotify-bg: rgba(29, 185, 84, 0.08);

    /* Interactive */
    --accent: #3D7BAD;
    --accent-hover: #2D6690;

    /* Status */
    --trend-up: #22C55E;
    --trend-flat: #E88A2D;
    --trend-down: #EF4444;

    /* Borders & shadows */
    --border: #DDEAF4;
    --border-hover: #C4D9EA;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.08);

    /* Geometry */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Typography */
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Motion */
    --transition: 150ms ease;
    --transition-slow: 300ms ease;
}

/* ── Reset & Base ────────────────────────────────────── */

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

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
    font-family: var(--font-sans);
    background: var(--bg-page);
    color: var(--text-secondary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ── Typography ──────────────────────────────────────── */

h1, h2, h3, h4 { color: var(--text-primary); line-height: 1.3; }
h1 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; }
h2 { font-size: clamp(1.125rem, 2.5vw, 1.5rem); font-weight: 600; }
h3 { font-size: 1.125rem; font-weight: 600; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--brand-orange); }

/* ── Layout ──────────────────────────────────────────── */

.container { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }
.page-content { padding: 2rem 0 4rem; }
.page-header { margin-bottom: 2rem; }
.page-header h1 { margin-bottom: 0.25rem; }
.page-header p { color: var(--text-muted); font-size: 0.9375rem; }

/* ── Navigation ──────────────────────────────────────── */

.top-nav {
    position: sticky; top: 0; z-index: 100;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.top-nav .container { display: flex; align-items: center; height: 64px; gap: 2rem; }

.nav-brand {
    display: flex; align-items: center; gap: 0.75rem;
    font-weight: 700; font-size: 1.125rem;
    color: var(--text-primary); text-decoration: none; flex-shrink: 0;
}
.nav-brand img { height: 36px; width: auto; }
.nav-links { display: flex; gap: 0.25rem; list-style: none; }
.nav-links a {
    display: block; padding: 0.5rem 1rem; border-radius: var(--radius-sm);
    color: var(--text-secondary); font-weight: 500; font-size: 0.9375rem;
    transition: all var(--transition);
}
.nav-links a:hover { color: var(--brand-orange); background: var(--brand-orange-bg); }
.nav-links a.active { color: var(--brand-blue); background: var(--brand-blue-bg); }
.nav-hamburger { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; color: var(--text-primary); }

/* ── Cards ───────────────────────────────────────────── */

.card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
    padding: 1.5rem; transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-hover); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.card-title { font-size: 0.8125rem; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* ── KPI Cards ───────────────────────────────────────── */

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }
.kpi-card { padding: 1.25rem 1.5rem; border-left: 3px solid transparent; }
.kpi-card.youtube { border-left-color: var(--youtube); background: var(--youtube-bg); }
.kpi-card.spotify { border-left-color: var(--spotify); background: var(--spotify-bg); }
.kpi-card.brand { border-left-color: var(--brand-blue); background: var(--brand-blue-bg); }
.kpi-label { font-size: 0.8125rem; font-weight: 500; color: var(--text-muted); margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.kpi-label svg { width: 16px; height: 16px; flex-shrink: 0; }
.kpi-value { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 700; color: var(--text-primary); line-height: 1.1; margin-bottom: 0.25rem; }
.kpi-value.empty { color: var(--text-muted); }

/* ── Trends ──────────────────────────────────────────── */

.trend { font-size: 0.8125rem; font-weight: 600; }
.trend-up { color: var(--trend-up); }
.trend-flat { color: var(--trend-flat); }
.trend-down { color: var(--trend-down); }

/* ── Grid Layouts ────────────────────────────────────── */

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

/* ── Tables ──────────────────────────────────────────── */

.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    text-align: left; padding: 0.75rem 1rem; font-size: 0.8125rem; font-weight: 600;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border); cursor: pointer; user-select: none; white-space: nowrap;
}
.data-table th:hover { color: var(--text-primary); }
.data-table th .sort-arrow { margin-left: 0.25rem; opacity: 0.3; }
.data-table th.sorted .sort-arrow { opacity: 1; color: var(--brand-blue); }
.data-table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); font-size: 0.9375rem; }
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table tbody tr:nth-child(even) { background: var(--bg-card-alt); }
.data-table tbody tr:nth-child(even):hover { background: var(--bg-hover); }
.data-table .num { text-align: right; font-family: var(--font-mono); font-size: 0.875rem; }

/* ── Charts ──────────────────────────────────────────── */

.chart-container { position: relative; width: 100%; height: 300px; }
.chart-container.tall { height: 400px; }

/* ── Empty States ────────────────────────────────────── */

.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--text-muted); }
.empty-state svg { width: 48px; height: 48px; margin-bottom: 1rem; opacity: 0.4; }
.empty-state p { font-size: 0.9375rem; }
.empty-state .empty-hint { font-size: 0.8125rem; margin-top: 0.5rem; }

/* ── Buttons ─────────────────────────────────────────── */

.btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 1rem; border-radius: var(--radius-sm);
    font-family: var(--font-sans); font-size: 0.875rem; font-weight: 500;
    cursor: pointer; border: 1px solid transparent; transition: all var(--transition);
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.export-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--bg-card);
    color: var(--text-muted); cursor: pointer; transition: all var(--transition);
}
.export-btn:hover { color: var(--brand-blue); border-color: var(--brand-blue); background: var(--brand-blue-bg); }

/* ── Episode Card ────────────────────────────────────── */

.episode-card { display: flex; gap: 1.25rem; align-items: flex-start; }
.episode-card .thumbnail { width: 120px; height: 68px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; }
.episode-card .episode-info h3 { font-size: 1rem; margin-bottom: 0.25rem; }
.episode-card .episode-meta { font-size: 0.8125rem; color: var(--text-muted); display: flex; gap: 1rem; }
.episode-card .episode-stats { display: flex; gap: 1.5rem; margin-top: 0.5rem; }
.episode-card .stat { font-size: 0.8125rem; color: var(--text-secondary); display: flex; align-items: center; gap: 0.25rem; }

/* ── Platform Badge ──────────────────────────────────── */

.platform-badge { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.25rem 0.625rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.platform-badge.youtube { background: var(--youtube-bg); color: var(--youtube); }
.platform-badge.spotify { background: var(--spotify-bg); color: var(--spotify); }

/* ── Responsive ──────────────────────────────────────── */

@media (max-width: 1024px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .top-nav .container { height: 56px; }
    .nav-links {
        display: none; position: absolute; top: 56px; left: 0; right: 0;
        background: var(--bg-card); border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-card); flex-direction: column; padding: 0.5rem;
    }
    .nav-links.open { display: flex; }
    .nav-hamburger { display: block; margin-left: auto; }
    .container { padding: 0 1rem; }
    .page-content { padding: 1.5rem 0 3rem; }
    .episode-card { flex-direction: column; }
    .episode-card .thumbnail { width: 100%; height: auto; aspect-ratio: 16 / 9; }
    .data-table { font-size: 0.875rem; }
    .data-table th, .data-table td { padding: 0.5rem 0.75rem; }
}
