/**
 * Leaderboard Page Styles
 */

/* ========================================
   PREMIUM LEADERBOARD REDESIGN
   ======================================== */

.leaderboard-page-container {
    position: relative;
    min-height: 100vh;
    background: #050505;
    overflow: hidden;
}

/* Animated Background */
.leaderboard-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(var(--hub-accent-rgb), 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 80% 50%, rgba(var(--hub-accent-rgb), 0.08), transparent),
        radial-gradient(ellipse 40% 60% at 20% 80%, rgba(var(--hub-accent-rgb), 0.05), transparent);
    pointer-events: none;
}

.leaderboard-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

/* Hero Section */
.leaderboard-hero {
    position: relative;
    padding: 1rem 0 4rem;
    text-align: center;
}

.hub-switch-tabs {
    display: inline-flex;
    gap: 0.5rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 50px;
    padding: 0.4rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.hub-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.5rem;
    border-radius: 40px;
    text-decoration: none;
    color: #888;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.hub-tab svg {
    width: 16px;
    height: 16px;
}

.hub-tab.active-rap, .hub-tab.active-beats {
    color: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.hub-tab.active-rap {
    background: linear-gradient(135deg, #cf0000, #9c0303);
}

.hub-tab.active-beats {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
}

.hub-tab:hover:not(.active-rap):not(.active-beats) {
    color: #fff;
    background: rgba(255,255,255,0.05);
}

.leaderboard-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 0.5rem;
    background: linear-gradient(180deg, #fff 0%, #888 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.leaderboard-subtitle {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    color: #666;
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* Podium Section */
.podium-section {
    position: relative;
    padding: 2rem 0 4rem;
}

.podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

.podium-item {
    position: relative;
    text-align: center;
    transition: transform 0.3s ease;
}

.podium-item:hover {
    transform: translateY(-10px);
}

/* Rank 1 - Center & Tallest */
.podium-rank-1 {
    order: 2;
    z-index: 3;
}

.podium-rank-1 .podium-avatar {
    width: 140px;
    height: 140px;
    border: 4px solid #ffd700;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.4), 0 10px 30px rgba(0,0,0,0.5);
}

.podium-rank-1 .podium-base {
    height: 180px;
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 215, 0, 0.05) 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.podium-rank-1 .podium-rank-badge {
    background: linear-gradient(135deg, #ffd700, #ffb700);
    color: #000;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

/* Rank 2 - Left */
.podium-rank-2 {
    order: 1;
    z-index: 2;
}

.podium-rank-2 .podium-avatar {
    width: 110px;
    height: 110px;
    border: 3px solid #c0c0c0;
    box-shadow: 0 0 30px rgba(192, 192, 192, 0.3), 0 8px 25px rgba(0,0,0,0.4);
}

.podium-rank-2 .podium-base {
    height: 140px;
    background: linear-gradient(180deg, rgba(192, 192, 192, 0.2) 0%, rgba(192, 192, 192, 0.05) 100%);
    border: 1px solid rgba(192, 192, 192, 0.3);
}

.podium-rank-2 .podium-rank-badge {
    background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
    color: #000;
    box-shadow: 0 0 15px rgba(192, 192, 192, 0.4);
}

/* Rank 3 - Right */
.podium-rank-3 {
    order: 3;
    z-index: 1;
}

.podium-rank-3 .podium-avatar {
    width: 100px;
    height: 100px;
    border: 3px solid #cd7f32;
    box-shadow: 0 0 25px rgba(205, 127, 50, 0.3), 0 6px 20px rgba(0,0,0,0.4);
}

.podium-rank-3 .podium-base {
    height: 110px;
    background: linear-gradient(180deg, rgba(205, 127, 50, 0.2) 0%, rgba(205, 127, 50, 0.05) 100%);
    border: 1px solid rgba(205, 127, 50, 0.3);
}

.podium-rank-3 .podium-rank-badge {
    background: linear-gradient(135deg, #cd7f32, #b8722d);
    color: #000;
    box-shadow: 0 0 15px rgba(205, 127, 50, 0.4);
}

.podium-avatar {
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    margin: 0 auto 1rem;
    position: relative;
    transition: all 0.3s ease;
}

.leaderboard-avatar {
    background-size: cover;
    background-position: center;
}

.podium-rank-badge {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    font-weight: 800;
    font-size: 1rem;
}

.podium-info {
    margin-bottom: 1rem;
}

.podium-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.25rem;
    text-decoration: none;
    display: block;
}

.podium-name:hover {
    color: var(--hub-accent);
}

.podium-points {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--hub-accent);
    text-shadow: 0 0 20px rgba(var(--hub-accent-rgb), 0.5);
}

.podium-stats {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.25rem;
}

.podium-base {
    width: 100%;
    border-radius: 12px 12px 0 0;
    position: relative;
    backdrop-filter: blur(5px);
}

.podium-base::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

/* Leaderboard Table Section */
.leaderboard-section {
    position: relative;
    padding: 2rem 0 6rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 0 1 0 3rem;
}

.section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fff;
}

.filter-select {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:hover {
    border-color: var(--hub-accent);
    background: rgba(255,255,255,0.08);
}

.filter-select option {
    background: #111;
    color: #fff;
}

/* Premium Table */
.leaderboard-table-wrap {
    background: linear-gradient(145deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.01) 100%);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 20px;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

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

.leaderboard-table thead {
    background: rgba(255,255,255,0.03);
}

.leaderboard-table th {
    padding: 1.2rem 1.5rem;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #666;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.leaderboard-table th:last-child {
    text-align: center;
}

.leaderboard-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: all 0.3s ease;
}

.leaderboard-table tbody tr {
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.leaderboard-table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.leaderboard-table tbody tr:nth-child(2) { animation-delay: 0.1s; }
.leaderboard-table tbody tr:nth-child(3) { animation-delay: 0.15s; }
.leaderboard-table tbody tr:nth-child(4) { animation-delay: 0.2s; }
.leaderboard-table tbody tr:nth-child(5) { animation-delay: 0.25s; }
.leaderboard-table tbody tr:nth-child(n+6) { animation-delay: 0.3s; }

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

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

/* Rank Cell */
.rank-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rank-number {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #555;
    width: 32px;
}

.rank-trend {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
}

.rank-trend.down {
    background: rgba(207, 0, 0, 0.1);
    color: #cf0000;
}

/* Player Cell */
.player-cell {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.player-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    border: 2px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.leaderboard-table tbody tr:hover .player-avatar {
    border-color: var(--hub-accent);
    box-shadow: 0 0 20px rgba(var(--hub-accent-rgb), 0.3);
    transform: scale(1.1);
}

.player-name {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
}

.player-name:hover {
    color: var(--hub-accent);
}

/* Stats Cells */
.stat-cell {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
}

.stat-wins {
    color: #4caf50;
    font-weight: 700;
}

.stat-losses {
    color: #cf0000;
}

.stat-divider {
    color: #444;
    margin: 0 0.3rem;
}

.winrate-bar {
    width: 100px;
    height: 6px;
    background: rgba(255,255,255,0.05);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 0.3rem;
}

.winrate-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--hub-accent), rgba(var(--hub-accent-rgb), 0.5));
    border-radius: 3px;
    box-shadow: 0 0 10px rgba(var(--hub-accent-rgb), 0.3);
}

.leaderboard-win-bar {
    width: var(--win-rate, 0%);
}

.points-cell {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--hub-accent);
    text-shadow: 0 0 20px rgba(var(--hub-accent-rgb), 0.3);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #555;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Responsive */
@media (max-width: 768px) {
    .leaderboard-title {
        font-size: 2rem;
        letter-spacing: 2px;
    }

    .podium-container {
        transform: scale(0.85);
        gap: 0.75rem;
    }

    .podium-rank-1 .podium-avatar {
        width: 100px;
        height: 100px;
    }

    .podium-rank-2 .podium-avatar {
        width: 80px;
        height: 80px;
    }

    .podium-rank-3 .podium-avatar {
        width: 70px;
        height: 70px;
    }

    .leaderboard-table th:nth-child(4),
    .leaderboard-table td:nth-child(4) {
        display: none;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 0.8rem 1rem;
    }
}

/* Leaderboard stat utility */
.leaderboard-stat {
    margin: 0;
}

/* Hub filter form (no margin) */
.hub-filter-form {
    margin: 0;
}
