/* ==================================================
   3NG - NATIONAL STATS
================================================== */

.national-stats-page {
    padding: 46px 0 56px;
    border-bottom: 1px solid var(--border-secondary);

    transition: opacity 0.12s ease;
}

.national-stats-page.is-loading {
    opacity: 0.68;
    pointer-events: none;
}


/* --------------------------------------------------
   HEADING / SEASON
-------------------------------------------------- */

.national-stats-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 28px;

    margin-bottom: 22px;
}

.national-stats-heading {
    margin-bottom: 0;
}

.national-stats-season-control {
    display: flex;
    flex-direction: column;

    gap: 7px;
}

.national-stats-season-control label {
    color: var(--text-secondary);

    font-size: 0.68rem;
    font-weight: 800;

    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.national-stats-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;
}


/* --------------------------------------------------
   FAMILY / CATEGORY NAVIGATION
-------------------------------------------------- */

.national-stats-family-nav,
.national-stats-category-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;

    gap: 0 28px;

    border-bottom: 1px solid var(--border-primary);
}

.national-stats-family-nav {
    margin-bottom: 24px;
}

.national-stats-family-nav a,
.national-stats-category-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-stats-family-nav a:hover,
.national-stats-category-nav a:hover,
.national-stats-family-nav a.is-active,
.national-stats-category-nav a.is-active {
    color: var(--text-primary);
}

.national-stats-family-nav a.is-active::after,
.national-stats-category-nav a.is-active::after {
    content: "";

    position: absolute;

    right: 0;
    bottom: -1px;
    left: 0;

    height: 3px;

    background: var(--3ng-crimson);
}


/* --------------------------------------------------
   SIDE CONTROL
-------------------------------------------------- */

.national-stats-side-control {
    width: min(100%, 440px);

    margin-bottom: 26px;

    padding: 16px 18px;

    background: var(--surface-primary);

    border: 1px solid var(--border-primary);
    border-top: 3px solid var(--3ng-crimson);
}

.national-stats-side-control__label {
    display: block;

    margin-bottom: 12px;

    color: var(--text-secondary);

    font-size: 0.68rem;
    font-weight: 800;

    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.national-stats-side-control__links {
    display: flex;
    flex-wrap: wrap;

    gap: 8px 24px;
}

.national-stats-side-control__links a {
    position: relative;

    padding-bottom: 7px;

    color: var(--text-secondary);

    font-size: 0.8rem;
    font-weight: 800;

    text-transform: uppercase;
}

.national-stats-side-control__links a:hover,
.national-stats-side-control__links a.is-active {
    color: var(--text-primary);
}

.national-stats-side-control__links a.is-active::after {
    content: "";

    position: absolute;

    right: 0;
    bottom: 0;
    left: 0;

    height: 2px;

    background: var(--3ng-crimson);
}


/* --------------------------------------------------
   CATEGORY
-------------------------------------------------- */

.national-stats-category-nav {
    margin-bottom: 34px;
}


/* --------------------------------------------------
   TABLE PANEL
-------------------------------------------------- */

.national-stats-panel {
    overflow: hidden;

    background: var(--surface-primary);

    border: 1px solid var(--border-primary);
}

.national-stats-panel__title {
    padding: 14px 18px;

    background: var(--surface-elevated);

    border-bottom: 1px solid var(--border-primary);

    color: var(--text-primary);

    font-size: 0.9rem;
    font-weight: 800;

    letter-spacing: 0.08em;

    text-align: center;
    text-transform: uppercase;
}


/* --------------------------------------------------
   TABLE
-------------------------------------------------- */

.national-stats-table-scroll {
    width: 100%;

    overflow-x: auto;

    scrollbar-width: thin;
}

.national-stats-table {
    width: 100%;

    min-width: 900px;

    border-collapse: collapse;

    font-variant-numeric: tabular-nums;
}

.national-stats-table th,
.national-stats-table td {
    padding: 13px 16px;

    border-right: 1px solid var(--border-secondary);
    border-bottom: 1px solid var(--border-secondary);

    text-align: right;

    white-space: nowrap;
}

.national-stats-table th:last-child,
.national-stats-table td:last-child {
    border-right: 0;
}

.national-stats-table tbody tr:last-child td {
    border-bottom: 0;
}


/* Alternating rows */

.national-stats-table tbody tr:nth-child(odd) td {
    background: var(--surface-primary);
}

.national-stats-table tbody tr:nth-child(even) td {
    background: rgba(0, 0, 0, 0.035);
}

[data-theme="dark"]
.national-stats-table
tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.035);
}


/* Headers */

.national-stats-table th {
    background: var(--3ng-navy);
    color: #ffffff;

    font-size: 0.68rem;
    font-weight: 800;

    letter-spacing: 0.05em;
    text-transform: uppercase;

    cursor: pointer;
    user-select: none;
}


/* Sticky Team column */

.national-stats-table th:first-child,
.national-stats-table td:first-child {
    position: sticky;

    left: 0;

    z-index: 2;

    text-align: left;
}

.national-stats-table th:first-child {
    z-index: 3;

    background: var(--3ng-navy);
}

.national-stats-table tbody tr:nth-child(odd) td:first-child {
    background: var(--surface-primary);
}

.national-stats-table tbody tr:nth-child(even) td:first-child {
    background: rgba(0, 0, 0, 0.035);
}

[data-theme="dark"]
.national-stats-table
tbody tr:nth-child(even) td:first-child {
    background: rgba(255, 255, 255, 0.035);
}


/* Data */

.national-stats-table td {
    color: var(--text-primary);

    font-size: 0.82rem;
    font-weight: 400;
}


/* Team */

.national-stats-table__team {
    font-weight: 700 !important;
}

.national-stats-table__team a {
    color: var(--text-primary);

    font-weight: 700;

    text-decoration: none;
}

.national-stats-table__team a:hover {
    text-decoration: underline;
}


/* Row hover */

.national-stats-table tbody tr:hover td,
.national-stats-table tbody tr:hover td:first-child {
    background: var(--surface-elevated);
}


/* --------------------------------------------------
   SORT INDICATOR
-------------------------------------------------- */

.national-stats-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-stats-empty-state {
    padding: 28px 20px;

    color: var(--text-secondary);

    font-size: 0.88rem;

    text-align: center;
}


/* --------------------------------------------------
   RESPONSIVE
-------------------------------------------------- */

@media (max-width: 850px) {

    .national-stats-toolbar {
        align-items: stretch;
        flex-direction: column;

        gap: 20px;
    }

    .national-stats-season-control {
        width: min(100%, 220px);
    }

    .national-stats-family-nav,
    .national-stats-category-nav {
        flex-wrap: nowrap;

        overflow-x: auto;

        gap: 0 22px;
    }

    .national-stats-family-nav a,
    .national-stats-category-nav a {
        min-width: max-content;

        flex-shrink: 0;
    }

}


@media (max-width: 600px) {

    .national-stats-page {
        padding-top: 32px;
    }

    .national-stats-side-control {
        padding: 14px;
    }

    .national-stats-table th,
    .national-stats-table td {
        padding-right: 12px;
        padding-left: 12px;
    }

}