/* ============================================================================
   LEADERBOARD OVERLAY - Territory Rankings (Modern Style)
   ============================================================================ */

.leaderboard-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.leaderboard-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.leaderboard-container {
    background: linear-gradient(0deg, rgba(0, 0, 0,.3) 10%, #171a1f 40%), #171a1f;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .5);
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.4s ease;
    color: #e4e4e4;
}

@keyframes slideIn {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 40px;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-header h2 {
    margin: 0;
    color: #d8d8d8;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-transform: uppercase;
}

.leaderboard-header h2 i {
    color: #feae00;
    font-size: 28px;
}

.close-leaderboard-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d8d8d8;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-leaderboard-btn:hover {
    color: rgba(184, 33, 33, 0.5);
}

/* ============================================================================
   LOADING & NO REFERENCE STATES
   ============================================================================ */

.leaderboard-loading,
.leaderboard-no-reference {
    padding: 60px 40px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

.leaderboard-loading i {
    font-size: 3rem;
    color: #feae00;
    margin-bottom: 20px;
}

.leaderboard-loading p {
    font-size: 1.1rem;
    margin: 0;
}

.leaderboard-no-reference i {
    font-size: 4rem;
    color: #ff9500;
    margin-bottom: 20px;
}

.leaderboard-no-reference h3 {
    color: #d8d8d8;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.leaderboard-no-reference p {
    font-size: 1rem;
    margin: 0;
}

/* ============================================================================
   LEADERBOARD CONTENT
   ============================================================================ */

.leaderboard-content {
    overflow-y: auto;
    padding: 30px 40px;
    flex: 1;
}


/* ============================================================================
   PODIUM - TOP 3
   ============================================================================ */

.podium-section {
    margin-top: -40px;
    padding-bottom: 40px;
}

.podium-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: flex-end;
    padding: 10px 0;
}

.podium-card {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 25px 20px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    min-width: 200px;
}

.podium-gold {
    order: 2;
}

.podium-silver {
    order: 1;
}

.podium-bronze {
    order: 3;
}

.trophy-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.rank-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #feae00;
    color: #1b1e24;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    border: 3px solid #171a1f;
    box-shadow: 0 4px 12px rgba(254, 174, 0, 0.4);
}

.group-name {
    color: #d8d8d8;
    font-size: 1.6rem;
    font-weight: 700;
    margin: 5px 0;
}

.group-percentage {
    color: #feae00;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 5px 0;
}

.group-regions {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin-top: 5px;
}

/* ============================================================================
   RANKINGS LIST
   ============================================================================ */

.rankings-section {
    margin-top: 30px;
}

.rankings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ranking-item {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 18px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.ranking-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(254, 174, 0, 0.3);
    transform: translateX(5px);
}

.ranking-position {
    font-size: 1.3rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    min-width: 35px;
    text-align: center;
}

.ranking-group-name {
    flex: 1;
    color: #d8d8d8;
    font-size: 1.1rem;
    font-weight: 600;
}

.ranking-stats {
    display: flex;
    align-items: center;
    gap: 20px;
}

.ranking-percentage {
    color: #feae00;
    font-size: 1.5rem;
    font-weight: 700;
    min-width: 70px;
    text-align: right;
}

.ranking-regions {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    white-space: nowrap;
}

/* ============================================================================
   BOTTOM BAR BUTTON STYLING
   ============================================================================ */

.filter-btn.leaderboard-btn {
    /* margin-left: 20px;
    border-left: 2px solid rgba(254, 174, 0, 0.3);
    padding-left: 20px; */
}

/* ============================================================================
   SCROLLBAR
   ============================================================================ */

.leaderboard-content::-webkit-scrollbar {
    width: 8px;
}

.leaderboard-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.leaderboard-content::-webkit-scrollbar-thumb {
    background: rgba(254, 174, 0, 0.5);
    border-radius: 10px;
}

.leaderboard-content::-webkit-scrollbar-thumb:hover {
    background: rgba(254, 174, 0, 0.7);
}

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

@media (max-width: 768px) {
    .leaderboard-container {
        width: 95%;
        max-height: 95vh;
    }

    .leaderboard-header {
        padding: 20px;
    }

    .leaderboard-content {
        padding: 20px;
    }

    .podium-container {
        flex-direction: column;
        align-items: stretch;
    }

    .podium-card {
        order: unset !important;
    }

    .ranking-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}
