* {
    box-sizing: border-box;
}

:root {
    --bg-dark: #0b0f17;
    --bg-soft: #111827;
    --panel: #ffffff;
    --panel-dark: #161b25;
    --panel-dark-2: #1f2530;
    --border: #d8e0ec;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f3f6fb;
    color: var(--text);
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

.classification-page {
    min-height: 100vh;
}

.classification-hero {
    min-height: 430px;
    background-size: cover;
    background-position: center;
    color: #fff;
}

.classification-hero__inner {
    max-width: 1380px;
    margin: 0 auto;
    padding: 74px 24px 62px;
}

.classification-hero__content {
    max-width: 760px;
}

.classification-badge {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .04em;
    backdrop-filter: blur(8px);
}

.classification-hero h1 {
    margin: 18px 0 10px;
    font-size: 54px;
    line-height: 1.04;
}

.classification-hero__meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 18px;
    font-size: 15px;
    color: rgba(255,255,255,.88);
}

.classification-hero__lead {
    margin: 0;
    font-size: 18px;
    line-height: 1.65;
    color: rgba(255,255,255,.92);
}

.classification-main {
    position: relative;
    z-index: 2;
    max-width: 1380px;
    margin: -56px auto 0;
    padding: 0 24px 42px;
}

.classification-stats-panel,
.sidebar-card,
.classification-table-panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}

.classification-stats-panel {
    padding: 24px;
    margin-bottom: 24px;
}

.panel-kicker,
.athlete-card-kicker {
    margin: 0 0 8px;
    color: var(--primary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700;
}

.panel-head h2,
.table-panel-head h2 {
    margin: 0 0 10px;
    font-size: 30px;
}

.panel-lead {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.stats-search {
    display: flex;
    gap: 12px;
    margin-top: 22px;
    flex-wrap: wrap;
}

.stats-search input,
.table-search-box input {
    flex: 1 1 280px;
    min-height: 52px;
    border-radius: 14px;
    border: 1px solid #cbd5e1;
    padding: 0 16px;
    font-size: 15px;
    outline: none;
    background: #fff;
}

.stats-search input:focus,
.table-search-box input:focus {
    border-color: var(--primary);
}

.stats-search button {
    min-height: 52px;
    padding: 0 22px;
    border: 0;
    border-radius: 14px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.stats-search button:hover {
    background: var(--primary-dark);
}

.athlete-stats-card {
    margin-top: 24px;
    border-radius: 22px;
    padding: 26px;
    background: linear-gradient(180deg, #1e2637 0%, #162033 100%);
    color: #ffffff;
    border: 1px solid rgba(255,255,255,.06);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
}

.athlete-stats-card__empty {
    color: rgba(255,255,255,.72);
}

.athlete-stats-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.athlete-title-block h3 {
    margin: 0 0 8px;
    font-size: 34px;
    line-height: 1.08;
}

.athlete-title-block p {
    margin: 0;
    color: rgba(255,255,255,.78);
}

.athlete-bib-badge {
    min-width: 84px;
    min-height: 84px;
    padding: 12px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    font-size: 28px;
    font-weight: 800;
    color: #fff;
}

.athlete-card-grid {
    display: grid;
    gap: 14px;
    margin-bottom: 16px;
}

.athlete-card-grid--top {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.athlete-card-grid--times,
.athlete-card-grid--final {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.athlete-card-grid--positions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-box {
    background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.025));
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 18px;
    padding: 18px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

.stat-box--wide {
    min-height: 110px;
}

.stat-box--full {
    margin-bottom: 16px;
}

.stat-box span {
    display: block;
    color: rgba(255,255,255,.8);
    font-size: 14px;
    margin-bottom: 10px;
    font-weight: 700;
}

.stat-box strong {
    display: block;
    font-size: 20px;
    line-height: 1.3;
    font-weight: 500;
}

.athlete-performance-card {
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
    border: 1px solid rgba(255,255,255,.08);
}

.athlete-performance-card__title {
    font-size: 15px;
    line-height: 1.5;
    color: rgba(255,255,255,.88);
    margin-bottom: 14px;
}

.performance-bar {
    width: 100%;
    height: 28px;
    border-radius: 999px;
    background: rgba(255,255,255,.1);
    overflow: hidden;
}

.performance-bar__fill {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    padding-right: 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, #ff7b00 0%, #ff9500 55%, #d9480f 100%);
    color: #fff;
    font-weight: 800;
    transition: width .35s ease;
}

.classification-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 24px;
    align-items: start;
}

.classification-sidebar {
    position: sticky;
    top: 22px;
}

.sidebar-card {
    padding: 22px;
}

.sidebar-card h3 {
    margin: 0 0 18px;
    font-size: 24px;
}

.classification-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nav-distance {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
}

.nav-distance__button,
.nav-group__button,
.nav-table-link {
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
}

.nav-distance__button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
    padding: 0 16px;
    font-weight: 800;
    color: #0f172a;
    background: #f8fafc;
}

.nav-distance__groups {
    display: none;
    padding: 12px;
}

.nav-distance.is-open .nav-distance__groups {
    display: block;
}

.nav-group + .nav-group {
    margin-top: 8px;
}

.nav-group__button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 46px;
    padding: 0 14px;
    border-radius: 12px;
    font-weight: 700;
    color: #1e293b;
    background: #f8fafc;
}

.nav-group__items {
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 8px 0 4px 10px;
}

.nav-group.is-open .nav-group__items {
    display: flex;
}

.nav-table-link {
    display: block;
    width: 100%;
    min-height: 40px;
    border-radius: 10px;
    padding: 10px 12px;
    color: #475569;
    line-height: 1.35;
    white-space: normal;
    text-decoration: none;
}

.nav-table-link:hover,
.nav-table-link.is-active {
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 700;
}

.nav-table-link--single {
    margin-top: 4px;
}

.nav-arrow {
    color: #64748b;
}

.classification-table-panel {
    position: relative;
    padding: 24px;
}


.classification-table-panel.has-right-fade::after {
    content: "";
    position: absolute;
    top: 0;
    right: 24px;
    bottom: 24px;
    width: 40px;
    pointer-events: none;
    z-index: 5;
    border-bottom-right-radius: 18px;
    background: linear-gradient(90deg, rgba(230,237,247,0) 0%, rgba(230,237,247,0.98) 100%);
    opacity: 1;
    transition: opacity .2s ease;
}

.classification-table-panel.fade-hidden::after {
    opacity: 0;
}

.table-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.classification-table-wrap {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: auto;
    touch-action: pan-y pinch-zoom;
    border-radius: 18px;
    border: 1px solid #dbe3ef;
    background: linear-gradient(180deg, #eef3fa 0%, #e6edf7 100%);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
    cursor: grab;
    scrollbar-width: thin;
    scrollbar-color: rgba(100,116,139,.55) rgba(226,232,240,.65);
}

.classification-table-wrap.is-dragging {
    cursor: grabbing;
    user-select: none;
}

.classification-table-wrap::-webkit-scrollbar {
    height: 10px;
}

.classification-table-wrap::-webkit-scrollbar-track {
    background: rgba(226,232,240,.75);
    border-radius: 999px;
}

.classification-table-wrap::-webkit-scrollbar-thumb {
    background: rgba(100,116,139,.55);
    border-radius: 999px;
}

.classification-table-wrap:active {
    cursor: grabbing;
}

.classification-table-wrap::before {
    content: "Deslizá la tabla hacia los costados";
    display: none;
}


.classification-table {
    width: max-content;
    min-width: 980px;
    border-collapse: collapse;
    color: #fff;
}

.classification-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: linear-gradient(180deg, #3d3f46 0%, #262830 100%);
    color: #fff;
    padding: 16px 12px;
    text-align: left;
    font-size: 14px;
    font-weight: 800;
    border-right: 1px solid rgba(255,255,255,.08);
}

.classification-table tbody td {
    padding: 14px 12px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    color: #0f172a;
    font-size: 15px;
}

.classification-table tbody tr {
    background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
}

.classification-table tbody tr:nth-child(even):not(.podium-gold):not(.podium-silver):not(.podium-bronze) {
    background: linear-gradient(180deg, #edf3fb 0%, #e5edf8 100%);
}

.classification-table tbody tr:hover:not(.podium-gold):not(.podium-silver):not(.podium-bronze) {
    background: linear-gradient(180deg, #e3edf9 0%, #dbe7f6 100%);
}

.classification-table tbody tr.podium-gold {
    background: linear-gradient(180deg, #f7d76e 0%, #b8860b 100%);
}

.classification-table tbody tr.podium-gold td {
    color: #fff;
    font-weight: 700;
}

.classification-table tbody tr.podium-silver {
    background: linear-gradient(180deg, #d7dce3 0%, #7d8694 100%);
}

.classification-table tbody tr.podium-silver td {
    color: #fff;
    font-weight: 700;
}

.classification-table tbody tr.podium-bronze {
    background: linear-gradient(180deg, #cf7a4e 0%, #8a3b17 100%);
}

.classification-table tbody tr.podium-bronze td {
    color: #fff;
    font-weight: 700;
}

@media (max-width: 1100px) {
    .classification-layout {
        grid-template-columns: 1fr;
    }

    .classification-sidebar {
        position: static;
    }

    .athlete-card-grid--top {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .athlete-card-grid--times {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .athlete-card-grid--positions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .athlete-card-grid--final {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .classification-hero {
        min-height: 320px;
    }

    .classification-hero__inner {
        padding: 44px 16px 48px;
    }

    .classification-main {
        margin-top: -28px;
        padding: 0 14px 24px;
    }

    .classification-hero h1 {
        font-size: 34px;
    }

    .panel-head h2,
    .table-panel-head h2 {
        font-size: 22px;
    }

    .classification-stats-panel,
    .classification-table-panel,
    .sidebar-card {
        padding: 18px;
        border-radius: 22px;
    }

    .athlete-stats-card {
        padding: 18px;
    }

    .athlete-stats-card__top {
        gap: 14px;
        margin-bottom: 16px;
    }

    .athlete-title-block h3 {
        font-size: 24px;
    }

    .athlete-bib-badge {
        min-width: 64px;
        min-height: 64px;
        font-size: 22px;
        border-radius: 20px;
    }

    .athlete-card-grid {
        gap: 10px;
        margin-bottom: 10px;
    }

    .athlete-card-grid--top {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .athlete-card-grid--times {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .athlete-card-grid--positions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .athlete-card-grid--positions.is-participative {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .athlete-card-grid--final {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stat-box {
        padding: 12px;
        border-radius: 14px;
    }

    .stat-box span {
        font-size: 11px;
        margin-bottom: 6px;
    }

    .stat-box strong {
        font-size: 15px;
        line-height: 1.25;
    }

    .stat-box--wide {
        min-height: auto;
    }

    .athlete-performance-card {
        padding: 14px;
    }

    .athlete-performance-card__title {
        font-size: 13px;
        line-height: 1.4;
    }

    .performance-bar {
        height: 24px;
    }

    .table-panel-head {
        gap: 14px;
    }

    .table-search-box {
        width: 100%;
    }

    .table-search-box input {
        width: 100%;
    }

    .classification-table-panel {
        overflow: hidden;
    }
    
    .classification-table-panel.has-right-fade::after {
        right: 18px;
        top: 132px;
        bottom: 18px;
        width: 36px;
    }

    .classification-table-wrap {
        width: 100%;
        max-width: 100%;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y pinch-zoom;
        overscroll-behavior-x: contain;
        overscroll-behavior-y: auto;
        cursor: grab;
    }

    .classification-table-wrap::before {
        content: "Deslizá la tabla hacia los costados";
        display: block;
        padding: 8px 12px 0;
        font-size: 11px;
        font-weight: 700;
        color: #64748b;
        background: transparent;
    }

    

    .classification-table {
        width: max-content;
        min-width: 1180px;
    }

    .classification-table thead th,
    .classification-table tbody td {
        padding: 10px 8px;
        font-size: 13px;
        white-space: nowrap;
    }
}


@media (max-width: 480px) {
    .athlete-card-grid--top {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .athlete-card-grid--times {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .athlete-card-grid--positions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .athlete-card-grid--positions.is-participative {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .athlete-card-grid--final {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stat-box span {
        font-size: 10px;
    }

    .stat-box strong {
        font-size: 14px;
    }
}

#classificationTableSection {
    scroll-margin-top: 24px;
}

