


/* ══════════════════════════════════════════════════════════════════
   Momentum Shift Detector - Dashboard Styles
   Premium dark-themed sports analytics dashboard
   ══════════════════════════════════════════════════════════════════ */

/* ── Google Fonts ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ── CSS Custom Properties (Design Tokens) ───────────────────── */
:root {
    /* Background layers */
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: #1a2035;
    --bg-card-hover: #1f2a42;
    --bg-input: #0f1629;
    --bg-overlay: rgba(10, 14, 26, 0.85);

    /* Accent colors */
    --accent-cyan: #06d6a0;
    --accent-cyan-glow: rgba(6, 214, 160, 0.25);
    --accent-blue: #4361ee;
    --accent-blue-glow: rgba(67, 97, 238, 0.25);
    --accent-purple: #7b2ff7;
    --accent-purple-glow: rgba(123, 47, 247, 0.2);
    --accent-red: #ef476f;
    --accent-red-glow: rgba(239, 71, 111, 0.25);
    --accent-orange: #ff9f1c;
    --accent-orange-glow: rgba(255, 159, 28, 0.25);
    --accent-yellow: #ffd166;
    --accent-gold: #f4a261;

    /* Text colors */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-accent: #06d6a0;

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-medium: rgba(255, 255, 255, 0.1);
    --border-glow: rgba(6, 214, 160, 0.3);

    /* Shadows */
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow-cyan: 0 0 20px rgba(6, 214, 160, 0.15);
    --shadow-glow-blue: 0 0 20px rgba(67, 97, 238, 0.15);
    --shadow-glow-red: 0 0 20px rgba(239, 71, 111, 0.15);

    /* Gradients */
    --gradient-header: linear-gradient(135deg, #0a0e1a 0%, #1a1a4e 50%, #0a0e1a 100%);
    --gradient-batting: linear-gradient(135deg, #06d6a0, #00b4d8);
    --gradient-bowling: linear-gradient(135deg, #ef476f, #ff6b6b);
    --gradient-card: linear-gradient(145deg, rgba(26, 32, 53, 0.8), rgba(17, 24, 39, 0.9));
    --gradient-accent: linear-gradient(135deg, #4361ee, #7b2ff7);

    /* Layout */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Typography */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ── CSS Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Animated background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(67, 97, 238, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(123, 47, 247, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(6, 214, 160, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ── Scrollbar Styling ────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ── Loading Screen ───────────────────────────────────────────── */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-logo {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-batting);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

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

/* ── App Container ────────────────────────────────────────────── */
#app {
    position: relative;
    z-index: 1;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── Top Navigation Bar ──────────────────────────────────────── */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    margin-bottom: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-brand .brand-icon {
    width: 36px;
    height: 36px;
    background: var(--gradient-accent);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.nav-brand .brand-text {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.nav-brand .brand-text span {
    background: var(--gradient-batting);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-accent);
    color: white;
    box-shadow: 0 2px 10px rgba(67, 97, 238, 0.3);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(67, 97, 238, 0.4);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-medium);
}
.btn-secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.btn-success {
    background: var(--gradient-batting);
    color: #0a0e1a;
}
.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(6, 214, 160, 0.3);
}

.btn-danger {
    background: var(--accent-red);
    color: white;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ── Upload Section ───────────────────────────────────────────── */
#upload-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    text-align: center;
    padding: 2rem;
}

.upload-hero {
    margin-bottom: 2.5rem;
}

.upload-hero h1 {
    font-size: 2.8rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -1.5px;
}

.upload-hero h1 .gradient-text {
    background: var(--gradient-batting);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.upload-hero p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.7;
}

.upload-cards {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.upload-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2rem 2.5rem;
    width: 280px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.upload-card:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow-cyan);
}

.upload-card .card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.upload-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.upload-card p {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

#file-upload-input {
    display: none;
}

/* ── Match Header ─────────────────────────────────────────────── */
#dashboard-section {
    display: none;
}

.match-header {
    background: var(--gradient-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 18px 24px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.match-teams {
    display: flex;
    align-items: center;
    gap: 16px;
}

.team-block {
    text-align: center;
    min-width: 140px;
}

.team-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.team-score {
    font-size: 1.6rem;
    font-weight: 800;
    font-family: var(--font-mono);
    letter-spacing: -0.5px;
}

.team-score .score-runs {
    color: var(--text-primary);
}

.team-score .score-wickets {
    color: var(--text-muted);
}

.team-overs {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.match-vs {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    padding: 4px 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    letter-spacing: 1px;
}

.match-rates {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.rate-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    min-width: 80px;
}

.rate-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rate-value {
    font-size: 1.15rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--accent-cyan);
}

.rate-value.danger {
    color: var(--accent-red);
}

/* ── Innings Tab Selector ─────────────────────────────────────── */
.innings-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 4px;
    border: 1px solid var(--border-subtle);
}

.innings-tab {
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-main);
}

.innings-tab.active {
    background: var(--gradient-accent);
    color: white;
}

.innings-tab:hover:not(.active) {
    color: var(--text-primary);
    background: var(--bg-card);
}

/* ── Playback Controls ────────────────────────────────────────── */
.playback-bar {
    background: var(--gradient-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 14px 24px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.playback-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.playback-progress {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
}

.progress-bar-container {
    flex: 1;
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient-batting);
    border-radius: 3px;
    transition: width 0.15s ease;
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: -4px;
    width: 14px;
    height: 14px;
    background: var(--accent-cyan);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-cyan-glow);
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-bar-container:hover .progress-bar-fill::after {
    opacity: 1;
}

.progress-text {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 90px;
    text-align: right;
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.speed-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.speed-slider {
    width: 80px;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: var(--bg-primary);
    border-radius: 2px;
    outline: none;
}

.speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--accent-blue);
    border-radius: 50%;
    cursor: pointer;
}

.speed-value {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-blue);
    min-width: 35px;
}

/* ── Dashboard Grid ───────────────────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 16px;
    margin-bottom: 16px;
}

/* ── Cards ─────────────────────────────────────────────────────── */
.card {
    background: var(--gradient-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.card:hover {
    border-color: var(--border-medium);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-subtle);
}

.card-title {
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title .icon {
    font-size: 1rem;
}

.card-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-live {
    background: var(--accent-red);
    color: white;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.card-body {
    padding: 16px 18px;
}

/* ── Momentum Chart Card ──────────────────────────────────────── */
.chart-container {
    width: 100%;
    height: 280px;
}

/* ── Win Probability Chart Card ───────────────────────────────── */
.win-prob-chart {
    height: 240px;
}

/* ── Stats Cards Grid ─────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    grid-column: 1 / -1;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.stat-card:nth-child(1)::before { background: var(--gradient-batting); }
.stat-card:nth-child(2)::before { background: var(--accent-orange); }
.stat-card:nth-child(3)::before { background: var(--accent-red); }
.stat-card:nth-child(4)::before { background: var(--gradient-accent); }
.stat-card:nth-child(5)::before { background: var(--accent-yellow); }
.stat-card:nth-child(6)::before { background: var(--accent-purple); }

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-medium);
    box-shadow: var(--shadow-card);
}

.stat-icon {
    font-size: 1.3rem;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--text-primary);
    margin-bottom: 2px;
    letter-spacing: -0.5px;
}

.stat-value.positive { color: var(--accent-cyan); }
.stat-value.negative { color: var(--accent-red); }
.stat-value.neutral { color: var(--accent-orange); }

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

/* ── Ball Feed Panel ──────────────────────────────────────────── */
.ball-feed {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.feed-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
    font-size: 0.82rem;
}

.feed-item:hover {
    background: var(--bg-card-hover);
}

.feed-item.highlight {
    background: rgba(6, 214, 160, 0.08);
    border-left: 3px solid var(--accent-cyan);
}

.feed-item.wicket {
    background: rgba(239, 71, 111, 0.08);
    border-left: 3px solid var(--accent-red);
}

.feed-item.boundary {
    background: rgba(255, 159, 28, 0.08);
    border-left: 3px solid var(--accent-orange);
}

.feed-item.current {
    background: rgba(67, 97, 238, 0.12);
    border-left: 3px solid var(--accent-blue);
}

.feed-over {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    min-width: 32px;
    font-weight: 600;
}

.feed-runs {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    flex-shrink: 0;
}

.feed-runs.dot {
    background: var(--bg-primary);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
}

.feed-runs.single {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-secondary);
}

.feed-runs.two-three {
    background: rgba(6, 214, 160, 0.15);
    color: var(--accent-cyan);
}

.feed-runs.four {
    background: rgba(255, 159, 28, 0.2);
    color: var(--accent-orange);
}

.feed-runs.six {
    background: rgba(123, 47, 247, 0.25);
    color: var(--accent-purple);
}

.feed-runs.wicket-ball {
    background: rgba(239, 71, 111, 0.2);
    color: var(--accent-red);
}

.feed-detail {
    flex: 1;
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.4;
}

.feed-detail .batsman-name {
    font-weight: 600;
    color: var(--text-primary);
}

.feed-detail .bowler-name {
    color: var(--text-muted);
}

.feed-detail .dismissal-text {
    color: var(--accent-red);
    font-weight: 600;
}

/* ── Turning Points Timeline ──────────────────────────────────── */
.turning-points {
    max-height: 400px;
    overflow-y: auto;
}

.tp-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    transition: all 0.2s;
    cursor: pointer;
}

.tp-item:hover {
    border-color: var(--accent-cyan);
    background: rgba(6, 214, 160, 0.03);
}

.tp-marker {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.tp-marker.critical {
    background: rgba(239, 71, 111, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(239, 71, 111, 0.3);
}

.tp-marker.major {
    background: rgba(255, 159, 28, 0.15);
    color: var(--accent-orange);
    border: 1px solid rgba(255, 159, 28, 0.3);
}

.tp-marker.minor {
    background: rgba(67, 97, 238, 0.15);
    color: var(--accent-blue);
    border: 1px solid rgba(67, 97, 238, 0.3);
}

.tp-content {
    flex: 1;
    min-width: 0;
}

.tp-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.tp-over {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-cyan);
}

.tp-score {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
}

.tp-severity {
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tp-severity.critical {
    background: rgba(239, 71, 111, 0.2);
    color: var(--accent-red);
}

.tp-severity.major {
    background: rgba(255, 159, 28, 0.2);
    color: var(--accent-orange);
}

.tp-severity.minor {
    background: rgba(67, 97, 238, 0.2);
    color: var(--accent-blue);
}

.tp-description {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.tp-change {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 50px;
}

.tp-change.positive {
    color: var(--accent-cyan);
}

.tp-change.negative {
    color: var(--accent-red);
}

/* ── Empty States ─────────────────────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-muted);
    text-align: center;
}

.empty-state .empty-icon {
    font-size: 2rem;
    margin-bottom: 0.8rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.85rem;
}

/* ── Momentum Indicator Bar ───────────────────────────────────── */
.momentum-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    width: 100%;
    margin-top: 12px;
}

.momentum-bar-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    min-width: 60px;
    text-align: center;
}

.momentum-bar-track {
    flex: 1;
    height: 8px;
    background: linear-gradient(to right,
        var(--accent-red) 0%,
        var(--accent-orange) 25%,
        var(--text-muted) 50%,
        var(--accent-cyan) 75%,
        var(--accent-blue) 100%
    );
    border-radius: 4px;
    position: relative;
}

.momentum-bar-indicator {
    position: absolute;
    top: -6px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    transition: left 0.3s ease;
    border: 2px solid var(--bg-primary);
}

.momentum-bar-value {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 800;
    min-width: 50px;
    text-align: center;
}

/* ── Shift Alert Toast ────────────────────────────────────────── */
.shift-alert {
    position: fixed;
    top: 80px;
    right: 20px;
    max-width: 380px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    box-shadow: var(--shadow-card);
    z-index: 1000;
    transform: translateX(110%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(10px);
}

.shift-alert.show {
    transform: translateX(0);
}

.shift-alert.critical {
    border-color: var(--accent-red);
    box-shadow: var(--shadow-glow-red);
}

.shift-alert.major {
    border-color: var(--accent-orange);
    box-shadow: 0 0 20px rgba(255, 159, 28, 0.15);
}

.shift-alert.minor {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-glow-blue);
}

.shift-alert-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.shift-alert-title {
    font-size: 0.8rem;
    font-weight: 700;
}

.shift-alert-body {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.shift-alert-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .match-header {
        flex-direction: column;
        text-align: center;
    }
    .match-rates {
        justify-content: center;
    }
    .playback-bar {
        flex-direction: column;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .upload-hero h1 {
        font-size: 2rem;
    }
    .upload-cards {
        flex-direction: column;
        align-items: center;
    }
    .top-nav {
        flex-direction: column;
        gap: 10px;
    }
}

/* ── Animations ───────────────────────────────────────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-in {
    animation: fadeInUp 0.5s ease forwards;
}

.animate-slide {
    animation: slideInRight 0.3s ease forwards;
}

/* Stagger animations for stat cards */
.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }
.stat-card:nth-child(5) { animation-delay: 0.25s; }
.stat-card:nth-child(6) { animation-delay: 0.3s; }
