/**
 * ScoreLive V2 - Completely New Design
 * Sidebar Layout + Table-style Matches
 * Modern Sports Dashboard Design
 */

/* ============================================
   CSS Variables - New Design System
   ============================================ */
:root {
    /* Brand Colors - Green/Teal Sport Theme */
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-light: #34d399;
    --primary-rgb: 16, 185, 129;

    --secondary: #6366f1;
    --accent: #f59e0b;

    /* Status */
    --live: #ef4444;
    --live-light: #fef2f2;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Neutrals - Light Theme */
    --bg-page: #f1f5f9;
    --bg-sidebar: #1e293b;
    --bg-card: #ffffff;
    --bg-hover: #f8fafc;
    --bg-active: #e0f2fe;

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

    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --divider: #cbd5e1;

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --topbar-height: 60px;
    --content-max: 1200px;

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

    --text-xs: 0.75rem;
    --text-sm: 0.8125rem;
    --text-base: 0.9375rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 2rem;

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;

    /* Borders */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.08);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-page);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

ul, ol { list-style: none; }

/* ============================================
   App Layout - Sidebar + Content
   ============================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   Sidebar - Left Navigation
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-inverse);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-base);
    overflow: hidden;
}

.sidebar-header {
    padding: var(--space-5);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.sidebar-logo .logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: white;
}

.sidebar-logo .logo-text {
    font-size: var(--text-lg);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.sidebar-logo .logo-text span {
    color: var(--primary);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: var(--space-4);
    overflow-y: auto;
}

.nav-section {
    margin-bottom: var(--space-6);
}

.nav-section-title {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.4);
    padding: 0 var(--space-3);
    margin-bottom: var(--space-2);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-3);
    border-radius: var(--radius-md);
    color: rgba(255,255,255,0.7);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
    margin-bottom: 2px;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

.nav-item .nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.nav-item .nav-badge {
    margin-left: auto;
    background: var(--live);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    min-width: 20px;
    text-align: center;
}

.nav-item .nav-badge.live {
    animation: pulse-badge 2s infinite;
}

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

/* Sidebar Footer */
.sidebar-footer {
    padding: var(--space-4);
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* ============================================
   Main Content Area
   ============================================ */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================================
   Top Bar
   ============================================ */
.topbar {
    height: var(--topbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 var(--space-6);
    position: sticky;
    top: 0;
    z-index: 50;
    gap: var(--space-4);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.topbar-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.topbar-breadcrumb a:hover {
    color: var(--primary);
}

.topbar-breadcrumb .sep {
    color: var(--border);
}

/* Search Box */
.topbar-search {
    flex: 1;
    max-width: 400px;
    margin: 0 auto;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: var(--space-2) var(--space-4);
    transition: all var(--transition-fast);
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.search-box input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box .search-icon {
    color: var(--text-muted);
    margin-right: var(--space-2);
}

.search-box .search-shortcut {
    font-size: var(--text-xs);
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

/* Topbar Right */
.topbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.topbar-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.topbar-btn:hover {
    background: var(--bg-page);
    color: var(--text-primary);
}

/* ============================================
   Content Area
   ============================================ */
.content-area {
    flex: 1;
    padding: var(--space-6);
}

.content-container {
    max-width: var(--content-max);
    margin: 0 auto;
}

/* Container for backward compatibility */
.container {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.main-content {
    min-height: calc(100vh - 200px);
    padding: var(--space-5) 0;
}

/* ============================================
   Page Header
   ============================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.page-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-top: var(--space-1);
}

/* ============================================
   Stats Cards Row
   ============================================ */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.live {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: var(--live);
}

.stat-icon.upcoming {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #3b82f6;
}

.stat-icon.finished {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: var(--success);
}

.stat-icon.total {
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    color: var(--secondary);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-top: var(--space-1);
}

/* ============================================
   Date Tabs - Horizontal (OLD - DEPRECATED)
   See .date-tabs-wrapper styles at end of file
   ============================================ */

/* ============================================
   Matches Panel - NEW DESIGN
   ============================================ */
.matches-panel {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border);
    background: var(--bg-hover);
}

.panel-title {
    font-size: var(--text-base);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.panel-actions {
    display: flex;
    gap: var(--space-2);
}

.panel-btn {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.panel-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.panel-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Match Row - Table Style */
.match-row {
    display: grid;
    grid-template-columns: 80px 1fr 100px 1fr 140px;
    align-items: center;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-light);
    transition: all var(--transition-fast);
    gap: var(--space-4);
}

.match-row:last-child {
    border-bottom: none;
}

.match-row:hover {
    background: var(--bg-hover);
}

.match-row.is-live {
    background: linear-gradient(90deg, var(--live-light), transparent);
    border-left: 3px solid var(--live);
}

/* Time Column */
.match-time-col {
    text-align: center;
}

.match-time {
    font-size: var(--text-lg);
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.match-date-small {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.match-minute {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--live);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.match-minute .live-dot {
    width: 6px;
    height: 6px;
    background: var(--live);
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Team Column */
.team-col {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.team-col.away {
    flex-direction: row-reverse;
    text-align: right;
}

.team-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

.team-info {
    min-width: 0;
}

.team-name {
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-name.winner {
    color: var(--primary);
}

.team-rank {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* Score Column */
.score-col {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

.score-box {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-4);
    background: var(--bg-page);
    border-radius: var(--radius-md);
}

.score-num {
    font-size: var(--text-xl);
    font-weight: 700;
    font-family: var(--font-mono);
    min-width: 24px;
    text-align: center;
}

.score-num.winner {
    color: var(--primary);
}

.score-divider {
    font-size: var(--text-base);
    color: var(--text-muted);
}

.score-ht {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-align: center;
    margin-top: 2px;
}

.score-vs {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-muted);
    padding: var(--space-2) var(--space-4);
    background: var(--bg-page);
    border-radius: var(--radius-md);
}

/* Meta Column */
.match-meta-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-1);
}

.league-badge {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    color: var(--text-muted);
    background: var(--bg-page);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
}

.league-badge img {
    width: 14px;
    height: 14px;
}

.streamer-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #f97316, #eab308);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.match-status-badge {
    font-size: var(--text-xs);
    font-weight: 600;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
}

.match-status-badge.finished {
    background: #dcfce7;
    color: #166534;
}

.match-status-badge.live {
    background: #fee2e2;
    color: #991b1b;
    animation: pulse-badge 2s infinite;
}

/* ============================================
   League Group Header
   ============================================ */
.league-group {
    margin-bottom: var(--space-5);
}

.league-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    background: linear-gradient(90deg, var(--bg-sidebar), #334155);
    color: white;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.league-header img {
    width: 24px;
    height: 24px;
}

.league-header .league-name {
    font-weight: 600;
    font-size: var(--text-sm);
    flex: 1;
}

.league-header .league-count {
    font-size: var(--text-xs);
    opacity: 0.7;
}

.league-matches {
    background: var(--bg-card);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

/* Backward compat: competition-group */
.competition-group {
    margin-bottom: var(--space-5);
}

.competition-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    background: linear-gradient(90deg, var(--bg-sidebar), #334155);
    color: white;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.competition-header .competition-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.competition-info {
    flex: 1;
}

.competition-header .competition-name {
    font-weight: 600;
    font-size: var(--text-sm);
    color: white;
}

.competition-header .competition-name:hover {
    text-decoration: underline;
}

.competition-country {
    font-size: var(--text-xs);
    opacity: 0.7;
}

.match-count {
    font-size: var(--text-xs);
    opacity: 0.7;
    background: rgba(255,255,255,0.15);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.competition-matches {
    background: var(--bg-card);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

/* ============================================
   Match Card - Row Style (inside competition)
   ============================================ */
.match-card {
    display: grid;
    grid-template-columns: 70px 1fr 90px 1fr 100px;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-light);
    transition: all var(--transition-fast);
    gap: var(--space-3);
    text-decoration: none;
    color: inherit;
}

.match-card:last-child {
    border-bottom: none;
}

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

.match-card.is-live {
    background: linear-gradient(90deg, var(--live-light), transparent);
    border-left: 3px solid var(--live);
}

.match-card.has-blv {
    position: relative;
    border: 1px solid rgba(249, 115, 22, 0.2);
    background: linear-gradient(90deg, rgba(249, 115, 22, 0.03), transparent);
    margin: var(--space-2);
    margin-top: var(--space-4);
    border-radius: var(--radius-md);
}

.match-card .blv-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 2px 10px;
    background: linear-gradient(135deg, #f97316, #eab308);
    color: white;
    border-radius: var(--radius-full);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 5;
    box-shadow: 0 2px 6px rgba(249, 115, 22, 0.3);
}

/* Match Card Inner Structure */
.match-card .match-competition {
    display: none;
}

.match-card .match-content {
    display: contents;
}

.match-card .match-team {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.match-card .match-team.away {
    flex-direction: row-reverse;
    text-align: right;
}

.match-card .match-team .team-logo {
    width: 28px;
    height: 28px;
}

.match-card .match-team .team-name {
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.match-card .match-team .team-name.winner {
    color: var(--primary);
}

.match-card .match-center {
    text-align: center;
}

.match-card .match-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    background: var(--bg-page);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-md);
}

.match-card .score {
    font-size: var(--text-lg);
    font-weight: 700;
    font-family: var(--font-mono);
    min-width: 20px;
    text-align: center;
}

.match-card .score.winner {
    color: var(--primary);
}

.match-card .score-divider {
    color: var(--text-muted);
}

.match-card .ht-score {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: 2px;
}

.match-card .match-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: var(--text-xs);
    margin-top: 2px;
}

.match-card .match-status.live {
    color: var(--live);
    font-weight: 600;
}

.match-card .live-indicator {
    width: 6px;
    height: 6px;
    background: var(--live);
    border-radius: 50%;
    animation: blink 1s infinite;
}

.match-card .match-time {
    font-size: var(--text-lg);
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.match-card .match-date {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.match-card .match-footer {
    text-align: right;
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.match-card .blv-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(249, 115, 22, 0.1);
    color: #ea580c;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 500;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state,
.no-matches {
    text-align: center;
    padding: var(--space-10) var(--space-6);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
}

.empty-icon,
.no-matches-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-5);
    background: var(--bg-page);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}

.empty-title {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.empty-text,
.no-matches-text {
    color: var(--text-muted);
    margin-bottom: var(--space-5);
}

.empty-btn,
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    background: var(--primary);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.empty-btn:hover,
.btn-primary:hover {
    background: var(--primary-dark);
}

/* ============================================
   Live Banner
   ============================================ */
.live-banner {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    background: linear-gradient(90deg, #fef2f2, #fff1f2);
    border: 1px solid #fecaca;
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-5);
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.live-indicator.pulse,
.pulse-dot,
.live-dot-lg {
    width: 10px;
    height: 10px;
    background: var(--live);
    border-radius: 50%;
    animation: pulse-live 1.5s infinite;
}

@keyframes pulse-live {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
    50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

.live-text {
    font-weight: 700;
    font-size: var(--text-sm);
    color: var(--live);
    letter-spacing: 0.5px;
}

.live-count {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.live-banner .refresh-btn,
.refresh-info {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: white;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
}

/* ============================================
   Smart Filters - Chips Style
   ============================================ */
.smart-filters {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5);
    margin-bottom: var(--space-5);
    box-shadow: var(--shadow-card);
}

.filter-tabs {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-bottom: var(--space-4);
}

.filter-tab {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.filter-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.filter-tab .tab-icon {
    font-size: 12px;
}

.filter-tab .tab-count {
    background: rgba(0,0,0,0.1);
    padding: 1px 6px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 600;
}

.filter-tab.active .tab-count {
    background: rgba(255,255,255,0.25);
}

.filter-controls {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.filter-search {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.filter-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    padding-left: 40px;
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--text-primary);
    outline: none;
    transition: all var(--transition-fast);
}

.filter-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.filter-input::placeholder {
    color: var(--text-muted);
}

.filter-search .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.filter-select {
    padding: var(--space-3) var(--space-4);
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--text-primary);
    cursor: pointer;
    min-width: 150px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* ============================================
   Popular Leagues - Horizontal Pills
   ============================================ */
.popular-leagues {
    margin-bottom: var(--space-5);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
}

.section-title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-primary);
}

.leagues-slider {
    display: flex;
    gap: var(--space-3);
    overflow-x: auto;
    padding-bottom: var(--space-2);
    -webkit-overflow-scrolling: touch;
}

.leagues-slider::-webkit-scrollbar {
    display: none;
}

.league-item,
.league-pill {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    white-space: nowrap;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.league-item:hover,
.league-pill:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.league-item img,
.league-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.league-item span,
.league-name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

/* ============================================
   Match Detail Page - New Layout
   ============================================ */
.page-match {
    max-width: 900px;
    margin: 0 auto;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-4);
}

.breadcrumbs a:hover {
    color: var(--primary);
}

.breadcrumbs .separator {
    color: var(--border);
}

.match-header {
    background: linear-gradient(135deg, var(--bg-sidebar), #334155);
    color: white;
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    margin-bottom: var(--space-6);
    position: relative;
    overflow: hidden;
}

.match-header.is-live {
    border: 2px solid var(--live);
}

.match-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: linear-gradient(135deg, transparent, rgba(var(--primary-rgb), 0.2));
}

.match-competition-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
    flex-wrap: wrap;
}

.match-competition-info a {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: rgba(255,255,255,0.15);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
}

.match-competition-info .competition-logo {
    width: 20px;
    height: 20px;
}

.match-competition-info .match-date {
    font-size: var(--text-sm);
    opacity: 0.8;
}

.match-score-section {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: var(--space-6);
    align-items: center;
}

.team-block {
    text-align: center;
}

.team-block a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
}

.team-logo-large {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.team-block .team-name {
    font-size: var(--text-lg);
    font-weight: 600;
}

.score-block {
    text-align: center;
}

.score-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
}

.score-display .score {
    font-size: 48px;
    font-weight: 800;
    font-family: var(--font-mono);
}

.score-display .score-separator {
    font-size: 32px;
    opacity: 0.5;
}

.match-status-live {
    margin-top: var(--space-3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    color: var(--live);
    font-weight: 600;
}

.match-status-live .live-dot {
    width: 8px;
    height: 8px;
    background: var(--live);
    border-radius: 50%;
    animation: blink 1s infinite;
}

.match-status-final {
    margin-top: var(--space-3);
    font-size: var(--text-sm);
    opacity: 0.8;
}

.kickoff-time .time {
    font-size: var(--text-3xl);
    font-weight: 700;
    font-family: var(--font-mono);
}

.kickoff-time .label {
    font-size: var(--text-xs);
    opacity: 0.7;
}

.halftime-score {
    font-size: var(--text-sm);
    opacity: 0.7;
    margin-top: var(--space-2);
}

.match-venue-info {
    margin-top: var(--space-5);
    display: flex;
    justify-content: center;
    gap: var(--space-6);
    font-size: var(--text-sm);
    opacity: 0.8;
}

.match-venue-info span {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.match-venue-info .icon {
    width: 16px;
    height: 16px;
}

/* Content Tabs */
.match-tabs,
.content-tabs-wrapper {
    margin-bottom: var(--space-5);
}

.tabs-nav,
.content-tabs {
    display: flex;
    gap: var(--space-1);
    background: var(--bg-card);
    padding: var(--space-1);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow-x: auto;
}

.tab-btn,
.content-tab {
    flex: 1;
    min-width: 80px;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: all var(--transition-fast);
    text-align: center;
    border: none;
    background: none;
    cursor: pointer;
}

.tab-btn:hover,
.content-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.tab-btn.active,
.content-tab.active {
    background: var(--primary);
    color: white;
}

.tab-content,
.tab-panel {
    display: none;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: var(--space-6);
}

.tab-content.active,
.tab-panel.active {
    display: block;
}

/* Stats Grid */
.stats-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.stat-row {
    display: grid;
    grid-template-columns: 60px 1fr 60px;
    gap: var(--space-4);
    align-items: center;
}

.stat-home {
    text-align: right;
    font-weight: 600;
    font-family: var(--font-mono);
}

.stat-away {
    text-align: left;
    font-weight: 600;
    font-family: var(--font-mono);
}

.stat-bar {
    text-align: center;
}

.stat-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-bars {
    height: 6px;
    background: var(--bg-page);
    border-radius: var(--radius-full);
    display: flex;
    overflow: hidden;
}

.stat-bars .bar {
    height: 100%;
}

.stat-bars .bar.home {
    background: var(--primary);
}

.stat-bars .bar.away {
    background: var(--secondary);
}

/* Standings Table */
.standings-table {
    margin-bottom: var(--space-5);
}

.standings-table h4 {
    margin-bottom: var(--space-3);
    font-size: var(--text-base);
    font-weight: 600;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.table th,
.table td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.table th {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg-hover);
}

.table .pos {
    width: 36px;
    text-align: center;
}

.table .stat {
    width: 36px;
    text-align: center;
}

.table .pts {
    font-weight: 700;
}

.table .team {
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-logo-small {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.table tr:hover {
    background: var(--bg-hover);
}

.table tr.highlighted {
    background: rgba(var(--primary-rgb), 0.05);
}

.no-data {
    text-align: center;
    padding: var(--space-8);
    color: var(--text-muted);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: var(--space-8) 0 var(--space-6);
    margin-top: var(--space-10);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-8);
    margin-bottom: var(--space-8);
}

.footer-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-4);
}

.footer-text {
    color: var(--text-muted);
    font-size: var(--text-sm);
    line-height: 1.6;
}

.footer-links li {
    margin-bottom: var(--space-2);
}

.footer-links a {
    color: var(--text-muted);
    font-size: var(--text-sm);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-5);
    border-top: 1px solid var(--border);
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.footer-disclaimer {
    margin-top: var(--space-2);
    font-size: var(--text-xs);
}

/* ============================================
   Mobile Responsive
   ============================================ */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .match-row,
    .match-card {
        grid-template-columns: 1fr;
        gap: var(--space-3);
        padding: var(--space-4);
    }

    .match-time-col {
        display: flex;
        align-items: center;
        gap: var(--space-3);
        justify-content: space-between;
    }

    .team-col,
    .match-card .match-team {
        justify-content: flex-start !important;
        flex-direction: row !important;
        text-align: left !important;
    }

    .score-col,
    .match-card .match-center {
        justify-content: center;
    }

    .match-meta-col,
    .match-card .match-footer {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

    .match-score-section {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .team-logo-large {
        width: 60px;
        height: 60px;
    }

    .score-display .score {
        font-size: 36px;
    }

    .topbar-search {
        display: none;
    }

    .filter-controls {
        flex-direction: column;
    }

    .league-header,
    .competition-header {
        flex-wrap: wrap;
    }
}

/* Mobile Menu Toggle */
.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--text-primary);
}

@media (max-width: 1024px) {
    .mobile-menu-btn {
        display: flex;
    }
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

.sidebar-overlay.active {
    display: block;
}

/* ============================================
   Utilities
   ============================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

.text-live { color: var(--live); }
.text-success { color: var(--success); }
.text-muted { color: var(--text-muted); }
.text-primary-color { color: var(--primary); }

.bg-live { background: var(--live); }
.bg-success { background: var(--success); }

.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }

/* Button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: var(--text-sm);
    transition: all var(--transition-fast);
}

/* Header Backward Compat */
.header {
    display: none;
}

/* Hide old date nav */
.date-nav {
    display: none;
}

/* Hide old sub-nav */
.sub-nav {
    display: none;
}

/* Score animations */
.match-card.score-updated {
    animation: scoreFlash 0.5s ease-out;
}

@keyframes scoreFlash {
    0% { background: rgba(34, 197, 94, 0.15); }
    100% { background: transparent; }
}

/* Live Stream Section */
.live-stream-section {
    background: linear-gradient(135deg, var(--live), #f97316);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-5);
    color: white;
}

.live-stream-section.no-stream {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.stream-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    color: var(--live);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--text-sm);
    transition: all 0.2s;
}

.stream-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ============================================
   Page: Live Matches
   ============================================ */
.page-live .live-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--live), #f97316);
    border-radius: var(--radius-lg);
    padding: var(--space-5) var(--space-6);
    margin-bottom: var(--space-5);
    color: white;
}

.live-banner-content {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.live-pulse-ring {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
}

.live-badge-lg {
    font-size: var(--text-lg);
    font-weight: 800;
    letter-spacing: 1px;
}

.live-info .live-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    margin-bottom: 2px;
}

.live-info .live-subtitle {
    font-size: var(--text-sm);
    opacity: 0.9;
}

.live-actions {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.auto-update-text {
    font-size: var(--text-sm);
    opacity: 0.85;
}

.refresh-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: var(--space-3) var(--space-5);
    background: white;
    color: var(--live);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.refresh-btn.spinning svg {
    animation: spin 1s linear infinite;
}

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

.competition-live-badge {
    padding: var(--space-1) var(--space-3);
    background: var(--live-light);
    color: var(--live);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
}

/* ============================================
   Page: Results & Fixtures
   ============================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-5);
    flex-wrap: wrap;
    gap: var(--space-3);
}

.page-header-content .page-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
}

.page-header-content .page-date {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.page-stats {
    display: flex;
    gap: var(--space-3);
}

.stat-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: var(--space-2) var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

.stat-chip svg {
    color: var(--primary);
}

/* ============================================
   Page: Search
   ============================================ */
.page-search .search-header {
    margin-bottom: var(--space-5);
}

.page-search .search-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.page-search .search-count {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.search-form-panel {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-card);
}

.search-form-large {
    display: flex;
    gap: var(--space-3);
}

.search-input-wrap {
    flex: 1;
    position: relative;
}

.search-input-wrap .search-icon {
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input-lg {
    width: 100%;
    padding: var(--space-4) var(--space-4) var(--space-4) 48px;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: var(--text-base);
    transition: border-color 0.2s;
}

.search-input-lg:focus {
    outline: none;
    border-color: var(--primary);
}

.search-submit {
    padding: var(--space-4) var(--space-6);
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: var(--text-base);
    cursor: pointer;
    transition: background 0.2s;
}

.search-submit:hover {
    background: var(--primary-dark);
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.results-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.results-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    background: var(--bg-hover);
    border-bottom: 1px solid var(--border);
}

.results-section-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
}

.results-section-title svg {
    color: var(--primary);
}

.results-count {
    padding: var(--space-1) var(--space-3);
    background: var(--primary);
    color: white;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
}

.results-grid {
    display: flex;
    flex-direction: column;
}

.result-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-light);
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}

.result-card:last-child {
    border-bottom: none;
}

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

.result-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: var(--radius-md);
    background: var(--bg-hover);
    padding: 4px;
}

.result-info {
    flex: 1;
}

.result-name {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.result-meta {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.result-arrow {
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.2s;
}

.result-card:hover .result-arrow {
    opacity: 1;
}

/* ============================================
   Page: Match Detail - New Styles
   ============================================ */
.page-match-detail {
    max-width: 100%;
}

.breadcrumbs-bar {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-5);
    font-size: var(--text-sm);
    flex-wrap: wrap;
}

.breadcrumb-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-link:hover {
    color: var(--primary);
}

.breadcrumb-sep {
    color: var(--text-muted);
    display: flex;
}

.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 500;
}

/* ============================================
   Mobile Responsive - New Pages
   ============================================ */
@media (max-width: 640px) {
    .page-live .live-banner {
        flex-direction: column;
        text-align: center;
        gap: var(--space-4);
    }

    .live-banner-content {
        flex-direction: column;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-form-large {
        flex-direction: column;
    }

    .search-submit {
        width: 100%;
    }

    .breadcrumbs-bar {
        font-size: var(--text-xs);
    }
}

/* ============================================
   MISSING CSS - COMPLETE FIX
   ============================================ */

/* Topbar Inner Container */
.topbar {
    display: flex;
    flex-direction: column;
}

.topbar-inner {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: 0 var(--space-5);
    height: var(--topbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

@media (max-width: 1024px) {
    .sidebar-toggle {
        display: flex;
    }
}

/* Topbar Title */
.topbar-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 600;
    font-size: var(--text-base);
    color: var(--text-primary);
}

.topbar-sport-icon {
    font-size: 20px;
}

/* Topbar Search Form */
.topbar-search {
    flex: 1;
    max-width: 400px;
}

.topbar-search .search-form {
    display: flex;
    align-items: center;
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: var(--space-2) var(--space-4);
    transition: all var(--transition-fast);
}

.topbar-search .search-form:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.topbar-search .search-icon {
    color: var(--text-muted);
    margin-right: var(--space-2);
    display: flex;
}

.topbar-search .search-input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: var(--text-sm);
    color: var(--text-primary);
    min-width: 150px;
}

.topbar-search .search-input::placeholder {
    color: var(--text-muted);
}

/* Topbar Live Indicator */
.topbar-live-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--live-light);
    color: var(--live);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.topbar-live-indicator:hover {
    background: var(--live);
    color: white;
}

.topbar-live-indicator .live-pulse {
    width: 8px;
    height: 8px;
    background: var(--live);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

.topbar-live-indicator:hover .live-pulse {
    background: white;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.5; }
}

.live-count {
    white-space: nowrap;
}

/* Topbar Time */
.topbar-time {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    padding: var(--space-2) var(--space-3);
    background: var(--bg-page);
    border-radius: var(--radius-md);
}

/* Date Tabs Wrapper - see enhanced version at end of file */

/* ============================================
   Stat Card Icons
   ============================================ */
.stat-icon-total {
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    color: var(--secondary);
}

.stat-icon-live {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: var(--live);
}

.stat-icon-finished {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: var(--success);
}

.stat-icon-upcoming {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #3b82f6;
}

.stat-card-live {
    position: relative;
    overflow: hidden;
}

.stat-pulse {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 10px;
    height: 10px;
    background: var(--live);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

/* ============================================
   Popular Leagues Section
   ============================================ */
.popular-section {
    margin-bottom: var(--space-6);
}

.section-header-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.section-title-sm {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
}

.view-all-link {
    font-size: var(--text-sm);
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.view-all-link:hover {
    text-decoration: underline;
}

.leagues-carousel {
    display: flex;
    gap: var(--space-3);
    overflow-x: auto;
    padding-bottom: var(--space-2);
    scrollbar-width: thin;
}

.leagues-carousel::-webkit-scrollbar {
    height: 4px;
}

.leagues-carousel::-webkit-scrollbar-track {
    background: var(--border-light);
    border-radius: 2px;
}

.leagues-carousel::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.league-chip {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    text-decoration: none;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.league-chip:hover {
    border-color: var(--primary);
    background: var(--bg-hover);
}

.league-chip-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.league-chip-name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
}

/* ============================================
   Panel Date
   ============================================ */
.panel-date {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* ============================================
   Filter Bar
   ============================================ */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-5);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    gap: var(--space-4);
    flex-wrap: wrap;
}

.filter-pills {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.filter-pill {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.filter-pill .live-dot {
    width: 6px;
    height: 6px;
    background: var(--live);
    border-radius: 50%;
    animation: blink 1s infinite;
}

.filter-pill.active .live-dot {
    background: white;
}

.pill-count {
    background: rgba(0,0,0,0.1);
    padding: 0 var(--space-2);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
}

.filter-pill.active .pill-count {
    background: rgba(255,255,255,0.2);
}

/* Filter Actions */
.filter-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.quick-search {
    position: relative;
}

.quick-search-input {
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    background: var(--bg-page);
    outline: none;
    min-width: 200px;
    transition: all var(--transition-fast);
}

.quick-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-10) var(--space-5);
    text-align: center;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

.empty-title {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.empty-text {
    font-size: var(--text-base);
    color: var(--text-muted);
    margin-bottom: var(--space-5);
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    background: var(--primary);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--text-sm);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.btn-action:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* ============================================
   Matches Container & Competition Block
   ============================================ */
.matches-container {
    display: flex;
    flex-direction: column;
}

.competition-block {
    border-bottom: 1px solid var(--border);
}

.competition-block:last-child {
    border-bottom: none;
}

.competition-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-5);
    background: linear-gradient(90deg, var(--bg-sidebar), #334155);
    color: white;
}

.competition-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.competition-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    background: white;
    border-radius: var(--radius-sm);
    padding: 2px;
}

.competition-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.competition-name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: white;
    text-decoration: none;
}

.competition-name:hover {
    text-decoration: underline;
}

.competition-country {
    font-size: var(--text-xs);
    opacity: 0.7;
}

.competition-count {
    background: rgba(255,255,255,0.2);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
}

/* Matches Table */
.matches-table {
    display: flex;
    flex-direction: column;
}

/* ============================================
   Match Card - Grid Style
   ============================================ */
.match-card {
    display: grid;
    grid-template-columns: 70px 1fr 90px 1fr 50px;
    align-items: center;
    padding: var(--space-3) var(--space-5);
    border-bottom: 1px solid var(--border-light);
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-fast);
    gap: var(--space-3);
}

.match-card:last-child {
    border-bottom: none;
}

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

.match-card.is-live {
    background: linear-gradient(90deg, var(--live-light), transparent);
    border-left: 3px solid var(--live);
}

/* Match Time Column */
.match-time-col {
    text-align: center;
}

.time-live {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--live);
}

.time-live .live-dot {
    width: 6px;
    height: 6px;
    background: var(--live);
    border-radius: 50%;
    animation: blink 1s infinite;
}

.time-finished {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-muted);
}

.time-scheduled {
    font-size: var(--text-base);
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

/* Match Team Column */
.match-team-col {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}

.match-team-col.home {
    justify-content: flex-end;
    text-align: right;
}

.match-team-col.away {
    justify-content: flex-start;
    text-align: left;
}

.match-team-col .team-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

.match-team-col .team-name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.match-team-col .team-name.winner {
    color: var(--primary);
}

/* Match Score Column */
.match-score-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.match-score-col .score-box {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    background: var(--bg-page);
    border-radius: var(--radius-md);
}

.match-score-col .score-box.live {
    background: var(--live);
    color: white;
}

.match-score-col .score-box.upcoming {
    background: transparent;
    border: 1px solid var(--border);
}

.match-score-col .score {
    font-size: var(--text-base);
    font-weight: 700;
    font-family: var(--font-mono);
    min-width: 20px;
    text-align: center;
}

.match-score-col .score.winner {
    color: var(--primary);
}

.match-score-col .score-box.live .score.winner {
    color: white;
}

.match-score-col .score-sep {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.match-score-col .score-box.live .score-sep {
    color: rgba(255,255,255,0.7);
}

.match-score-col .ht-score {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* Match Info Column */
.match-info-col {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
}

.info-blv {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--primary);
    font-size: var(--text-xs);
    font-weight: 600;
}

.info-blv .blv-count {
    background: var(--primary);
    color: white;
    padding: 0 4px;
    border-radius: var(--radius-sm);
    font-size: 10px;
}

.info-arrow {
    color: var(--text-muted);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.match-card:hover .info-arrow {
    opacity: 1;
}

/* ============================================
   Footer Styles
   ============================================ */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: var(--space-6) 0;
    margin-top: auto;
}

.footer-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--space-5);
}

.footer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-5);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--primary);
}

.footer-name {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-primary);
}

.footer-social {
    display: flex;
    gap: var(--space-2);
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--bg-page);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.social-btn:hover {
    background: var(--primary);
    color: white;
}

.footer-links-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
    padding: var(--space-5) 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.footer-links-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.footer-links-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.footer-links-group a {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-links-group a:hover {
    color: var(--primary);
}

.footer-bottom {
    padding-top: var(--space-5);
    text-align: center;
}

.footer-copyright {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-1);
}

.footer-disclaimer {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* Sidebar Footer */
.sidebar-footer-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    font-size: var(--text-xs);
    color: rgba(255,255,255,0.5);
}

.footer-version {
    font-family: var(--font-mono);
}

/* Sidebar Logo Text */
.sidebar-logo-text {
    font-size: var(--text-lg);
    font-weight: 700;
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-lg);
    color: white;
}

.sidebar-logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

/* Sport Selector */
.sport-selector {
    display: flex;
    gap: var(--space-2);
    background: rgba(255,255,255,0.05);
    padding: var(--space-1);
    border-radius: var(--radius-md);
}

.sport-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: 500;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.sport-btn:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.sport-btn.active {
    background: var(--primary);
    color: white;
}

.sport-icon {
    font-size: 16px;
}

/* Nav List */
.nav-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ============================================
   Mobile Responsive - Additional
   ============================================ */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0;
    }

    .topbar-search {
        display: none;
    }
}

@media (max-width: 768px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .match-card {
        grid-template-columns: 60px 1fr 70px 1fr 40px;
        padding: var(--space-3);
        font-size: var(--text-sm);
    }

    .match-team-col .team-name {
        font-size: var(--text-xs);
    }

    .footer-links-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-actions {
        width: 100%;
    }

    .quick-search-input {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .stats-row {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-2);
    }

    .stat-card {
        padding: var(--space-3);
    }

    .stat-icon {
        width: 36px;
        height: 36px;
    }

    .stat-value {
        font-size: var(--text-lg);
    }

    .match-card {
        grid-template-columns: 50px 1fr 60px 1fr 30px;
        gap: var(--space-2);
        padding: var(--space-2);
    }

    .match-team-col .team-logo {
        width: 20px;
        height: 20px;
    }

    .footer-links-row {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-4);
    }

    .leagues-carousel {
        gap: var(--space-2);
    }

    .league-chip {
        padding: var(--space-1) var(--space-3);
    }

    .league-chip-logo {
        width: 20px;
        height: 20px;
    }

    .league-chip-name {
        font-size: var(--text-xs);
    }
}

/* ============================================
   CSS Variable Compatibility Layer
   Map old variable names to new design system
   ============================================ */
:root {
    /* Legacy compatibility for chat and other components */
    --color-surface: var(--bg-card);
    --color-bg: var(--bg-page);
    --color-bg-alt: var(--bg-hover);
    --color-border: var(--border);
    --color-text: var(--text-primary);
    --color-text-muted: var(--text-muted);
    --color-text-secondary: var(--text-secondary);
}

/* ============================================
   Date Tabs Wrapper - Enhanced
   ============================================ */
.date-tabs-wrapper {
    padding: var(--space-3) var(--space-5);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.date-tabs-wrapper::-webkit-scrollbar {
    display: none;
}

.date-tabs {
    display: flex;
    gap: var(--space-2);
    min-width: max-content;
    justify-content: center;
}

.date-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-lg);
    min-width: 72px;
    text-decoration: none;
    color: var(--text-secondary);
    background: var(--bg-page);
    transition: all var(--transition-fast);
    border: 2px solid transparent;
}

.date-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border);
}

.date-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.date-tab.today:not(.active) {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(16, 185, 129, 0.05);
}

.date-tab-day {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.date-tab-num {
    font-size: var(--text-sm);
    font-weight: 700;
    margin-top: 2px;
}

/* ============================================
   Chat Box - Desktop Height Fix
   ============================================ */
.live-chat-box {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 650px;
    border: 1px solid var(--border);
}

.live-chat-container {
    width: 340px;
    flex-shrink: 0;
}

.chat-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-page);
    border-bottom: 1px solid var(--border);
}

.chat-title {
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.chat-status {
    font-size: var(--text-xs);
    color: var(--text-muted);
    padding: 2px 10px;
    border-radius: var(--radius-full);
    background: var(--bg-hover);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    background: var(--bg-card);
}

.chat-message {
    display: flex;
    gap: var(--space-2);
}

.chat-message.system {
    justify-content: center;
    padding: var(--space-2) 0;
}

.chat-message.system .system-text {
    font-size: var(--text-xs);
    color: var(--text-muted);
    background: var(--bg-page);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
}

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-page);
}

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

.chat-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: 2px;
}

.chat-nickname {
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--primary);
}

.chat-time {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.chat-text {
    font-size: var(--text-sm);
    line-height: 1.5;
    word-break: break-word;
    color: var(--text-primary);
}

.chat-input-area {
    display: flex;
    gap: var(--space-2);
    padding: var(--space-3);
    border-top: 1px solid var(--border);
    background: var(--bg-page);
}

.chat-input-area input {
    flex: 1;
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition-fast);
}

.chat-input-area input:focus {
    border-color: var(--primary);
}

.chat-input-area input::placeholder {
    color: var(--text-muted);
}

.chat-input-area button {
    padding: var(--space-2) var(--space-4);
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.chat-input-area button:hover:not(:disabled) {
    background: var(--primary-dark);
}

.chat-input-area button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   Topbar Inner - Enhanced
   ============================================ */
.topbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-inner {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: 0 var(--space-5);
    height: var(--topbar-height);
}

.sidebar-toggle {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--bg-page);
}

@media (max-width: 1024px) {
    .sidebar-toggle {
        display: flex;
    }
}

.topbar-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.topbar-sport-icon {
    font-size: 24px;
}

/* Search Form in Topbar */
.topbar-search {
    flex: 1;
    max-width: 400px;
    margin: 0 auto;
    position: relative;
}

.search-form {
    display: flex;
    align-items: center;
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: var(--space-2) var(--space-4);
    transition: all var(--transition-fast);
}

.search-form:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.search-icon {
    color: var(--text-muted);
    margin-right: var(--space-2);
    display: flex;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.search-input::placeholder {
    color: var(--text-muted);
}

/* Live Indicator */
.topbar-live-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: rgba(239, 68, 68, 0.1);
    color: var(--live);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
    transition: background var(--transition-fast);
}

.topbar-live-indicator:hover {
    background: rgba(239, 68, 68, 0.15);
}

.live-pulse {
    width: 8px;
    height: 8px;
    background: var(--live);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

.live-count {
    white-space: nowrap;
}

/* Current Time */
.topbar-time {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    padding: var(--space-2) var(--space-3);
    background: var(--bg-page);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
}

/* ============================================
   Sidebar Mobile Active State
   ============================================ */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 999;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .topbar-search {
        display: none;
    }

    .date-tabs {
        justify-content: flex-start;
    }
}

/* Mobile date tabs */
@media (max-width: 768px) {
    .date-tabs-wrapper {
        padding: var(--space-3);
    }

    .date-tab {
        min-width: 60px;
        padding: var(--space-2) var(--space-3);
    }

    .live-chat-container {
        width: 100%;
    }

    .live-chat-box {
        height: 400px;
    }
}

@media (max-width: 480px) {
    .topbar-inner {
        padding: 0 var(--space-3);
    }

    .topbar-title span:not(.topbar-sport-icon) {
        display: none;
    }

    .topbar-time {
        display: none;
    }

    .date-tab {
        min-width: 55px;
        padding: var(--space-2);
    }

    .date-tab-day {
        font-size: 10px;
    }

    .date-tab-num {
        font-size: var(--text-xs);
    }
}

/* ============================================
   COMPREHENSIVE MOBILE RESPONSIVE FIX
   ============================================ */

/* App Layout - Mobile First */
.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

/* Main Wrapper - Full width on mobile */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
    max-width: 100%;
    overflow-x: hidden;
}

/* Content Area */
.content-area {
    flex: 1;
    padding: var(--space-4);
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Sidebar - Fixed on desktop, hidden on mobile */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-inverse);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Date Tabs Wrapper - Desktop Fix */
.date-tabs-wrapper {
    padding: var(--space-3) var(--space-5);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
}

.date-tabs-wrapper::-webkit-scrollbar {
    display: none;
}

.date-tabs {
    display: flex;
    gap: var(--space-2);
    min-width: max-content;
    justify-content: center;
    padding: 0 var(--space-2);
}

.date-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-lg);
    min-width: 72px;
    text-decoration: none;
    color: var(--text-secondary);
    background: var(--bg-page);
    transition: all 0.2s ease;
    border: 2px solid transparent;
    text-align: center;
}

.date-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border);
}

.date-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.date-tab.today:not(.active) {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(16, 185, 129, 0.08);
}

.date-tab-day {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.date-tab-num {
    font-size: var(--text-sm);
    font-weight: 700;
    margin-top: 2px;
    line-height: 1.2;
}

/* Match Card - Responsive Grid */
.match-card {
    display: grid;
    grid-template-columns: 70px 1fr 80px 1fr 50px;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    text-decoration: none;
    transition: background 0.15s;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

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

/* Team columns */
.match-team-col {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
    overflow: hidden;
}

.match-team-col.home {
    justify-content: flex-end;
    text-align: right;
}

.match-team-col.away {
    justify-content: flex-start;
    text-align: left;
}

.match-team-col .team-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: var(--text-sm);
    font-weight: 500;
}

.match-team-col .team-logo {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    object-fit: contain;
}

/* Score column */
.match-score-col {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-weight: 700;
    font-size: var(--text-base);
}

/* Time column */
.match-time-col {
    text-align: center;
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* Info column */
.match-info-col {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* ============================================
   TABLET RESPONSIVE (max-width: 1024px)
   ============================================ */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 0px;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0;
        width: 100%;
    }

    .sidebar-toggle {
        display: flex !important;
    }

    .topbar-search {
        display: none;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .date-tabs {
        justify-content: flex-start;
    }
}

/* ============================================
   MOBILE RESPONSIVE (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
    .content-area {
        padding: var(--space-3);
    }

    .topbar-inner {
        padding: 0 var(--space-3);
    }

    .date-tabs-wrapper {
        padding: var(--space-2) var(--space-3);
    }

    .date-tab {
        min-width: 58px;
        padding: var(--space-2) var(--space-3);
    }

    /* Match Card Mobile */
    .match-card {
        grid-template-columns: 55px 1fr 65px 1fr 35px;
        gap: var(--space-1);
        padding: var(--space-2) var(--space-3);
        font-size: var(--text-sm);
    }

    .match-team-col .team-name {
        font-size: var(--text-xs);
    }

    .match-team-col .team-logo {
        width: 20px;
        height: 20px;
    }

    .match-score-col {
        font-size: var(--text-sm);
    }

    .match-time-col {
        font-size: 10px;
    }

    /* Stats Row */
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-2);
    }

    .stat-card {
        padding: var(--space-3);
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .stat-value {
        font-size: var(--text-lg);
    }

    /* Page Header */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }

    .page-title {
        font-size: var(--text-xl);
    }

    /* Filter Bar */
    .filter-bar {
        flex-direction: column;
        gap: var(--space-2);
        padding: var(--space-3);
    }

    .filter-pills {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: var(--space-1);
    }

    /* Competition Header */
    .competition-header {
        padding: var(--space-2) var(--space-3);
    }

    .competition-logo {
        width: 24px;
        height: 24px;
    }

    .competition-name {
        font-size: var(--text-sm);
    }

    /* Leagues Carousel */
    .leagues-carousel {
        gap: var(--space-2);
    }

    .league-chip {
        padding: var(--space-1) var(--space-3);
    }

    .league-chip-logo {
        width: 20px;
        height: 20px;
    }

    .league-chip-name {
        font-size: var(--text-xs);
    }

    /* Footer */
    .footer-links-row {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-3);
    }
}

/* ============================================
   SMALL MOBILE RESPONSIVE (max-width: 480px)
   ============================================ */
@media (max-width: 480px) {
    .content-area {
        padding: var(--space-2);
    }

    .topbar-inner {
        padding: 0 var(--space-2);
        height: 50px;
    }

    .topbar-title {
        font-size: var(--text-base);
    }

    .topbar-title span:not(.topbar-sport-icon) {
        display: none;
    }

    .topbar-time {
        display: none;
    }

    .topbar-live-indicator {
        padding: var(--space-1) var(--space-2);
        font-size: var(--text-xs);
    }

    .date-tabs-wrapper {
        padding: var(--space-2);
    }

    .date-tab {
        min-width: 50px;
        padding: 6px 8px;
    }

    .date-tab-day {
        font-size: 9px;
    }

    .date-tab-num {
        font-size: 11px;
    }

    /* Match Card - Very Small */
    .match-card {
        grid-template-columns: 45px 1fr 55px 1fr 30px;
        gap: 4px;
        padding: var(--space-2);
    }

    .match-team-col .team-name {
        font-size: 11px;
        max-width: 70px;
    }

    .match-team-col .team-logo {
        width: 18px;
        height: 18px;
    }

    .match-score-col {
        font-size: var(--text-xs);
        gap: 4px;
    }

    .match-time-col {
        font-size: 9px;
    }

    .match-info-col svg {
        width: 14px;
        height: 14px;
    }

    /* Stats */
    .stats-row {
        gap: var(--space-2);
    }

    .stat-card {
        padding: var(--space-2);
        flex-direction: column;
        text-align: center;
        gap: var(--space-2);
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .stat-value {
        font-size: var(--text-base);
    }

    .stat-label {
        font-size: 10px;
    }

    /* Page Title */
    .page-title {
        font-size: var(--text-lg);
    }

    .page-date {
        font-size: var(--text-xs);
    }

    /* Footer */
    .footer {
        padding: var(--space-4) var(--space-2);
    }

    .footer-links-row {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }
}

/* ============================================
   PREVENT OVERFLOW ON ALL ELEMENTS
   ============================================ */
.matches-panel,
.matches-container,
.competition-block,
.matches-table,
.popular-section,
.filter-bar,
.page-header,
.section-header-compact {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Fix potential overflow from long text */
.team-name,
.competition-name,
.league-chip-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Body sidebar-open state */
body.sidebar-open {
    overflow: hidden;
}

/* ============================================
   MATCH DETAIL PAGE - COMPREHENSIVE FIX
   ============================================ */

/* Live Stream with Chat Layout - Desktop */
.live-stream-with-chat {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
    align-items: stretch;
}

.live-stream-with-chat .live-stream-section {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

/* Chat Container - Match Stream Height */
.live-stream-with-chat .live-chat-container {
    width: 360px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.live-stream-with-chat .live-chat-box {
    flex: 1;
    min-height: 500px;
    height: 100%;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

/* Stream Header - Fix Colors */
.stream-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background: linear-gradient(135deg, var(--live), #f97316);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stream-header h3 {
    color: white !important;
    font-size: var(--text-lg);
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.stream-header .live-badge {
    background: white;
    color: var(--live);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stream-toggle {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: background 0.2s;
}

.stream-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Stream Container */
.stream-container {
    background: #000;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    overflow: hidden;
}

.stream-player-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

/* Tab Buttons - Fix Active Color */
.tabs-nav,
.content-tabs {
    display: flex;
    gap: var(--space-1);
    background: var(--bg-card);
    padding: var(--space-2);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn,
.content-tab {
    flex: 1;
    min-width: 80px;
    padding: var(--space-2) var(--space-3);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-align: center;
}

.tab-btn:hover,
.content-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.tab-btn.active,
.content-tab.active {
    background: var(--primary) !important;
    color: white !important;
}

/* Match Tabs Container */
.match-tabs {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-5);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* League Page - Title Color Fix */
.league-header {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-5);
    display: flex;
    align-items: center;
    gap: var(--space-5);
}

.league-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary) !important;
    margin-bottom: var(--space-2);
}

.league-meta {
    display: flex;
    gap: var(--space-4);
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.league-logo-large {
    width: 80px;
    height: 80px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Match Header */
.match-header {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-5);
    text-align: center;
}

.match-header.is-live {
    border: 2px solid var(--live);
}

.match-competition-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    color: var(--text-secondary);
}

.match-competition-info a {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: inherit;
    text-decoration: none;
}

.match-competition-info a:hover {
    color: var(--primary);
}

.match-competition-info .competition-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* Match Score Section */
.match-score-section {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: var(--space-6);
    margin-bottom: var(--space-4);
}

.team-block {
    text-align: center;
}

.team-block a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    color: inherit;
}

.team-block a:hover .team-name {
    color: var(--primary);
}

.team-logo-large {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.team-block .team-name {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.2s;
}

/* Score Block */
.score-block {
    text-align: center;
}

.score-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
}

.score-display .score {
    font-size: 48px;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.score-display .score-separator {
    font-size: 36px;
    color: var(--text-muted);
}

.match-status-live {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-2);
    color: var(--live);
    font-weight: 600;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--live);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

.match-status-final {
    margin-top: var(--space-2);
    color: var(--text-muted);
    font-weight: 500;
}

.kickoff-time {
    text-align: center;
}

.kickoff-time .time {
    font-size: 36px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
    display: block;
}

.kickoff-time .label {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.halftime-score {
    margin-top: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* Breadcrumbs */
.breadcrumbs-bar {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) 0;
    font-size: var(--text-sm);
    color: var(--text-muted);
    flex-wrap: wrap;
}

.breadcrumb-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-link:hover {
    color: var(--primary);
}

.breadcrumb-sep {
    color: var(--border);
    display: flex;
    align-items: center;
}

.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 500;
}

/* Streamers Selector */
.streamers-selector {
    background: rgba(0, 0, 0, 0.3);
    padding: var(--space-4);
    margin-top: var(--space-3);
    border-radius: var(--radius-md);
}

.streamers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
}

.streamers-header h4 {
    color: white;
    font-size: var(--text-sm);
    font-weight: 600;
    margin: 0;
}

.quality-selector {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: white;
    font-size: var(--text-sm);
}

.quality-selector select {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
}

.streamers-list {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.streamer-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-2);
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    min-width: 70px;
}

.streamer-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.streamer-btn.active {
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.2);
}

.streamer-avatar-wrap {
    position: relative;
}

.streamer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.streamer-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.streamer-avatar-placeholder svg {
    width: 24px;
    height: 24px;
}

.streamer-check {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
}

.streamer-btn.active .streamer-check {
    display: flex;
}

.streamer-name {
    color: white;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60px;
}

/* Stream Source Badge */
.stream-source-badge {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-3);
    padding: var(--space-2) var(--space-3);
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    width: fit-content;
    color: white;
    font-size: var(--text-xs);
}

.source-icon {
    background: #ff6b00;
    color: white;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 10px;
}

/* Chat Box Enhanced Styles */
.live-chat-box .chat-header-bar {
    padding: var(--space-3) var(--space-4);
    background: var(--bg-page);
    border-bottom: 1px solid var(--border);
}

.live-chat-box .chat-title {
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.live-chat-box .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-3);
    background: var(--bg-card);
}

.live-chat-box .chat-input-area {
    padding: var(--space-3);
    border-top: 1px solid var(--border);
    background: var(--bg-page);
}

/* Match Detail Page Responsive */
@media (max-width: 1024px) {
    .live-stream-with-chat {
        flex-direction: column;
    }

    .live-stream-with-chat .live-chat-container {
        width: 100%;
    }

    .live-stream-with-chat .live-chat-box {
        min-height: 400px;
        height: 400px;
    }
}

@media (max-width: 768px) {
    .match-score-section {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .team-block {
        order: 1;
    }

    .team-block.home {
        order: 1;
    }

    .score-block {
        order: 2;
    }

    .team-block.away {
        order: 3;
    }

    .match-score-section {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .team-logo-large {
        width: 60px;
        height: 60px;
    }

    .team-block .team-name {
        font-size: var(--text-base);
    }

    .score-display .score {
        font-size: 36px;
    }

    .score-display .score-separator {
        font-size: 24px;
    }

    .tabs-nav {
        padding: var(--space-1);
    }

    .tab-btn {
        padding: var(--space-2);
        font-size: var(--text-xs);
        min-width: 60px;
    }

    .league-header {
        flex-direction: column;
        text-align: center;
        padding: var(--space-4);
    }

    .league-title {
        font-size: var(--text-xl);
    }

    .league-logo-large {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    .stream-header {
        padding: var(--space-3);
        flex-wrap: wrap;
    }

    .stream-header h3 {
        font-size: var(--text-base);
        flex: none;
        width: 100%;
        order: 2;
        margin-top: var(--space-2);
    }

    .stream-header .live-badge {
        order: 1;
    }

    .stream-toggle {
        order: 1;
        margin-left: auto;
    }

    .streamers-list {
        justify-content: center;
    }

    .match-header {
        padding: var(--space-3);
    }

    .match-competition-info {
        flex-wrap: wrap;
        justify-content: center;
    }

    .team-logo-large {
        width: 50px;
        height: 50px;
    }

    .score-display .score {
        font-size: 28px;
    }

    .kickoff-time .time {
        font-size: 28px;
    }
}

/* ============================================
   TOPBAR & DATE TABS - COMPREHENSIVE FIX
   ============================================ */

/* Main Topbar Container */
.topbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Topbar Inner Row */
.topbar-inner {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: 0 var(--space-5);
    height: var(--topbar-height);
    min-height: 60px;
    background: var(--bg-card);
}

/* Sidebar Toggle - Mobile Only */
.sidebar-toggle {
    display: none;
    width: 40px;
    height: 40px;
    min-width: 40px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.sidebar-toggle:hover {
    background: var(--bg-hover);
}

/* Topbar Title Section */
.topbar-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.topbar-sport-icon {
    font-size: 24px;
    line-height: 1;
}

/* Search Form */
.topbar-search {
    flex: 1;
    max-width: 400px;
    margin: 0 auto;
}

.topbar-search .search-form {
    display: flex;
    align-items: center;
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: var(--space-2) var(--space-4);
    transition: all 0.2s;
}

.topbar-search .search-form:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.topbar-search .search-icon {
    color: var(--text-muted);
    margin-right: var(--space-2);
    display: flex;
    flex-shrink: 0;
}

.topbar-search .search-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: var(--text-sm);
    color: var(--text-primary);
    min-width: 100px;
}

.topbar-search .search-input::placeholder {
    color: var(--text-muted);
}

/* Live Indicator */
.topbar-live-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: rgba(239, 68, 68, 0.1);
    color: var(--live);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.topbar-live-indicator:hover {
    background: var(--live);
    color: white;
}

.topbar-live-indicator .live-pulse {
    width: 8px;
    height: 8px;
    min-width: 8px;
    background: var(--live);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

.topbar-live-indicator:hover .live-pulse {
    background: white;
}

/* Current Time Display */
.topbar-time {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    padding: var(--space-2) var(--space-3);
    background: var(--bg-page);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    white-space: nowrap;
}

/* ============================================
   DATE TABS - NAVIGATION ROW (FORCE OVERRIDE)
   ============================================ */

.date-tabs-wrapper {
    display: flex !important;
    justify-content: center !important;
    padding: 12px 20px !important;
    background: #1e293b !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100% !important;
    box-sizing: border-box !important;
}

.date-tabs-wrapper::-webkit-scrollbar {
    display: none;
}

.date-tabs {
    display: flex !important;
    gap: 8px !important;
    min-width: max-content !important;
    justify-content: center !important;
}

.date-tab {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px 16px !important;
    border-radius: 12px !important;
    min-width: 72px !important;
    min-height: 52px !important;
    text-decoration: none !important;
    color: #94a3b8 !important;
    background: #0f172a !important;
    transition: all 0.2s ease !important;
    border: 2px solid transparent !important;
    text-align: center !important;
    box-sizing: border-box !important;
}

.date-tab:hover {
    background: #334155 !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

.date-tab.active {
    background: #10b981 !important;
    color: white !important;
    border-color: #10b981 !important;
}

.date-tab.today:not(.active) {
    border-color: #10b981 !important;
    color: #10b981 !important;
    background: rgba(16, 185, 129, 0.1) !important;
}

.date-tab-day {
    display: block !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    line-height: 1.3 !important;
}

.date-tab-num {
    display: block !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    margin-top: 2px !important;
    line-height: 1.3 !important;
}

/* ============================================
   TOPBAR RESPONSIVE STYLES
   ============================================ */

@media (max-width: 1024px) {
    .sidebar-toggle {
        display: flex;
    }

    .topbar-inner {
        padding: 0 var(--space-4);
    }

    .topbar-search {
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    .topbar-inner {
        gap: var(--space-3);
        padding: 0 var(--space-3);
        min-height: 56px;
    }

    .topbar-title {
        font-size: var(--text-base);
    }

    .topbar-title span:not(.topbar-sport-icon) {
        display: none;
    }

    .topbar-sport-icon {
        font-size: 20px;
    }

    .topbar-search {
        flex: 1;
        max-width: none;
        margin: 0;
    }

    .topbar-search .search-input {
        min-width: 80px;
    }

    .topbar-time {
        display: none;
    }

    .date-tabs-wrapper {
        padding: 8px 12px !important;
    }

    .date-tab {
        padding: 8px 12px !important;
        min-width: 64px !important;
        min-height: 48px !important;
    }
}

@media (max-width: 480px) {
    .topbar-inner {
        gap: 8px !important;
        padding: 0 8px !important;
    }

    .topbar-live-indicator {
        padding: 4px 8px !important;
        font-size: 12px !important;
    }

    .topbar-live-indicator .live-pulse {
        width: 6px !important;
        height: 6px !important;
        min-width: 6px !important;
    }

    .date-tabs-wrapper {
        padding: 8px !important;
    }

    .date-tab {
        padding: 6px 10px !important;
        min-width: 56px !important;
        min-height: 44px !important;
    }

    .date-tab-day {
        font-size: 10px !important;
    }

    .date-tab-num {
        font-size: 12px !important;
    }
}
