/* =========================
   GLOBAL
========================= */

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

body {
    font-family: 'Inter', sans-serif;
    background: #f5f7fb;
    color: #111827;
    line-height: 1.5;
}

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

/* =========================
   HEADER
========================= */

.site-header {
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid #dbe2ea;
    padding: 18px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-box {
    width: 62px;
    height: 62px;
    border: 2px solid #ffffff;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    overflow: hidden;
    flex-shrink: 0;
}

.site-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.brand-text {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.main-nav a {
    padding: 11px 16px;
    border: 1.5px solid #cbd5e1;
    border-radius: 14px;
    background: #ffffff;
    font-weight: 600;
    color: #111827;
    transition: 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
    background: #111827;
    color: #ffffff;
    border-color: #111827;
}

/* =========================
   PAGE LAYOUT
========================= */

.standings-shell {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 24px 40px;
}

.standings-page-header {
    background: #ffffff;
    border: 1px solid #dbe2ea;
    border-radius: 24px;
    padding: 28px 30px;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.standings-page-header h1 {
    font-size: 2.2rem;
    line-height: 1.1;
    margin-bottom: 10px;
    color: #0f172a;
}

.standings-page-header p {
    color: #475569;
    font-size: 1rem;
    max-width: 780px;
}

/* =========================
   MAIN SECTION
========================= */

#standings {
    background: #ffffff;
    border: 1px solid #dbe2ea;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

#standings h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 18px;
}

/* =========================
   CONTROLS
========================= */

#standings-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 22px;
}

#standings-controls button {
    appearance: none;
    border: 1.5px solid #cbd5e1;
    background: #f8fafc;
    color: #111827;
    padding: 12px 18px;
    border-radius: 14px;
    font-family: inherit;
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

#standings-controls button:hover {
    background: #e2e8f0;
}

#standings-controls button.active {
    background: #111827;
    color: #ffffff;
    border-color: #111827;
}

/* =========================
   STANDINGS CONTENT AREA
========================= */

#standingsContent {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* =========================
   DYNAMIC TABLE/CARD STYLES
   These are meant to catch the tables your JS injects
========================= */

.standings-group,
.division-block,
.standings-table-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 18px;
}

.standings-group h3,
.division-block h3,
.standings-table-card h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 14px;
}

#standingsContent table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 16px;
    background: #ffffff;
}

#standingsContent thead {
    background: #111827;
    color: #ffffff;
}

#standingsContent th {
    text-align: left;
    padding: 14px 16px;
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

#standingsContent td {
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
    color: #334155;
    font-weight: 600;
    vertical-align: middle;
}

#standingsContent tbody tr:last-child td {
    border-bottom: none;
}

#standingsContent tbody tr:nth-child(even) {
    background: #f8fafc;
}

#standingsContent tbody tr:hover {
    background: #eef2f7;
}

/* =========================
   TEAM / RECORD HELPERS
========================= */

.team-pill,
.standings-team-pill {
    --team-bg: #e5e7eb;
    --team-text: #111827;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--team-bg);
    color: var(--team-text);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
    border: 1px solid rgba(15, 23, 42, 0.08);
    white-space: nowrap;
    max-width: 100%;
}

.rank-cell,
.winpct-cell,
.record-cell {
    font-weight: 800;
    color: #0f172a;
}

.games-behind-card {
    margin-top: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 18px;
}

.games-behind-card h3 {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 14px;
    color: #0f172a;
}

/* =========================
   OPTIONAL PLAYOFF BUTTON
========================= */

.btn-playoff {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
    padding: 14px 20px;
    border-radius: 16px;
    font-weight: 700;
    background: #111827;
    color: #ffffff;
    transition: 0.2s ease;
}

.btn-playoff:hover {
    background: #1f2937;
}

/* =========================
   FOOTER
========================= */

.site-footer {
    padding: 24px;
    text-align: center;
    color: #64748b;
    font-size: 0.95rem;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1100px) {
    .site-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-nav {
        width: 100%;
    }
}

@media (max-width: 800px) {
    .standings-shell {
        padding: 20px 16px 32px;
    }

    .standings-page-header {
        padding: 22px 20px;
    }

    .standings-page-header h1 {
        font-size: 1.8rem;
    }

    #standings {
        padding: 18px;
    }

    #standingsContent {
        overflow-x: auto;
    }

    #standingsContent table {
        min-width: 700px;
    }
}

@media (max-width: 700px) {
    .site-header {
        padding: 18px 20px;
    }

    .brand-text {
        font-size: 1.25rem;
        line-height: 1.2;
    }

    .main-nav a {
        padding: 10px 14px;
        font-size: 0.95rem;
    }

    #standings-controls {
        flex-direction: column;
        align-items: stretch;
    }

    #standings-controls button {
        width: 100%;
    }
}