/* ==================================================
   3NG - NATIONAL RANKINGS
================================================== */

.national-rankings-page {
    padding: 46px 0 56px;
    border-bottom: 1px solid var(--border-secondary);
    transition: opacity 0.12s ease;
}

.national-rankings-page.is-loading {
    opacity: 0.68;
    pointer-events: none;
}


/* --------------------------------------------------
   HEADING / SEASON
-------------------------------------------------- */

.national-rankings-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 28px;
}

.national-rankings-heading {
    margin-bottom: 0;
}

.national-rankings-season-control {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.national-rankings-season-control label {
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.national-rankings-season-control select {
    min-width: 130px;
    padding: 10px 34px 10px 12px;
    background: var(--surface-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}


/* --------------------------------------------------
   NAVIGATION
-------------------------------------------------- */

.national-rankings-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0 28px;
    margin-bottom: 34px;
    border-bottom: 1px solid var(--border-primary);
}

.national-rankings-nav a {
    position: relative;
    min-height: 54px;
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.national-rankings-nav a:hover,
.national-rankings-nav a.is-active {
    color: var(--text-primary);
}

.national-rankings-nav a.is-active::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 3px;
    background: var(--3ng-crimson);
}


/* --------------------------------------------------
   PANEL
-------------------------------------------------- */

.national-rankings-panel {
    width: 100%;
}

.national-rankings-table-wrap {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
}

.national-rankings-panel__title {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface-elevated);
    border: 1px solid var(--border-primary);
    border-bottom: 0;
    box-sizing: border-box;
}

.national-rankings-panel__title h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
}

.national-rankings-panel__week {
    margin-left: 8px;
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}


/* --------------------------------------------------
   TABLE
-------------------------------------------------- */

.national-rankings-table-scroll {
    width: auto;
    max-width: 100%;
    overflow-x: auto;
}

.national-rankings-table {
    width: auto;
    min-width: 720px;
    margin: 0;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.national-rankings-table--conference {
    min-width: 700px;
}

.national-rankings-table th,
.national-rankings-table td {
    padding: 14px 18px;
    border-right: 1px solid var(--border-secondary);
    border-bottom: 1px solid var(--border-secondary);
    text-align: right;
    white-space: nowrap;
}

.national-rankings-table th:first-child,
.national-rankings-table td:first-child {
    border-left: 1px solid var(--border-secondary);
}

.national-rankings-table th:last-child,
.national-rankings-table td:last-child {
    border-right: 1px solid var(--border-secondary);
}

.national-rankings-table tbody tr:nth-child(odd) td {
    background: var(--surface-primary);
}

.national-rankings-table tbody tr:nth-child(even) td {
    background: rgba(0, 0, 0, 0.035);
}

[data-theme="dark"]
.national-rankings-table tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.035);
}

.national-rankings-table th {
    background: var(--surface-elevated);
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    user-select: none;
}

.national-rankings-table th:hover,
.national-rankings-table th.is-sorted {
    color: var(--text-primary);
}

.national-rankings-table td {
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 400;
}


/* Rank */

.national-rankings-table th:nth-child(1),
.national-rankings-table td:nth-child(1) {
    width: 80px;
    text-align: center;
}


/* Team / Conference name */

.national-rankings-table--team th:nth-child(2),
.national-rankings-table--team td:nth-child(2),
.national-rankings-table--conference th:nth-child(2),
.national-rankings-table--conference td:nth-child(2) {
    min-width: 210px;
    text-align: left;
}

.national-rankings-table td:nth-child(2) {
    font-weight: 700;
}

.national-rankings-table td:nth-child(2) a {
    color: var(--text-primary);
    font-weight: 700;
    text-decoration: none;
}

.national-rankings-table td:nth-child(2) a:hover {
    text-decoration: underline;
}


/* Team conference */

.national-rankings-table--team th:nth-child(3),
.national-rankings-table--team td:nth-child(3) {
    min-width: 140px;
    text-align: left;
}


/* Record */

.national-rankings-table--team th:nth-child(4),
.national-rankings-table--team td:nth-child(4),
.national-rankings-table--conference th:nth-child(4),
.national-rankings-table--conference td:nth-child(4) {
    min-width: 120px;
    text-align: center;
}


/* Rating */

.national-rankings-table--team th:nth-child(5),
.national-rankings-table--team td:nth-child(5),
.national-rankings-table--conference th:nth-child(3),
.national-rankings-table--conference td:nth-child(3),
.national-rankings-table--conference th:nth-child(5),
.national-rankings-table--conference td:nth-child(5) {
    min-width: 110px;
    text-align: right;
}


/* Hover */

.national-rankings-table tbody tr:hover td {
    background: var(--surface-elevated);
}


/* --------------------------------------------------
   SORT INDICATOR
-------------------------------------------------- */

.national-rankings-sort-indicator {
    display: inline-block;
    margin-left: 4px;
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1;
    vertical-align: baseline;
}


/* --------------------------------------------------
   EMPTY STATE
-------------------------------------------------- */

.national-rankings-empty-state {
    padding: 28px 20px;
    color: var(--text-secondary);
    font-size: 0.88rem;
    text-align: center;
    border: 1px solid var(--border-primary);
    background: var(--surface-primary);
}


/* --------------------------------------------------
   RESPONSIVE
-------------------------------------------------- */

@media (max-width: 900px) {

    .national-rankings-nav {
        gap: 0 22px;
    }

}

@media (max-width: 700px) {

    .national-rankings-page {
        padding-top: 32px;
        padding-bottom: 48px;
    }

    .national-rankings-toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 20px;
    }

    .national-rankings-season-control {
        width: min(100%, 220px);
    }

    .national-rankings-nav {
        flex-wrap: nowrap;
        gap: 0 18px;
        overflow-x: auto;
    }

    .national-rankings-nav a {
        min-width: max-content;
        min-height: 48px;
        flex-shrink: 0;
        font-size: 0.72rem;
    }

    .national-rankings-table th,
    .national-rankings-table td {
        padding: 13px 12px;
    }

}
