/* F1 Analytics — Pit Wall HUD Aesthetic
   Inspired by F1 TV graphics, telemetry screens, and carbon fiber cockpits.
   Dark, data-rich, angular, precise. */

@import url('https://fonts.googleapis.com/css2?family=Titillium+Web:ital,wght@0,300;0,400;0,600;0,700;0,900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ─── Design Tokens ─── */
:root {
    /* Surface layers */
    --bg-abyss: #060608;
    --bg-carbon: #0d0d10;
    --bg-panel: #141418;
    --bg-card: #1a1a20;
    --bg-elevated: #222228;
    --bg-hover: #2a2a32;

    /* Brand palette */
    --f1-red: #e10600;
    --f1-red-glow: rgba(225, 6, 0, 0.35);
    --f1-orange: #ff8700;
    --f1-orange-dim: rgba(255, 135, 0, 0.15);
    --f1-cyan: #00e5ff;
    --f1-cyan-dim: rgba(0, 229, 255, 0.08);
    --f1-green: #00d26a;
    --f1-purple: #9b59ff;
    --f1-yellow: #ffe000;

    /* Text hierarchy */
    --text-bright: #f0f0f5;
    --text-primary: #d0d0d8;
    --text-secondary: #8a8a96;
    --text-muted: #55555f;
    --text-dim: #3a3a42;

    /* Borders & lines */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-medium: rgba(255, 255, 255, 0.1);
    --border-accent: rgba(225, 6, 0, 0.3);

    /* Typography */
    --font-display: 'Titillium Web', sans-serif;
    --font-data: 'JetBrains Mono', monospace;

    /* Geometry */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --sidebar-w: 200px;
    --skew: -3deg;

    /* Shadows */
    --shadow-card: 0 2px 20px rgba(0, 0, 0, 0.5);
    --shadow-glow-red: 0 0 30px rgba(225, 6, 0, 0.15);
    --shadow-glow-cyan: 0 0 20px rgba(0, 229, 255, 0.1);

    /* Motion */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 150ms;
    --duration-med: 300ms;
    --duration-slow: 600ms;
}

/* ─── Reset ─── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ─── Base ─── */
html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-display);
    background: var(--bg-abyss);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.55;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Carbon fiber background texture */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.008) 2px,
            rgba(255, 255, 255, 0.008) 4px
        );
    pointer-events: none;
    z-index: 0;
}

/* ─── Layout Shell ─── */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ─── Sidebar ─── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-carbon);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    overflow: hidden;
}

/* Red racing stripe down the left edge */
.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(
        180deg,
        var(--f1-red) 0%,
        var(--f1-orange) 50%,
        var(--f1-red) 100%
    );
    z-index: 1;
}

.sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    text-decoration: none;
}

.logo-f1 {
    background: var(--f1-red);
    color: white;
    padding: 3px 10px;
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    clip-path: polygon(0 0, 100% 0, 92% 100%, 0% 100%);
    /* Angular F1-style clip */
}

.logo-text {
    color: var(--text-bright);
    letter-spacing: 2px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Navigation */
.nav-menu {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 13px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    transition: all var(--duration-fast) var(--ease-out);
    border-left: 3px solid transparent;
    position: relative;
}

.nav-tab:hover {
    background: var(--bg-elevated);
    color: var(--text-bright);
    border-left-color: var(--f1-orange);
}

.nav-tab.active {
    background: linear-gradient(90deg, rgba(225, 6, 0, 0.1) 0%, transparent 100%);
    color: var(--f1-orange);
    border-left-color: var(--f1-red);
}

.nav-tab.active::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--f1-red);
    border-radius: 2px 0 0 2px;
}

.nav-tab .icon {
    font-size: 1.05rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-subtle);
}

.sidebar-footer .llm-model {
    font-family: var(--font-data);
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: center;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ─── Main Content ─── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ─── Page Header ─── */
.page-header {
    padding: 32px 40px 24px;
    border-bottom: 1px solid var(--border-subtle);
    background: linear-gradient(180deg, var(--bg-panel) 0%, var(--bg-carbon) 100%);
    position: relative;
    overflow: hidden;
}

/* Diagonal accent line */
.page-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200px;
    height: 3px;
    background: linear-gradient(90deg, var(--f1-red), transparent);
}

.page-header h1 {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 2rem;
    color: var(--text-bright);
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.page-header h1 .accent {
    color: var(--f1-red);
}

.page-subtitle {
    font-family: var(--font-data);
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ─── Page Content ─── */
.page-content {
    flex: 1;
    padding: 32px 40px;
    overflow-y: auto;
}

/* ─── Cards ─── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color var(--duration-fast) var(--ease-out);
    position: relative;
}

.card:hover {
    border-color: var(--border-medium);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-secondary);
}

.card-body {
    padding: 20px;
}

/* Card with accent top border */
.card--accent {
    border-top: 2px solid var(--f1-red);
}

.card--cyan {
    border-top: 2px solid var(--f1-cyan);
}

.card--orange {
    border-top: 2px solid var(--f1-orange);
}

/* ─── Stat Blocks (Telemetry HUD style) ─── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stat-block {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all var(--duration-med) var(--ease-out);
}

.stat-block:hover {
    border-color: var(--f1-cyan);
    box-shadow: var(--shadow-glow-cyan);
    transform: translateY(-2px);
}

.stat-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--f1-cyan), transparent);
    opacity: 0;
    transition: opacity var(--duration-med) var(--ease-out);
}

.stat-block:hover::before {
    opacity: 1;
}

.stat-label {
    font-family: var(--font-data);
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.stat-value {
    font-family: var(--font-data);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-bright);
    line-height: 1;
}

.stat-value .unit {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-left: 4px;
}

.stat-delta {
    font-family: var(--font-data);
    font-size: 0.75rem;
    margin-top: 6px;
}

.stat-delta.positive { color: var(--f1-green); }
.stat-delta.negative { color: var(--f1-red); }

/* ─── Data Tables ─── */
.data-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.data-table th {
    background: var(--bg-elevated);
    padding: 12px 16px;
    text-align: left;
    font-family: var(--font-data);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--f1-red);
    position: sticky;
    top: 0;
    z-index: 2;
}

.data-table td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--duration-fast);
}

.data-table tbody tr {
    transition: background var(--duration-fast);
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

/* Position column */
.data-table .pos {
    font-family: var(--font-data);
    font-weight: 700;
    color: var(--text-bright);
    width: 40px;
    text-align: center;
}

.data-table .pos-1 { color: var(--f1-yellow); }
.data-table .pos-2 { color: #c0c0c0; }
.data-table .pos-3 { color: #cd7f32; }

/* Time/gap cells */
.data-table .time {
    font-family: var(--font-data);
    font-weight: 500;
    color: var(--text-bright);
}

.data-table .gap {
    font-family: var(--font-data);
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* Team color bar in tables */
.team-color-bar {
    display: inline-block;
    width: 4px;
    height: 18px;
    border-radius: 2px;
    margin-right: 10px;
    vertical-align: middle;
}

/* ─── Team Color Badges ─── */
.team-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    clip-path: polygon(0 0, 100% 0, 96% 100%, 4% 100%);
}

.team-redbull { background: #3671c6; color: white; }
.team-ferrari { background: #e8002d; color: white; }
.team-mercedes { background: #27f4d2; color: #0a0a0a; }
.team-mclaren { background: #ff8700; color: white; }
.team-astonmartin { background: #229971; color: white; }
.team-alpine { background: #ff87bc; color: #0a0a0a; }
.team-williams { background: #64c4ff; color: #0a0a0a; }
.team-rb { background: #6692ff; color: white; }
.team-sauber { background: #52e252; color: #0a0a0a; }
.team-haas { background: #b6babd; color: #0a0a0a; }

/* ─── Tyre Compound Badges ─── */
.compound {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-family: var(--font-data);
    font-size: 0.6rem;
    font-weight: 700;
    border: 2px solid;
}

.compound-soft { background: rgba(255, 51, 51, 0.15); border-color: #ff3333; color: #ff3333; }
.compound-medium { background: rgba(255, 242, 0, 0.12); border-color: #fff200; color: #fff200; }
.compound-hard { background: rgba(235, 235, 235, 0.1); border-color: #ebebeb; color: #ebebeb; }
.compound-inter { background: rgba(67, 176, 42, 0.15); border-color: #43b02a; color: #43b02a; }
.compound-wet { background: rgba(0, 103, 173, 0.2); border-color: #0067ad; color: #0067ad; }

/* ─── Buttons ─── */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.btn-primary {
    background: var(--f1-red);
    color: white;
    clip-path: polygon(0 0, 100% 0, 96% 100%, 4% 100%);
    padding: 10px 28px;
}

.btn-primary:hover {
    background: #ff1a1a;
    box-shadow: var(--shadow-glow-red);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--f1-cyan);
    color: var(--text-bright);
}

/* ─── Race Countdown ─── */
.countdown-container {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 32px;
    position: relative;
    overflow: hidden;
}

.countdown-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--f1-red), var(--f1-orange), transparent);
}

.countdown-title {
    font-family: var(--font-data);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.countdown-event {
    font-weight: 900;
    font-size: 1.8rem;
    color: var(--text-bright);
    margin-bottom: 6px;
    line-height: 1.1;
}

.countdown-location {
    font-family: var(--font-data);
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.countdown-timer {
    display: flex;
    gap: 20px;
}

.countdown-unit {
    text-align: center;
}

.countdown-number {
    font-family: var(--font-data);
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--f1-orange);
    line-height: 1;
    text-shadow: 0 0 30px rgba(255, 135, 0, 0.3);
}

.countdown-label {
    font-family: var(--font-data);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-top: 4px;
}

.countdown-separator {
    font-family: var(--font-data);
    font-size: 2.8rem;
    color: var(--text-dim);
    line-height: 1;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0.2; }
}

/* ─── Grid Layouts ─── */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* ─── Event Cards (Calendar) ─── */
.event-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all var(--duration-med) var(--ease-out);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.event-card:hover {
    border-color: var(--f1-red);
    transform: translateX(4px);
    box-shadow: -4px 0 0 var(--f1-red);
}

.event-round {
    font-family: var(--font-data);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dim);
    min-width: 50px;
    text-align: center;
    line-height: 1;
}

.event-card:hover .event-round {
    color: var(--f1-red);
}

.event-info {
    flex: 1;
}

.event-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-bright);
    margin-bottom: 2px;
}

.event-location {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.event-date {
    font-family: var(--font-data);
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: right;
    white-space: nowrap;
}

.event-card.is-next {
    border-color: var(--f1-red);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(225, 6, 0, 0.06) 100%);
}

.event-card.is-next .event-round {
    color: var(--f1-red);
}

.event-card.is-past {
    opacity: 0.5;
}

.event-card.is-past:hover {
    opacity: 0.8;
}

/* ─── News Ticker ─── */
.news-item {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    transition: all var(--duration-fast);
    display: flex;
    gap: 16px;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
}

.news-item:hover {
    border-color: var(--border-medium);
    background: var(--bg-elevated);
}

.news-item.breaking {
    border-left: 3px solid var(--f1-red);
    animation: breakingPulse 2s ease-in-out infinite;
}

@keyframes breakingPulse {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: inset 0 0 20px rgba(225, 6, 0, 0.05); }
}

.news-source {
    font-family: var(--font-data);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 3px 8px;
    border-radius: 3px;
    background: var(--bg-elevated);
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.news-title {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text-bright);
    margin-bottom: 4px;
    line-height: 1.4;
}

.news-meta {
    font-family: var(--font-data);
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ─── Analysis Charts Container ─── */
.chart-container {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 4px;
    transition: border-color var(--duration-med);
}

.chart-container:hover {
    border-color: var(--f1-orange);
}

.chart-container img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    display: block;
}

/* ─── Driver Profile Cards ─── */
.driver-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--duration-med) var(--ease-out);
    text-decoration: none;
    color: inherit;
}

.driver-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
}

.driver-card-color {
    height: 4px;
}

.driver-card-body {
    padding: 20px;
}

.driver-number {
    font-family: var(--font-data);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dim);
    line-height: 1;
    float: right;
    margin-top: -4px;
}

.driver-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-bright);
    margin-bottom: 2px;
}

.driver-team {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* ─── Replay Viewer ─── */
.replay-viewer {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.replay-canvas-container {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    justify-content: center;
    position: relative;
}

#replayCanvas {
    border-radius: var(--radius-sm);
    max-width: 100%;
    height: auto;
}

.replay-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    flex-wrap: wrap;
}

.replay-controls input[type="range"] {
    accent-color: var(--f1-red);
}

/* ─── Filters / Selects ─── */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.filter-select {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color var(--duration-fast);
    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='%238a8a96' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.filter-select:hover,
.filter-select:focus {
    border-color: var(--f1-cyan);
    outline: none;
}

/* ─── Loading States ─── */
.skeleton {
    background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--bg-elevated);
    border-top-color: var(--f1-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-carbon);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ─── Animations ─── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-in {
    animation: fadeInUp var(--duration-slow) var(--ease-out) both;
}

.animate-in-1 { animation-delay: 0.05s; }
.animate-in-2 { animation-delay: 0.1s; }
.animate-in-3 { animation-delay: 0.15s; }
.animate-in-4 { animation-delay: 0.2s; }
.animate-in-5 { animation-delay: 0.25s; }
.animate-in-6 { animation-delay: 0.3s; }

/* ─── Utility ─── */
.text-mono { font-family: var(--font-data); }
.text-bright { color: var(--text-bright); }
.text-muted { color: var(--text-muted); }
.text-red { color: var(--f1-red); }
.text-orange { color: var(--f1-orange); }
.text-cyan { color: var(--f1-cyan); }
.text-green { color: var(--f1-green); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

.section-title {
    font-family: var(--font-data);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-muted);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .page-content { padding: 24px; }
    .page-header { padding: 24px; }
}

@media (max-width: 768px) {
    :root {
        --sidebar-w: 60px;
    }

    .sidebar-header { padding: 16px 8px; }
    .logo-text { display: none; }
    .nav-tab {
        padding: 14px;
        justify-content: center;
    }
    .nav-tab span:not(.icon) { display: none; }
    .nav-tab.active::after { display: none; }

    .page-content { padding: 16px; }
    .page-header { padding: 16px; }
    .page-header h1 { font-size: 1.4rem; }

    .grid-2,
    .grid-3,
    .grid-4 { grid-template-columns: 1fr; }

    .countdown-timer { flex-wrap: wrap; justify-content: center; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .filter-bar { flex-direction: column; align-items: stretch; }
}

@media (max-width: 480px) {
    :root {
        --sidebar-w: 50px;
    }

    .stat-grid { grid-template-columns: 1fr; }
    .countdown-number { font-size: 2rem; }
}
