:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius-lg: 16px;
    --radius-md: 12px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* --- Header --- */
header {
    height: 72px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 20px;
    color: var(--text-main);
    text-decoration: none;
}

.logo-box {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), #6366f1);
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.search-bar {
    flex: 0 1 450px;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 10px 16px 10px 44px;
    background: #f1f5f9;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.2s;
}

.search-bar input:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.search-bar i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.user-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-login {
    background: var(--text-main);
    color: white;
    padding: 10px 24px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.btn-login:hover { background: #1e293b; transform: translateY(-1px); }

/* --- Navigation Links --- */
.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s;
}
.nav-link:hover {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}
.nav-link.active {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
}

/* --- Main Layout --- */
.wrapper {
    display: flex;
    margin-top: 72px;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
    min-height: calc(100vh - 72px);
}

/* --- Sidebar --- */
aside {
    width: 280px;
    padding: 32px 16px;
    border-right: 1px solid var(--border);
    position: sticky;
    top: 72px;
    height: calc(100vh - 72px);
}

.sidebar-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 16px;
    padding-left: 12px;
}

.league-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border: none;
    background: transparent;
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: 4px;
    transition: 0.2s;
    color: var(--text-muted);
    font-weight: 500;
}

.league-btn:hover { background: #f1f5f9; color: var(--text-main); }
.league-btn.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    font-weight: 600;
}

.league-info { display: flex; align-items: center; gap: 12px; }
.league-badge {
    font-size: 11px;
    background: #e2e8f0;
    padding: 2px 8px;
    border-radius: 20px;
    color: var(--text-muted);
}
.active .league-badge { background: var(--primary); color: white; }

/* --- Content Area --- */
main {
    flex: 1;
    padding: 32px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 32px;
}

.content-title h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.content-title p { color: var(--text-muted); font-size: 14px; }

/* --- Match List --- */
.grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* --- Section Headers (Betfair-style) --- */
.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-top: 16px;
    border-radius: 8px 8px 0 0;
    background: #1e3a5f;
    color: white;
}

.section-header:first-child {
    margin-top: 0;
}

.section-live {
    background: linear-gradient(135deg, #16a34a, #15803d);
}

.section-upcoming {
    background: linear-gradient(135deg, #1e3a5f, #1e40af);
}

.section-completed {
    background: linear-gradient(135deg, #64748b, #475569);
}

.section-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.section-count {
    font-size: 11px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
}

/* --- Matches Grid (within section) --- */
.matches-grid {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

.matches-grid .card {
    border-radius: 0;
    border: none;
    margin: 0;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    align-items: center;
    gap: 24px;
}

.card:hover {
    box-shadow: 0 8px 16px -4px rgb(0 0 0 / 0.08);
    border-color: #cbd5e1;
    transform: translateX(4px);
}

/* Time & Status */
.match-time {
    min-width: 120px;
    text-align: center;
}

.time-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.league-tag {
    font-size: 11px;
    color: var(--text-muted);
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

.status-live {
    color: var(--danger);
    font-weight: 700;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Teams Section */
.teams-section {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 32px;
}

.team-item {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.team-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    overflow: hidden;
}

.team-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.team-logo-emoji {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.team-info {
    flex: 1;
}

.team-name {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-main);
    margin-bottom: 4px;
}

.win-rate {
    font-size: 13px;
    color: var(--success);
    font-weight: 600;
}

.vs-divider {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    padding: 0 12px;
}

/* Odds Section */
.odds-section {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    border-left: 1px solid var(--border);
}

.odd-item {
    text-align: center;
    min-width: 80px;
}

.odd-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 6px;
}

.odd-val {
    background: #f1f5f9;
    color: var(--primary);
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
}

/* Stats & Action */
.match-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-left: 24px;
    border-left: 1px solid var(--border);
}

.stat-badge {
    text-align: center;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 8px;
}

.stat-badge span {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-badge b {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-main);
    font-size: 14px;
}

.btn-detail {
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    white-space: nowrap;
}

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

/* --- Disclaimer Modal --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 20px;
    visibility: visible; opacity: 1;
    transition: 0.3s;
}

.modal-overlay.hidden { visibility: hidden; opacity: 0; }

.modal {
    background: white;
    max-width: 500px;
    width: 100%;
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}

.modal-icon {
    width: 64px; height: 64px;
    background: #fef2f2;
    color: var(--danger);
    border-radius: 50%;
    display: grid; place-items: center;
    margin: 0 auto 24px;
    font-size: 32px;
}

.modal h2 { margin-bottom: 16px; font-size: 24px; }
.modal p { color: var(--text-muted); font-size: 15px; margin-bottom: 32px; line-height: 1.6; }

.modal-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.3s; }

/* Responsive */
@media (max-width: 1024px) {
    aside { display: none; }
    .card {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .odds-section, .match-actions {
        border-left: none;
        border-top: 1px solid var(--border);
        padding: 16px 0 0 0;
        width: 100%;
        justify-content: space-between;
    }
    .teams-section {
        flex-direction: column;
        gap: 16px;
        width: 100%;
    }
}
