/* Leaderboard Styles - LinkedIn Zip puzzle inspired design */

.leaderboard-container {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.puzzle-title {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.leaderboard-entries {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.leaderboard-entry {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #fff;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.leaderboard-entry:hover {
    background: #f8f9fa;
}

.leaderboard-entry.current-user {
    background: #e8f5e9;
    border: 2px solid #4caf50;
    box-shadow: 0 2px 6px rgba(76, 175, 80, 0.15);
}

.leaderboard-entry.current-user:hover {
    background: #e0f2f1;
}

.rank-indicator {
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
}

.medal-icon {
    width: 36px;
    height: 36px;
}

.rank-number {
    font-size: 18px;
    font-weight: 600;
    color: #666;
    min-width: 36px;
    text-align: center;
}

.player-info {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
}

.player-details {
    flex: 1;
    min-width: 0;
}

.player-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.you-badge {
    background: #4caf50;
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.player-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
}

.flawless-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #2196f3;
    font-weight: 500;
}

.flawless-icon {
    font-size: 16px;
}

.percentile-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.percentile-icon {
    font-size: 14px;
}

.player-time {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    min-width: 60px;
    text-align: right;
}

.expand-toggle {
    margin-top: 16px;
    text-align: center;
}

.expand-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.expand-btn:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

.expand-icon {
    transition: transform 0.2s ease;
}

.expand-icon.rotated {
    transform: rotate(180deg);
}

/* Hidden entries for collapse functionality */
.leaderboard-entry.collapsed {
    display: none;
}

/* Top 3 special styling */
.leaderboard-entry.rank-1 .rank-indicator {
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.4));
}

.leaderboard-entry.rank-2 .rank-indicator {
    filter: drop-shadow(0 0 8px rgba(192, 192, 192, 0.4));
}

.leaderboard-entry.rank-3 .rank-indicator {
    filter: drop-shadow(0 0 8px rgba(205, 127, 50, 0.4));
}

/* Timeframe toggles */
.timeframe-toggles {
    display: inline-flex;
    background: #f0f0f0;
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
}

.timeframe-btn {
    background: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.timeframe-btn:hover {
    color: #1a1a1a;
}

.timeframe-btn.active {
    background: white;
    color: #1a1a1a;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Empty state */
.leaderboard-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.leaderboard-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.leaderboard-empty-text {
    font-size: 16px;
    color: #666;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .leaderboard-container {
        padding: 16px;
        border-radius: 12px;
    }

    .leaderboard-entry {
        padding: 12px;
    }

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

    .medal-icon {
        width: 28px;
        height: 28px;
    }

    .rank-indicator {
        min-width: 36px;
        margin-right: 12px;
    }

    .player-name {
        font-size: 14px;
    }

    .player-time {
        font-size: 16px;
        min-width: 50px;
    }

    .player-badges {
        font-size: 12px;
    }

    .percentile-badge {
        font-size: 10px;
        padding: 3px 8px;
    }
}

/* Loading skeleton (optional) */
.leaderboard-skeleton {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}
