:root {

    /* Backgrounds */
    --bg-main: #0f172a;
    --bg-nav: #111827;
    --bg-card: #1e293b;
    --bg-subtle: #0b1220;

    /* Borders */
    --border: #334155;

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    /* Accent */
    --accent: #38bdf8;

    /* Misc */
    --divider: #475569;
}

html.light-theme,
.light-theme {

    /* Backgrounds */
    --bg-main: #f8fafc;
    --bg-nav: #ffffff;
    --bg-card: #ffffff;
    --bg-subtle: #f1f5f9;

    /* Borders */
    --border: #e2e8f0;

    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    /* Accent */
    --accent: #0284c7;

    /* Misc */
    --divider: #94a3b8;
}

html {
    background: var(--bg-main);
    color: var(--text-primary);
}

body {
    margin: 0;
    background: var(--bg-main);
    color: var(--text-primary);
    font-family: Inter, Arial, sans-serif;
}

.top-nav {
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
    background: var(--bg-nav);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}


.nav-left {
    flex: 1;
}

.site-logo {
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.nav-center {
    flex: 2;
    display: flex;
    justify-content: center;
    gap: 60px;
}

.nav-item a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: 0.2s ease;
}

.nav-item a:hover {
    color: var(--text-primary);
}

.insights-link a {
    color: var(--accent);
    font-weight: 600;
}
.nav-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.theme-toggle,
.search-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
    color: white;
    transition: 0.2s ease;
}

.theme-toggle:hover,
.search-btn:hover {
    background: rgba(255,255,255,0.08);
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 18px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 220px;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px;
    opacity: 0;
    visibility: hidden;
    transition: 0.2s ease;
    box-shadow:
        0 10px 25px rgba(0,0,0,.15);
}
.dropdown-menu a {
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: 0.2s ease;
}
.dropdown-menu a:hover {
    background: var(--bg-subtle);
    color: var(--text-primary);
}
.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
}
.dropdown-arrow {
    font-size: 0.75rem;
    margin-left: 4px;
    opacity: .7;
}

.league-status {
    height: 42px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
}
.status-divider {
    color: var(--divider);
}
.status-item {
    font-weight: 500;
    white-space: nowrap;
}
.page-container {
    width: 100%; 
    max-width: 1800px;
    margin: 0 auto;
    padding: 24px clamp(16px, 3vw, 32px);
}

.page-header { margin-bottom: 20px; }
.page-header h1 { margin: 0 0 4px; font-size: 1.6rem; font-weight: 700; }
.page-header p { margin: 0; color: var(--text-muted); font-size: 0.9rem; }

.filter-bar { display: flex; gap: 16px; margin-bottom: 20px; align-items: flex-end; }
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group label { font-size: 0.68rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }
.filter-select { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); border-radius: 6px; padding: 8px 14px; }
.filter-btn { padding: 8px 16px; background: var(--accent); color: #fff; border: none; border-radius: 6px; font-weight: 700; cursor: pointer; }

.stats-table-wrap { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; overflow-x: auto; }
.full-stats-table { min-width: 700px; }
.table-link { color: var(--text-primary); text-decoration: none; font-weight: 600; }
.table-link:hover { color: var(--accent); }
.muted-link { color: var(--text-secondary); font-weight: 500; }
.pos-diff { color: #22c55e; font-weight: 700; }
.neg-diff { color: #ef4444; font-weight: 700; }

.results-count {
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
}

.pagination-container button {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
}

.pagination-container button:hover:not(:disabled) {
    background: var(--bg-subtle);
}

.pagination-container button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#pageInfo {
    color: var(--text-muted);
    font-size: 0.9rem;
}
