/* Leaderboard Page Styles */
.page-leaderboard {
    min-height: calc(100vh - 4rem);
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background-color: var(--color-background);
    color: var(--color-on-background);
    font-family: "Lexend Deca", sans-serif;
    grid-column: 1 / -1;
    width: 100%;
    box-sizing: border-box;
}

.leaderboard-container {
    background: linear-gradient(145deg, rgba(39, 38, 44, 0.95), rgba(28, 27, 31, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    box-sizing: border-box;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.leaderboard-header {
    text-align: center;
    margin-bottom: 2rem;
}

.leaderboard-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #fff;
}

.leaderboard-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
}

/* Podium Styles */
.podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem 0 2rem;
}

.podium-place {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    min-width: 140px;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.podium-place:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.podium-place.first {
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.05) 100%);
    border-color: rgba(255, 215, 0, 0.3);
    min-height: 200px;
    order: 2;
}

.podium-place.second {
    background: linear-gradient(180deg, rgba(192, 192, 192, 0.12) 0%, rgba(192, 192, 192, 0.04) 100%);
    border-color: rgba(192, 192, 192, 0.25);
    min-height: 170px;
    order: 1;
}

.podium-place.third {
    background: linear-gradient(180deg, rgba(205, 127, 50, 0.12) 0%, rgba(205, 127, 50, 0.04) 100%);
    border-color: rgba(205, 127, 50, 0.25);
    min-height: 150px;
    order: 3;
}

.podium-crown {
    position: absolute;
    top: -30px;
    font-size: 2rem;
    animation: float 2s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.podium-avatar {
    margin-bottom: 0.75rem;
}

.podium-flag {
    width: 48px;
    height: 32px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.podium-flag-universal {
    font-size: 2rem;
}

.podium-rank {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.podium-place.first .podium-rank { color: #ffd700; }
.podium-place.second .podium-rank { color: #c0c0c0; }
.podium-place.third .podium-rank { color: #cd7f32; }

.podium-name {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.25rem;
    text-align: center;
    word-break: break-word;
}

.podium-points {
    font-size: 1.25rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
}

.podium-completions {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.25rem;
}

/* Leaderboard Table */
.leaderboard-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.leaderboard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.leaderboard-table thead {
    background: rgba(0, 0, 0, 0.2);
}

.leaderboard-table th {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-table th:first-child { border-radius: 8px 0 0 0; }
.leaderboard-table th:last-child { border-radius: 0 8px 0 0; }

.leaderboard-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: middle;
    font-size: 0.9rem;
}

.leaderboard-table tbody tr {
    transition: background 0.2s ease;
}

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

.rank-col { width: 80px; }
.flag-col { width: 60px; }
.points-col { width: 100px; text-align: right; }
.completions-col { width: 80px; text-align: right; }

.rank-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
}

.table-flag {
    width: 28px;
    height: 19px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.table-flag-universal {
    font-size: 1.25rem;
}

.page-leaderboard .no-data {
    text-align: center;
    padding: 3rem 1rem;
    color: rgba(255, 255, 255, 0.6);
}

.page-leaderboard .no-data p {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.no-data-hint {
    font-size: 0.9rem !important;
    color: rgba(255, 255, 255, 0.4);
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
    .page-leaderboard {
        padding: 1rem;
    }

    .leaderboard-container {
        padding: 1.5rem;
    }

    .leaderboard-header h1 {
        font-size: 1.5rem;
    }

    .podium {
        gap: 0.5rem;
        padding: 0.5rem 0 1.5rem;
    }

    .podium-place {
        min-width: 90px;
        padding: 1rem 0.5rem;
    }

    .podium-place.first { min-height: 160px; }
    .podium-place.second { min-height: 140px; }
    .podium-place.third { min-height: 120px; }

    .podium-crown {
        font-size: 1.5rem;
        top: -22px;
    }

    .podium-flag {
        width: 36px;
        height: 24px;
    }

    .podium-rank {
        font-size: 1.25rem;
    }

    .podium-name {
        font-size: 0.85rem;
    }

    .podium-points {
        font-size: 1rem;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 0.625rem 0.5rem;
        font-size: 0.8rem;
    }

    .rank-col { width: 60px; }
    .flag-col { width: 40px; }
}

@media screen and (max-width: 480px) {
    .leaderboard-container {
        padding: 1rem;
    }

    .podium-place {
        min-width: 75px;
        padding: 0.75rem 0.375rem;
    }

    .podium-name {
        font-size: 0.75rem;
    }

    .podium-flag {
        width: 28px;
        height: 19px;
    }

    .completions-col {
        display: none;
    }
}
