/* ═══════════════════════════════════════════════════════════
   FOXFOT Design System v2.0
   Modern Sports Streaming Premium UI
   ═══════════════════════════════════════════════════════════ */

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

/* ── Design Tokens ────────────────────────────────────────── */
:root {
    /* Surfaces */
    --bg:             #07080c;
    --bg-subtle:      #0c0e14;
    --surface:        #111318;
    --surface2:       #191c24;
    --surface3:       #21242e;
    --surface-glass:  rgba(17,19,24,.72);

    /* Borders */
    --border:         rgba(255,255,255,.06);
    --border-hover:   rgba(255,255,255,.12);
    --border-accent:  rgba(99,102,241,.35);

    /* Primary Palette - Electric Indigo/Violet */
    --primary:        #6366f1;
    --primary-light:  #818cf8;
    --primary-dark:   #4f46e5;
    --primary-glow:   rgba(99,102,241,.25);
    --primary-glow2:  rgba(99,102,241,.12);

    /* Secondary - Hot Pink/Rose */
    --secondary:      #f43f5e;
    --secondary-light:#fb7185;
    --secondary-glow: rgba(244,63,94,.20);

    /* Accent - Emerald */
    --emerald:        #10b981;
    --emerald-light:  #34d399;
    --emerald-glow:   rgba(16,185,129,.20);

    /* Status */
    --live-red:       #ef4444;
    --live-glow:      rgba(239,68,68,.25);
    --warning:        #f59e0b;
    --success:        #22c55e;

    /* Text */
    --text:           #eaecf0;
    --text-secondary: #94969c;
    --text-muted:     #667085;
    --text-dim:       #475467;

    /* Typography */
    --font:           'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-mono:      'JetBrains Mono', monospace;

    /* Spacing & Radius */
    --radius-xs:      6px;
    --radius-sm:      8px;
    --radius:         12px;
    --radius-lg:      16px;
    --radius-xl:      20px;
    --radius-full:    9999px;

    /* Shadows */
    --shadow-sm:      0 1px 3px rgba(0,0,0,.4);
    --shadow:         0 4px 16px rgba(0,0,0,.45);
    --shadow-lg:      0 12px 40px rgba(0,0,0,.55);
    --shadow-glow:    0 0 30px var(--primary-glow);

    /* Transitions */
    --ease:           cubic-bezier(.4,0,.2,1);
    --duration:       .25s;
    --duration-slow:  .4s;

    /* Plyr Overrides */
    --plyr-color-main:              var(--primary);
    --plyr-video-background:        #000;
    --plyr-video-control-color:     var(--text);
    --plyr-video-control-color-hover: #fff;
    --plyr-video-control-background-hover: rgba(99,102,241,.25);
    --plyr-range-fill-background:   var(--primary);
    --plyr-range-thumb-background:  var(--primary);
    --plyr-range-thumb-shadow:      0 0 0 4px var(--primary-glow);
    --plyr-badge-background:        var(--primary);
    --plyr-badge-text-color:        #fff;
    --plyr-tooltip-background:      var(--surface2);
    --plyr-tooltip-color:           var(--text);
    --plyr-menu-background:         var(--surface);
    --plyr-menu-color:              var(--text);
    --plyr-font-family:             var(--font);
}

/* ── Light Theme ──────────────────────────────────────────── */
body.light {
    --bg:             #f8f9fc;
    --bg-subtle:      #f0f2f7;
    --surface:        #ffffff;
    --surface2:       #f4f5f9;
    --surface3:       #ecedf3;
    --surface-glass:  rgba(255,255,255,.78);
    --border:         rgba(0,0,0,.07);
    --border-hover:   rgba(0,0,0,.14);
    --text:           #111827;
    --text-secondary: #4b5563;
    --text-muted:     #6b7280;
    --text-dim:       #9ca3af;
    --shadow-sm:      0 1px 3px rgba(0,0,0,.08);
    --shadow:         0 4px 16px rgba(0,0,0,.08);
    --shadow-lg:      0 12px 40px rgba(0,0,0,.12);
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    transition: background var(--duration-slow) var(--ease), color var(--duration-slow) var(--ease);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { font-family: var(--font); cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }

/* ── Ambient Background ───────────────────────────────────── */
.bg-ambient {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    overflow: hidden;
}
.bg-ambient::before {
    content: '';
    position: absolute; inset: -20%;
    background:
        radial-gradient(ellipse 50% 40% at 20% 10%, rgba(99,102,241,.08) 0%, transparent 60%),
        radial-gradient(ellipse 45% 35% at 80% 85%, rgba(244,63,94,.06) 0%, transparent 55%),
        radial-gradient(ellipse 35% 30% at 50% 50%, rgba(16,185,129,.04) 0%, transparent 50%);
    animation: ambientDrift 25s ease-in-out infinite alternate;
}
.bg-ambient::after {
    content: '';
    position: absolute; inset: 0;
    background:
	    repeating-linear-gradient(90deg, transparent, transparent 79px, rgba(255,255,255,.015) 79px, rgba(255,255,255,.015) 80px),
	    repeating-linear-gradient(0deg, transparent, transparent 79px, rgba(255,255,255,.015) 79px, rgba(255,255,255,.015) 80px);
}
@keyframes ambientDrift {
    0%   { transform: translate(0,0) scale(1); }
    50%  { transform: translate(15px,-10px) scale(1.03); }
    100% { transform: translate(-10px,12px) scale(.98); }
}
body.light .bg-ambient::before {
    background:
        radial-gradient(ellipse 50% 40% at 20% 10%, rgba(99,102,241,.06) 0%, transparent 60%),
        radial-gradient(ellipse 45% 35% at 80% 85%, rgba(244,63,94,.04) 0%, transparent 55%);
}
body.light .bg-ambient::after {
    background:
	    repeating-linear-gradient(90deg, transparent, transparent 79px, rgba(0,0,0,.02) 79px, rgba(0,0,0,.02) 80px),
	    repeating-linear-gradient(0deg, transparent, transparent 79px, rgba(0,0,0,.02) 79px, rgba(0,0,0,.02) 80px);
}

/* ── Top Bar (Navbar) ─────────────────────────────────────── */
.topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 900;
    height: 60px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 clamp(12px, 3vw, 28px);
    background: var(--surface-glass);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
    transition: background var(--duration-slow) var(--ease);
}

.topbar-brand {
    display: flex; align-items: center; gap: 10px;
    font-size: 1.08rem; font-weight: 800; letter-spacing: -.5px;
    text-decoration: none; color: var(--text);
}
.brand-icon {
    width: 34px; height: 34px; border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    font-size: .95rem; color: #fff;
    box-shadow: 0 2px 12px var(--primary-glow);
    transition: transform var(--duration) var(--ease);
}
.topbar-brand:hover .brand-icon { transform: scale(1.08) rotate(-3deg); }
.brand-name {
    background: linear-gradient(90deg, var(--primary-light), var(--secondary-light));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}

.topbar-center { position: absolute; left: 50%; transform: translateX(-50%); }
.topbar-right { display: flex; align-items: center; gap: 8px; }

/* Pills / Badges */
.pill {
    display: inline-flex; align-items: center; gap: 5px;
    border-radius: var(--radius-full);
    padding: 4px 12px;
    font-size: .68rem; font-weight: 700; letter-spacing: .3px;
    border: 1px solid;
    white-space: nowrap;
}
.pill-live {
    background: rgba(239,68,68,.10);
    border-color: rgba(239,68,68,.25);
    color: var(--live-red);
}
.pill-online {
    background: var(--primary-glow2);
    border-color: rgba(99,102,241,.2);
    color: var(--primary-light);
}
.pill-live .dot, .live-dot {
    width: 6px; height: 6px;
    background: var(--live-red);
    border-radius: 50%;
    animation: livePulse 1.5s ease-in-out infinite;
}
@keyframes livePulse {
    0%,100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(239,68,68,.4); }
    50%     { opacity: .5; transform: scale(.75); box-shadow: 0 0 0 5px rgba(239,68,68,0); }
}

.topbar-clock {
    font-size: .72rem; font-weight: 600; letter-spacing: .3px;
    color: var(--text-muted);
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 4px 14px;
    font-variant-numeric: tabular-nums;
    display: flex; align-items: center; gap: 6px;
}
@media (max-width: 640px) { .topbar-clock { display: none; } }

/* Icon Button (round) */
.icon-btn {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: .88rem;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all var(--duration) var(--ease);
}
.icon-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: scale(1.08);
    box-shadow: 0 4px 16px var(--primary-glow);
}

/* Back link */
.back-link {
    display: inline-flex; align-items: center; gap: 5px;
    color: var(--primary-light); font-size: .78rem; font-weight: 600;
    margin-left: 8px;
    transition: opacity var(--duration);
}
.back-link:hover { opacity: .7; }

/* ── Main Container ───────────────────────────────────────── */
.main-container {
    position: relative; z-index: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: 80px clamp(12px, 3vw, 28px) 40px;
}

/* ── Hero Section (index) ─────────────────────────────────── */
.hero {
    text-align: center;
    padding: 32px 16px 28px;
    margin-bottom: 28px;
}
.hero-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--primary-glow2);
    border: 1px solid rgba(99,102,241,.18);
    border-radius: var(--radius-full);
    padding: 5px 16px;
    font-size: .7rem; font-weight: 700; color: var(--primary-light);
    letter-spacing: .4px; text-transform: uppercase;
    margin-bottom: 14px;
}
.hero h1 {
    font-size: clamp(1.4rem, 4vw, 2rem);
    font-weight: 900;
    letter-spacing: -1px;
    line-height: 1.2;
    margin-bottom: 8px;
}
.hero h1 .gradient-text {
    background: linear-gradient(135deg, var(--primary-light), var(--secondary-light), var(--emerald-light));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero p {
    font-size: .88rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

/* ── Section Header ───────────────────────────────────────── */
.section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; flex-wrap: wrap; gap: 12px;
}
.section-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.section-title {
    display: flex; align-items: center; gap: 8px;
    font-size: .95rem; font-weight: 700;
}
.section-title .icon { color: var(--primary-light); }
.section-count {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff; font-size: .62rem; font-weight: 800;
    padding: 2px 9px; border-radius: var(--radius-full);
    letter-spacing: .3px;
}

.section-right { display: flex; gap: 8px; align-items: center; }

/* ── Filter Tabs ──────────────────────────────────────────── */
.filter-tabs { display: flex; gap: 5px; }
.filter-tab {
    padding: 6px 14px; border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--surface2); color: var(--text-muted);
    font-size: .72rem; font-weight: 600;
    transition: all var(--duration) var(--ease);
}
.filter-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; border-color: transparent;
    box-shadow: 0 2px 12px var(--primary-glow);
}
.filter-tab:hover:not(.active) { border-color: var(--primary); color: var(--text); }

/* ── Search ───────────────────────────────────────────────── */
.search-wrap { position: relative; }
.search-wrap .search-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--text-dim); font-size: .78rem; pointer-events: none;
}
.search-input {
    width: 220px; padding: 8px 14px 8px 34px;
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: var(--radius-full); color: var(--text);
    font-size: .8rem; font-family: var(--font); outline: none;
    transition: border-color var(--duration), box-shadow var(--duration), width var(--duration);
}
.search-input::placeholder { color: var(--text-dim); }
.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    width: 280px;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    border-radius: var(--radius-sm);
    font-size: .8rem; font-weight: 600;
    padding: 9px 20px;
    transition: all var(--duration) var(--ease);
    font-family: var(--font);
    border: 1px solid transparent;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 16px var(--primary-glow);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px var(--primary-glow);
}
.btn-secondary {
    background: var(--surface2);
    color: var(--text);
    border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary-light); }
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
    border-radius: var(--radius-full);
    font-size: .76rem;
    padding: 7px 16px;
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary-light); }
.btn-ghost.spinning .spin-icon { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Watch button (card) */
.btn-watch {
    display: inline-flex; align-items: center; gap: 5px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; border: none; border-radius: var(--radius-full);
    padding: 5px 15px; font-size: .72rem; font-weight: 700;
    box-shadow: 0 3px 12px var(--primary-glow);
    transition: all var(--duration) var(--ease);
}
.btn-watch:hover { transform: scale(1.04); opacity: .92; }

/* ── Match Card ───────────────────────────────────────────── */
.match-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.match-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease), border-color var(--duration);
    text-decoration: none; color: var(--text);
    display: flex; flex-direction: column;
    position: relative;
}
.match-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity var(--duration);
}
.match-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--primary);
    border-color: rgba(99,102,241,.3);
}
.match-card:hover::before { opacity: 1; }

/* Card Top */
.card-top {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px 8px;
}
.card-status {
    display: flex; align-items: center; gap: 5px;
    font-size: .65rem; font-weight: 800; letter-spacing: .5px;
    text-transform: uppercase;
}
.card-status.live { color: var(--live-red); }
.card-status.live .status-dot {
    width: 6px; height: 6px; background: var(--live-red);
    border-radius: 50%; animation: livePulse 1.5s ease-in-out infinite;
}
.card-status.upcoming { color: var(--primary-light); }
.card-status.upcoming .status-dot {
    width: 6px; height: 6px; background: var(--primary); border-radius: 50%;
}
.card-time {
    font-size: .7rem; font-weight: 700; color: var(--text-muted);
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: var(--radius-full); padding: 3px 10px;
    font-variant-numeric: tabular-nums;
    font-family: var(--font-mono);
}

/* Card Body */
.card-body { padding: 4px 16px 14px; flex: 1; }
.card-title {
    font-size: .92rem; font-weight: 700; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card Footer */
.card-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    background: var(--surface2);
}
.card-schedule {
    display: flex; align-items: center; gap: 5px;
    font-size: .7rem; color: var(--text-muted);
}
.card-schedule .icon { color: var(--primary-light); font-size: .66rem; }

/* Countdown Badge */
.card-countdown {
    font-size: .66rem; font-weight: 700; color: var(--emerald);
    background: var(--emerald-glow);
    border: 1px solid rgba(16,185,129,.2);
    border-radius: var(--radius-full); padding: 2px 9px;
    font-family: var(--font-mono);
}

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
    display: flex; flex-direction: column;
    align-items: center; gap: 14px;
    padding: 56px 20px; text-align: center;
    color: var(--text-muted);
}
.empty-state .empty-icon {
    width: 72px; height: 72px; border-radius: 50%;
    background: var(--surface2); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem;
}

/* No Results */
.no-results {
    display: none; grid-column: 1 / -1;
    text-align: center; padding: 40px 16px;
    color: var(--text-muted); font-size: .86rem;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex; flex-direction: column;
    max-height: calc(100vh - 90px);
    position: sticky; top: 76px;
}
.sidebar-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.sidebar-title {
    display: flex; align-items: center; gap: 8px;
    font-size: .85rem; font-weight: 700;
}
.sidebar-title .icon { color: var(--primary-light); }
.sidebar-count {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff; font-size: .58rem; font-weight: 800;
    padding: 2px 8px; border-radius: var(--radius-full);
}
.sidebar-body {
    flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 0;
    scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.sidebar-body::-webkit-scrollbar { width: 3px; }
.sidebar-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.sidebar-match {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,.03);
    text-decoration: none; color: var(--text);
    transition: all .15s;
}
.sidebar-match:hover { background: var(--surface2); }
.sidebar-match.active-match {
    background: var(--primary-glow2); border-left: 3px solid var(--primary);
}
.sm-time {
    font-size: .66rem; font-weight: 700; color: var(--text-muted);
    min-width: 40px; text-align: center;
    font-variant-numeric: tabular-nums; font-family: var(--font-mono);
}
.sm-time.live {
    color: var(--live-red);
    background: rgba(239,68,68,.10);
    border-radius: var(--radius-xs); padding: 2px 6px;
    animation: pulse-live 1.5s ease-in-out infinite;
}
@keyframes pulse-live { 0%,100% { opacity: 1; } 50% { opacity: .5; } }
.sm-title {
    flex: 1; font-size: .74rem; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sm-arrow { color: var(--text-dim); font-size: .6rem; transition: color .2s; }
.sidebar-match:hover .sm-arrow { color: var(--primary); }
.sidebar-empty {
    text-align: center; padding: 32px 16px;
    color: var(--text-muted); font-size: .82rem;
}

/* ── Toast ─────────────────────────────────────────────────── */
#toast {
    position: fixed; bottom: 28px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 9999;
    background: var(--surface); border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    display: flex; align-items: center; gap: 10px;
    box-shadow: var(--shadow-lg);
    font-size: .82rem; font-weight: 500;
    opacity: 0; pointer-events: none;
    transition: all .35s var(--ease);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast .toast-icon { color: var(--primary); }

/* ── Footer ───────────────────────────────────────────────── */
.footer {
    position: relative; z-index: 1;
    text-align: center; padding: 20px 24px;
    margin-top: 16px;
    font-size: .72rem; color: var(--text-dim);
    border-top: 1px solid var(--border);
    letter-spacing: .2px;
}
.footer a { color: var(--primary-light); transition: opacity .2s; }
.footer a:hover { opacity: .7; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 767px) {
    .main-container { padding: 68px 10px 24px; }
    .topbar { height: 54px; }
    .match-grid { grid-template-columns: 1fr; gap: 10px; }
    .section-header { flex-direction: column; align-items: flex-start; }
    .section-right { width: 100%; }
    .search-input { width: 100%; }
    .search-input:focus { width: 100%; }
    .hero h1 { font-size: 1.3rem; }
    .hero { padding: 20px 12px 18px; }
}
@media (max-width: 480px) {
    .brand-name { display: none; }
    .filter-tabs { gap: 3px; }
    .filter-tab { padding: 5px 10px; font-size: .68rem; }
}
