/* ============================================================
   FootballSportsToday — Oddspedia-inspired dark layout
   ============================================================ */

:root {
    --bg:     #0d1117;
    --bg2:    #161b22;
    --bg3:    #1c2230;
    --bg4:    #21262d;
    --fg:     #e6edf3;
    --fg2:    #8b949e;
    --fg3:    #484f58;
    --acc:    #39e87b;
    --acc2:   #2bc866;
    --live:   #ef4444;
    --green:  #3fb950;
    --blue:   #58a6ff;
    --yellow: #d29922;
    --brd:    #21262d;
    --brd2:   #30363d;
    --glow:   rgba(57, 232, 123, .08);
}

[data-theme="light"] {
    --bg:  #f0f2f5; --bg2: #ffffff; --bg3: #e8eaed; --bg4: #dfe1e5;
    --fg:  #0d1117; --fg2: #57606a; --fg3: #8c959f;
    --brd: #d0d7de; --brd2: #b6bdc4;
    --glow: rgba(57, 232, 123, .05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    background: var(--bg);
    color: var(--fg);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── NAV ────────────────────────────────────────────────────── */

.topnav {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 24px;
    height: 52px;
    background: var(--bg2);
    border-bottom: 1px solid var(--brd);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.3px;
    white-space: nowrap;
    flex-shrink: 0;
}
.logo em { color: var(--acc); font-style: normal; }

.nav-links {
    display: flex;
    gap: 2px;
    flex: 1;
}
.nav-links a {
    font-size: 13px;
    font-weight: 500;
    color: var(--fg2);
    padding: 6px 12px;
    border-radius: 6px;
    transition: all .15s;
}
.nav-links a:hover { color: var(--fg); background: var(--bg3); }
.nav-links a.on { color: var(--fg); background: var(--bg3); }

.nav-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(239, 68, 68, .12);
    color: var(--live);
    border: 1px solid rgba(239, 68, 68, .25);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
}

.ldot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: blink 1.2s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes blink { 0%, 100% { opacity: 1 } 50% { opacity: .2 } }

.theme-btn {
    background: var(--bg3);
    border: 1px solid var(--brd);
    color: var(--fg2);
    width: 32px; height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all .15s;
    display: flex; align-items: center; justify-content: center;
}
.theme-btn:hover { border-color: var(--acc); color: var(--acc); }

/* ── DATE NAVIGATION ─────────────────────────────────────────── */

.date-nav {
    display: flex;
    align-items: stretch;
    background: var(--bg2);
    border-bottom: 1px solid var(--brd);
    overflow: hidden;
}

.date-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    color: var(--fg3);
    font-size: 16px;
    border-right: 1px solid var(--brd);
    transition: all .15s;
    flex-shrink: 0;
    min-height: 56px;
}
.date-arrow:last-child { border-right: none; border-left: 1px solid var(--brd); }
.date-arrow:hover { background: var(--bg3); color: var(--fg); }

.date-strip {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1;
}
.date-strip::-webkit-scrollbar { display: none; }

.date-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    border-right: 1px solid var(--brd);
    min-width: 90px;
    transition: all .15s;
    gap: 2px;
}
.date-item:hover { background: var(--bg3); }
.date-item.active {
    background: var(--bg3);
    border-bottom: 2px solid var(--acc);
}

.di-day {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--fg2);
}
.date-item.active .di-day,
.date-item.is-today .di-day { color: var(--acc); }

.di-num {
    font-size: 12px;
    font-weight: 500;
    color: var(--fg3);
}
.date-item.active .di-num { color: var(--fg); }

/* ── LAYOUT ──────────────────────────────────────────────────── */

.page-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px 16px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    align-items: start;
}

@media (max-width: 1024px) {
    .page-wrap { grid-template-columns: 1fr; }
    .sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
}
@media (max-width: 640px) {
    .sidebar { grid-template-columns: 1fr; }
    .page-wrap { padding: 12px; }
    .date-item { min-width: 72px; padding: 8px 10px; }
}

/* ── LEAGUE TABS ─────────────────────────────────────────────── */

.league-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.ltab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .3px;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid var(--brd);
    background: var(--bg2);
    color: var(--fg2);
    cursor: pointer;
    transition: all .15s;
}
.ltab:hover { border-color: var(--brd2); color: var(--fg); }
.ltab.active {
    background: var(--acc);
    border-color: var(--acc);
    color: #fff;
}
.ltab-count {
    font-size: 10px;
    font-weight: 700;
    background: rgba(255,255,255,.2);
    border-radius: 3px;
    padding: 1px 5px;
    line-height: 1.4;
}
.ltab:not(.active) .ltab-count {
    background: var(--bg3);
    color: var(--fg3);
}

/* ── LEAGUE GROUP ────────────────────────────────────────────── */

.league-group {
    background: var(--bg2);
    border: 1px solid var(--brd);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
}

.lg-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg3);
    border-bottom: 1px solid var(--brd);
}
.lg-flag {
    width: 16px;
    height: 12px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
}
.lg-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}
.lg-name {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
    color: var(--fg2);
    flex: 1;
}
.lg-count {
    font-size: 10px;
    font-weight: 600;
    color: var(--fg3);
    background: var(--bg4);
    padding: 2px 7px;
    border-radius: 10px;
}

/* ── MATCH ROW ───────────────────────────────────────────────── */

.match-row {
    display: grid;
    grid-template-columns: 52px 1fr 68px 1fr;
    align-items: center;
    padding: 0 14px;
    min-height: 52px;
    border-bottom: 1px solid var(--brd);
    transition: background .1s;
    gap: 8px;
}
.match-row:last-of-type { border-bottom: none; }
.match-row:hover { background: var(--bg3); }
.match-row.is-live { background: rgba(239, 68, 68, .04); }
.match-row.is-live:hover { background: rgba(239, 68, 68, .08); }
.match-hidden { display: none !important; }

/* Time column */
.mr-time {
    display: flex;
    align-items: center;
    justify-content: center;
}
.t-live {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    color: var(--live);
    font-family: 'JetBrains Mono', monospace;
}
.t-ft {
    font-size: 11px;
    font-weight: 600;
    color: var(--fg3);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: .5px;
}
.t-ns {
    font-size: 12px;
    font-weight: 600;
    color: var(--fg2);
    font-family: 'JetBrains Mono', monospace;
}

/* Home / Away columns */
.mr-home {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    overflow: hidden;
    min-width: 0;
}
.mr-away {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    overflow: hidden;
    min-width: 0;
}
.mr-tname {
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--fg);
    min-width: 0;
}
.mr-logo {
    width: 22px;
    height: 22px;
    max-width: 22px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}
.mr-logo-ph {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: block;
}

/* Score column */
.mr-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}
.sc-n {
    font-size: 15px;
    font-weight: 700;
    color: var(--fg);
    min-width: 16px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
}
.sc-n.sc-live { color: var(--live); }
.sc-sep {
    color: var(--fg3);
    font-size: 14px;
    font-weight: 500;
}
.sc-vs {
    font-size: 10px;
    font-weight: 700;
    color: var(--fg3);
    letter-spacing: 1px;
    padding: 3px 7px;
    border: 1px solid var(--brd);
    border-radius: 3px;
}

/* Show more button */
.show-more-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: transparent;
    border: none;
    border-top: 1px solid var(--brd);
    color: var(--fg3);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    text-align: center;
}
.show-more-btn:hover { background: var(--bg3); color: var(--acc); }

/* ── NO MATCHES ──────────────────────────────────────────────── */

.no-matches {
    padding: 40px;
    text-align: center;
    color: var(--fg3);
    border: 1px dashed var(--brd);
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 12px;
}
.empty-state {
    padding: 16px;
    text-align: center;
    color: var(--fg3);
    font-size: 12px;
}

/* ── SIDEBAR ─────────────────────────────────────────────────── */

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 72px;
}

.scard {
    background: var(--bg2);
    border: 1px solid var(--brd);
    border-radius: 8px;
    overflow: hidden;
}

.scard-hd {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg3);
    border-bottom: 1px solid var(--brd);
}
.scard-hd h3 {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--fg);
}
.scard-sub {
    font-size: 10px;
    font-weight: 600;
    color: var(--fg3);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: .5px;
}

/* Standings table */
.st-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.st-table thead th {
    padding: 6px 8px;
    text-align: center;
    font-size: 9px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--fg3);
    font-weight: 700;
    background: var(--bg3);
    border-bottom: 1px solid var(--brd);
}
.st-table thead th:nth-child(2) { text-align: left; }
.st-table tbody td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--brd);
    text-align: center;
    font-size: 12px;
}
.st-table tbody tr:last-child td { border-bottom: none; }
.st-table tbody tr:hover { background: var(--bg3); }
.st-table tbody td:nth-child(2) { text-align: left; }

.st-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 11px;
    color: var(--fg3);
    font-weight: 600;
}
.zone-dot {
    width: 3px; height: 14px;
    border-radius: 2px;
    flex-shrink: 0;
}
.zone-cl { background: var(--blue); }
.zone-el { background: var(--yellow); }
.zone-rl { background: var(--live); }

.st-club {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}
.st-club img { flex-shrink: 0; }
.st-pts {
    font-weight: 700;
    color: var(--acc);
    font-size: 13px;
}
td.pos { color: var(--green); }
td.neg { color: var(--live); }

/* Scorers */
.scorer-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-bottom: 1px solid var(--brd);
    transition: background .1s;
}
.scorer-row:last-child { border-bottom: none; }
.scorer-row:hover { background: var(--bg3); }
.scorer-row.gold { background: linear-gradient(90deg, rgba(210,153,34,.06), transparent); }

.sc-rank {
    font-size: 13px;
    font-weight: 700;
    color: var(--fg3);
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}
.scorer-row.gold .sc-rank { color: var(--yellow); }

.sc-photo {
    width: 32px; height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg3);
    border: 2px solid var(--brd);
    flex-shrink: 0;
}
.scorer-row.gold .sc-photo { border-color: var(--yellow); }

.sc-info { flex: 1; min-width: 0; }
.sc-name {
    font-size: 12px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sc-club { font-size: 10px; color: var(--fg3); }
.sc-goals {
    font-size: 18px;
    font-weight: 800;
    color: var(--acc);
    min-width: 24px;
    text-align: right;
    flex-shrink: 0;
}

/* ── FOOTER ──────────────────────────────────────────────────── */

footer {
    background: var(--bg2);
    border-top: 1px solid var(--brd);
    margin-top: 40px;
    padding: 28px 24px;
}
.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--fg3);
}
.footer-inner .logo { font-size: 14px; }
.footer-links-row { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links-row a { color: var(--fg3); transition: color .15s; }
.footer-links-row a:hover { color: var(--acc); }
.api-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    padding: 4px 8px;
    border: 1px solid var(--brd);
    border-radius: 4px;
    background: var(--bg3);
    color: var(--fg3);
}
.api-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--acc);
    animation: blink 2s ease-in-out infinite;
}

@media (max-width: 640px) {
    footer { padding: 20px 16px; }
    .footer-inner { flex-direction: column; align-items: flex-start; }
    .topnav { gap: 12px; padding: 0 12px; }
    .nav-links a { padding: 6px 8px; font-size: 12px; }
    /* Match rows en mobile: ocultar columna tiempo, logos más pequeños */
    .match-row {
        grid-template-columns: 1fr 54px 1fr;
        padding: 0 10px;
        min-height: 46px;
        gap: 6px;
    }
    .mr-time { display: none; }
    .mr-logo { width: 18px; height: 18px; max-width: 18px; }
    .mr-tname { font-size: 12px; }
    .sc-n { font-size: 13px; }
}

/* ── Cookie consent banner ─────────────────────────────────── */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--bg2);
    border-top: 1px solid var(--brd2);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    box-shadow: 0 -4px 24px rgba(0,0,0,.35);
}
.cookie-text {
    flex: 1;
    font-size: 13px;
    color: var(--fg2);
    line-height: 1.6;
    min-width: 200px;
}
.cookie-link {
    color: var(--acc);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.cookie-link:hover { color: var(--acc2); }
.cookie-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}
.cookie-btn {
    border: none;
    border-radius: 6px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s;
}
.cookie-btn:hover { opacity: .85; }
.cookie-btn--accept {
    background: var(--acc);
    color: #0d1117;
}
.cookie-btn--decline {
    background: transparent;
    border: 1px solid var(--brd2);
    color: var(--fg2);
}
.cookie-btn--decline:hover {
    border-color: var(--fg2);
    color: var(--fg);
    opacity: 1;
}
@media (max-width: 640px) {
    .cookie-banner { padding: 14px 16px; gap: 12px; }
    .cookie-actions { width: 100%; }
    .cookie-btn { flex: 1; text-align: center; }
}
