/* Classifiche Imperium Series */

.is-leaderboard-section {
    background: linear-gradient(180deg, rgba(12, 6, 20, 0) 0%, rgba(12, 6, 20, 0.6) 100%);
}

.is-leaderboard-header {
    margin-bottom: 2.5rem;
}

.is-leaderboard-header .section-title .title {
    white-space: normal;
    line-height: 1.15;
}

.is-leaderboard-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.is-leaderboard-tabs {
    display: inline-flex;
    gap: 0.5rem;
    padding: 0.35rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.is-leaderboard-tab {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.65rem 1.25rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.is-leaderboard-tab.is-active,
.is-leaderboard-tab:hover {
    background: var(--bs-primary, #b8860b);
    color: #fff;
}

.is-leaderboard-search {
    flex: 1 1 260px;
    max-width: 360px;
    position: relative;
}

.is-leaderboard-search input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 0.95rem;
}

.is-leaderboard-search input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.is-leaderboard-search input:focus {
    outline: none;
    border-color: var(--bs-primary, #b8860b);
    box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.2);
}

.is-leaderboard-search::before {
    content: "⌕";
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.45);
    font-size: 1.1rem;
    pointer-events: none;
}

.is-leaderboard-meta {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 1rem;
}

.is-leaderboard-panel {
    display: none;
}

.is-leaderboard-panel.is-active {
    display: block;
}

.is-leaderboard-wrap {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.35);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.is-leaderboard-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.is-leaderboard-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    margin: 0;
}

.is-leaderboard-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #1a1228;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 1rem 0.85rem;
    text-align: left;
    border-bottom: 2px solid rgba(184, 134, 11, 0.5);
    white-space: nowrap;
}

.is-leaderboard-table tbody td {
    padding: 0.9rem 0.85rem;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    vertical-align: middle;
}

.is-leaderboard-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.04);
}

.is-leaderboard-table tbody tr.is-top-1 td {
    background: rgba(184, 134, 11, 0.12);
}

.is-leaderboard-table tbody tr.is-top-2 td,
.is-leaderboard-table tbody tr.is-top-3 td {
    background: rgba(184, 134, 11, 0.06);
}

.is-col-pos {
    width: 56px;
    text-align: center !important;
    font-weight: 800;
    color: var(--bs-primary, #d4a843) !important;
}

.is-col-atleta {
    min-width: 180px;
    font-weight: 600;
}

.is-col-punti {
    font-weight: 700;
    color: var(--bs-primary, #d4a843) !important;
}

.is-col-gare,
.is-col-cat {
    white-space: nowrap;
}

.is-col-team {
    min-width: 140px;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.is-col-actions {
    width: 48px;
    text-align: center !important;
}

.is-expand-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    transition: background 0.2s, transform 0.2s;
}

.is-expand-btn:hover,
.is-expand-btn[aria-expanded="true"] {
    background: rgba(184, 134, 11, 0.25);
    border-color: rgba(184, 134, 11, 0.5);
}

.is-expand-btn[aria-expanded="true"] {
    transform: rotate(45deg);
}

.is-detail-row td {
    padding: 0 !important;
    background: rgba(0, 0, 0, 0.45) !important;
    border-bottom: 1px solid rgba(184, 134, 11, 0.2);
}

.is-detail-inner {
    padding: 1rem 1.25rem 1.25rem;
}

.is-detail-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 0.75rem;
}

.is-race-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.65rem;
}

.is-race-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
}

.is-race-card__label {
    display: block;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.2rem;
    line-height: 1.3;
}

.is-race-card__value {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.is-race-card__value.is-empty {
    color: rgba(255, 255, 255, 0.25);
}

.is-leaderboard-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: rgba(255, 255, 255, 0.55);
}

.is-leaderboard-hint {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 0.75rem;
}

@media (max-width: 767px) {
    .is-leaderboard-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .is-leaderboard-search {
        max-width: none;
    }

    .is-leaderboard-tabs {
        width: 100%;
        justify-content: center;
    }

    .is-race-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
