/* Enhanced Leaderboard System Styles */

/* Leaderboard Tabs */
.leaderboard-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    overflow-x: auto;
}

.leaderboard-tab {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    color: #999;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}

.leaderboard-tab:hover {
    color: #d4a843;
}

.leaderboard-tab.active {
    color: #d4a843;
    border-bottom-color: #d4a843;
}

/* Countdown Timer */
.leaderboard-countdown {
    background: rgba(212, 168, 67, 0.1);
    border: 1px solid rgba(212, 168, 67, 0.3);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.countdown-label {
    font-size: 0.85rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.countdown-time {
    font-size: 1.5rem;
    font-weight: 700;
    color: #d4a843;
    font-variant-numeric: tabular-nums;
}

/* Leaderboard Entry */
.leaderboard-entry {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.leaderboard-entry:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(212, 168, 67, 0.3);
    transform: translateX(4px);
}

.leaderboard-entry.entry-current-user {
    background: rgba(212, 168, 67, 0.1);
    border-color: #d4a843;
}

.leaderboard-entry.entry-you {
    margin-top: 1.5rem;
    border: 2px solid #d4a843;
    position: sticky;
    bottom: 0;
    z-index: 100;
}

/* Entry Components */
.entry-rank {
    font-size: 1.2rem;
    font-weight: 700;
    min-width: 40px;
    text-align: center;
    color: #d4a843;
}

.leaderboard-entry:nth-child(1) .entry-rank,
.leaderboard-entry:nth-child(2) .entry-rank,
.leaderboard-entry:nth-child(3) .entry-rank {
    font-size: 1.5rem;
}

.entry-avatar {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.entry-info {
    flex: 1;
    min-width: 0;
}

.entry-name {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.entry-stats {
    font-size: 0.85rem;
    color: #999;
}

.entry-score-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.entry-prize {
    font-size: 1.5rem;
    filter: drop-shadow(0 2px 4px rgba(255, 215, 0, 0.5));
    animation: prizeBounce 2s ease-in-out infinite;
}

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

.entry-score {
    font-size: 1.3rem;
    font-weight: 700;
    color: #d4a843;
    font-variant-numeric: tabular-nums;
}

/* Prize Indicators for Top Players */
.leaderboard-entry:nth-child(1) {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(212, 168, 67, 0.1));
    border-color: rgba(255, 215, 0, 0.3);
}

.leaderboard-entry:nth-child(2) {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.1), rgba(169, 169, 169, 0.1));
    border-color: rgba(192, 192, 192, 0.3);
}

.leaderboard-entry:nth-child(3) {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.1), rgba(184, 115, 51, 0.1));
    border-color: rgba(205, 127, 50, 0.3);
}

/* Leaderboard List Container */
.leaderboard-list {
    max-height: calc(100vh - 300px);
    overflow-y: auto;
    padding-right: 0.5rem;
}

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

.leaderboard-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.leaderboard-list::-webkit-scrollbar-thumb {
    background: rgba(212, 168, 67, 0.3);
    border-radius: 4px;
}

.leaderboard-list::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 168, 67, 0.5);
}

/* Weekly/Monthly Trend Indicators */
.entry-trend {
    font-size: 1.2rem;
    margin-left: 0.5rem;
}

.entry-trend.up {
    color: #4ade80;
}

.entry-trend.down {
    color: #f87171;
}

/* Hall of Fame (Monthly Winners Archive) */
.hall-of-fame {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
}

.hall-of-fame h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    text-align: center;
    color: #d4a843;
}

.fame-entry {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fame-date {
    font-size: 0.85rem;
    color: #999;
}

.fame-winner {
    font-weight: 700;
    color: #d4a843;
}

/* Loading State */
.leaderboard-loading {
    text-align: center;
    padding: 3rem;
    color: #999;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(212, 168, 67, 0.2);
    border-top-color: #d4a843;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Empty Leaderboard State */
.leaderboard-empty {
    text-align: center;
    padding: 3rem 1rem;
}

.leaderboard-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.leaderboard-empty-text {
    font-size: 1.1rem;
    color: #999;
}

/* Prize Pool Display */
.prize-pool {
    background: linear-gradient(135deg, rgba(212, 168, 67, 0.15), rgba(255, 215, 0, 0.15));
    border: 2px solid #d4a843;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.prize-pool-label {
    font-size: 0.9rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.prize-pool-amount {
    font-size: 2rem;
    font-weight: 700;
    color: #d4a843;
    margin-bottom: 0.5rem;
}

.prize-pool-description {
    font-size: 0.85rem;
    color: #ccc;
}

.prize-breakdown {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.prize-tier {
    text-align: center;
}

.prize-tier-rank {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.prize-tier-amount {
    font-size: 1.1rem;
    font-weight: 700;
    color: #d4a843;
}

/* Past Winners Archive */
.winners-archive {
    margin-top: 2rem;
}

.winners-archive h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.archive-entry {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.archive-date {
    font-size: 0.85rem;
    color: #999;
}

.archive-winner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.archive-avatar {
    font-size: 1.5rem;
}

.archive-name {
    font-weight: 700;
}

/* Responsive Design */
@media (max-width: 768px) {
    .leaderboard-tabs {
        justify-content: flex-start;
    }

    .leaderboard-tab {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }

    .entry-rank {
        min-width: 30px;
        font-size: 1rem;
    }

    .entry-avatar {
        font-size: 1.5rem;
    }

    .entry-name {
        font-size: 0.9rem;
    }

    .entry-score {
        font-size: 1.1rem;
    }

    .prize-breakdown {
        grid-template-columns: 1fr;
    }

    .leaderboard-list {
        max-height: calc(100vh - 250px);
    }
}

/* Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.leaderboard-entry {
    animation: slideInUp 0.3s ease forwards;
}

.leaderboard-entry:nth-child(1) { animation-delay: 0.05s; }
.leaderboard-entry:nth-child(2) { animation-delay: 0.1s; }
.leaderboard-entry:nth-child(3) { animation-delay: 0.15s; }
.leaderboard-entry:nth-child(4) { animation-delay: 0.2s; }
.leaderboard-entry:nth-child(5) { animation-delay: 0.25s; }
.leaderboard-entry:nth-child(6) { animation-delay: 0.3s; }
.leaderboard-entry:nth-child(7) { animation-delay: 0.35s; }
.leaderboard-entry:nth-child(8) { animation-delay: 0.4s; }
.leaderboard-entry:nth-child(9) { animation-delay: 0.45s; }
.leaderboard-entry:nth-child(10) { animation-delay: 0.5s; }

/* Tier Badge Styling in Leaderboard */
.entry-tier-badge {
    font-size: 1.15rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    min-width: 24px;
    text-align: center;
}
.entry-tier-badge.addicted-badge {
    animation: firePulse 1.5s ease-in-out infinite;
    font-size: 1.3rem;
}
@keyframes firePulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 2px 4px rgba(255,100,0,0.5)); }
    50% { transform: scale(1.2); filter: drop-shadow(0 4px 12px rgba(255,100,0,0.8)); }
}

/* Tier Legend Bar */
.tier-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 8px 12px;
    margin-bottom: 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    font-size: 0.75rem;
    color: #888;
}
.tier-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.tier-legend-item .badge-label { color: #aaa; }
.tier-legend-item.legend-addicted .badge-label { color: #ff6b35; font-weight: 600; }
.tier-legend-item.legend-pro .badge-label { color: #d4a843; }
.tier-legend-item.legend-free .badge-label { color: #888; }

/* Notification for Rank Change */
.rank-change-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #d4a843, #ffd700);
    color: #0a0a0f;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(212, 168, 67, 0.4);
    animation: slideInRight 0.3s ease, slideOutRight 0.3s ease 3s forwards;
    z-index: 9999;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Prize Pool Banner */
.prize-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 165, 0, 0.1));
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    margin-bottom: 16px;
}

.prize-icon {
    font-size: 48px;
    flex-shrink: 0;
}

.prize-info {
    flex: 1;
}

.prize-title {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.prize-amount {
    font-size: 24px;
    font-weight: 700;
    color: #FFD700;
}

.prize-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
}

/* Prize Points in Leaderboard Entry */
.entry-prize-points {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    color: #4CAF50;
}

/* Update entry stats to accommodate prize points */
.entry-stats {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 768px) {
    .prize-banner {
        padding: 16px;
    }
    
    .prize-icon {
        font-size: 36px;
    }
    
    .prize-amount {
        font-size: 20px;
    }
    
    .entry-prize-points {
        display: block;
        margin-left: 0;
        margin-top: 4px;
    }
}
