/* ============================================
   LEADERBOARDS PAGE STYLES
   ============================================ */

/* Game Selection Tabs */
.game-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    border-bottom: 2px solid rgba(74, 124, 184, 0.2);
    padding-bottom: 0;
}

.game-tab {
    position: relative;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.game-tab:hover {
    color: var(--text-primary);
    background: rgba(74, 124, 184, 0.05);
}

.game-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
    background: rgba(74, 124, 184, 0.1);
}

/* Timeframe Filter */
.timeframe-filter {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.timeframe-btn {
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    border: 1px solid rgba(74, 124, 184, 0.3);
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.timeframe-btn:hover {
    background: rgba(74, 124, 184, 0.2);
    border-color: rgba(74, 124, 184, 0.5);
    color: var(--text-primary);
}

.timeframe-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

/* Top 3 Podium Section */
.podium-section {
    margin-bottom: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(74, 124, 184, 0.1) 0%, rgba(138, 92, 246, 0.1) 100%);
    border-radius: 12px;
    border: 1px solid rgba(74, 124, 184, 0.2);
}

.podium-container {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
}

.podium-place {
    flex: 1;
    max-width: 200px;
    text-align: center;
    animation: podiumRise 0.6s ease-out backwards;
}

.podium-place:nth-child(1) {
    animation-delay: 0.2s;
}

.podium-place:nth-child(2) {
    animation-delay: 0s;
    order: -1;
}

.podium-place:nth-child(3) {
    animation-delay: 0.4s;
}

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

.podium-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4A7CB8 0%, #8A5CF6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    position: relative;
    border: 4px solid var(--bg-secondary);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.podium-place:nth-child(2) .podium-avatar {
    width: 120px;
    height: 120px;
    border-width: 5px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
}

.podium-rank-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    font-weight: 800;
    font-size: 1.2rem;
    color: #1B2E4A;
    border: 3px solid var(--bg-secondary);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.5);
}

.podium-place:nth-child(1) .podium-rank-badge {
    background: linear-gradient(135deg, #C0C0C0 0%, #999999 100%);
    box-shadow: 0 4px 12px rgba(192, 192, 192, 0.5);
}

.podium-place:nth-child(3) .podium-rank-badge {
    background: linear-gradient(135deg, #CD7F32 0%, #B87333 100%);
    box-shadow: 0 4px 12px rgba(205, 127, 50, 0.5);
}

.podium-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.podium-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.podium-score {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-primary);
    font-family: 'Orbitron', sans-serif;
}

.podium-stats {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Leaderboard Table */
.leaderboard-table-container {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(74, 124, 184, 0.2);
}

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

.leaderboard-table thead {
    background: rgba(74, 124, 184, 0.15);
}

.leaderboard-table th {
    padding: 1rem;
    text-align: left;
    color: var(--text-primary);
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.leaderboard-table th:first-child {
    width: 60px;
    text-align: center;
}

.leaderboard-table tbody tr {
    border-bottom: 1px solid rgba(74, 124, 184, 0.1);
    transition: all 0.3s ease;
}

.leaderboard-table tbody tr:hover {
    background: rgba(74, 124, 184, 0.1);
}

.leaderboard-table tbody tr.highlight {
    background: rgba(138, 92, 246, 0.15);
    border-left: 4px solid var(--accent-primary);
}

.leaderboard-table td {
    padding: 1rem;
    color: var(--text-primary);
}

.rank-cell {
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.rank-cell.top-rank {
    color: var(--accent-primary);
}

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

.player-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4A7CB8 0%, #8A5CF6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.player-info {
    flex: 1;
}

.player-name {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.player-tag {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.score-cell {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent-primary);
}

.trend-cell {
    text-align: center;
}

.trend-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
}

.trend-up {
    color: #10B981;
    background: rgba(16, 185, 129, 0.1);
}

.trend-down {
    color: #EF4444;
    background: rgba(239, 68, 68, 0.1);
}

.trend-same {
    color: var(--text-muted);
    background: rgba(74, 124, 184, 0.1);
}

.stats-cell {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Search and Filters Section */
.leaderboard-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.leaderboard-search {
    position: relative;
    flex: 1;
    min-width: 250px;
    max-width: 400px;
}

.leaderboard-search svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.leaderboard-search input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    background: var(--card-bg);
    border: 1px solid rgba(74, 124, 184, 0.3);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
}

.leaderboard-search input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Region Selector */
.region-selector {
    display: flex;
    gap: 0.5rem;
}

.region-btn {
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    border: 1px solid rgba(74, 124, 184, 0.3);
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.region-btn:hover {
    background: rgba(74, 124, 184, 0.2);
    border-color: rgba(74, 124, 184, 0.5);
    color: var(--text-primary);
}

.region-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

/* Your Rank Card */
.your-rank-card {
    background: linear-gradient(135deg, rgba(138, 92, 246, 0.2) 0%, rgba(74, 124, 184, 0.2) 100%);
    border: 2px solid rgba(138, 92, 246, 0.4);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.your-rank-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8A5CF6 0%, #4A7CB8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    border: 3px solid var(--bg-secondary);
}

.your-rank-info {
    flex: 1;
}

.your-rank-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.your-rank-position {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.your-rank-details {
    display: flex;
    gap: 2rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.your-rank-details strong {
    color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .podium-section {
        padding: 1.5rem;
    }

    .podium-container {
        gap: 1.5rem;
    }
}

@media (max-width: 1024px) {
    .game-tabs {
        gap: 0.75rem;
    }

    .game-tab {
        padding: 0.65rem 1.25rem;
        font-size: 0.9rem;
    }

    .timeframe-filter {
        gap: 0.4rem;
    }

    .timeframe-btn {
        padding: 0.45rem 0.85rem;
        font-size: 0.8rem;
    }

    .podium-container {
        gap: 1.25rem;
    }

    .podium-place {
        max-width: 180px;
    }
}

@media (max-width: 900px) {
    .podium-section {
        padding: 1.25rem;
    }

    .podium-container {
        gap: 1rem;
    }

    .leaderboard-controls {
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .game-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
    }

    .game-tab {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .timeframe-filter {
        flex-wrap: wrap;
    }

    .podium-section {
        padding: 1rem;
    }

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

    .podium-place {
        max-width: 100%;
    }

    .podium-place:nth-child(2) {
        order: 0;
    }

    .leaderboard-controls {
        flex-direction: column;
    }

    .leaderboard-search {
        max-width: 100%;
    }

    .leaderboard-table {
        font-size: 0.875rem;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 0.75rem 0.5rem;
    }

    .player-avatar {
        width: 35px;
        height: 35px;
    }

    .your-rank-card {
        flex-direction: column;
        text-align: center;
    }

    .your-rank-details {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 600px) {
    .podium-section {
        padding: 0.85rem;
    }

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

    .podium-rank {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }

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

    .leaderboard-table-container {
        overflow-x: auto;
    }

    .leaderboard-table {
        min-width: 500px;
        font-size: 0.8rem;
    }

    .your-rank-position {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .game-tab {
        padding: 0.5rem 0.85rem;
        font-size: 0.8rem;
    }

    .timeframe-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }

    .podium-avatar {
        width: 60px;
        height: 60px;
    }

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

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 0.65rem 0.4rem;
    }

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

    .your-rank-position {
        font-size: 1.5rem;
    }
}
