/* Leaderboard Overlay - Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: transparent;
    color: #fff;
    overflow: hidden;
}

.container {
    width: 450px;
    min-height: 600px;
    max-height: 800px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    overflow: hidden;
    /* Theme-specific background, border, and box-shadow are in theme files */
}

/* Tab Navigation */
.tabs {
    display: flex;
    /* Theme-specific background and border-bottom are in theme files */
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    background: transparent;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    /* Theme-specific colors are in theme files */
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    /* Theme-specific background and box-shadow are in theme files */
}

.tab-icon {
    font-size: 18px;
}

/* Panel */
.leaderboard-panel {
    display: none;
    padding: 20px;
    max-height: 750px;
    overflow-y: auto;
}

.leaderboard-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.panel-header {
    margin-bottom: 20px;
}

.panel-header h2 {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
    /* Theme-specific colors, gradients, and text-shadow are in theme files */
}

.session-info {
    text-align: center;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 5px;
}

/* Leaderboard List */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.3);
}

.empty-icon {
    font-size: 60px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 16px;
    font-weight: 500;
}

/* Leaderboard Entry */
.leaderboard-entry {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 12px;
    transition: all 0.3s ease;
    animation: slideIn 0.4s ease;
    /* Theme-specific background and border are in theme files */
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.leaderboard-entry:hover {
    transform: translateX(5px);
    /* Theme-specific background, border-color, and box-shadow are in theme files */
}

/* Rank Badge */
.rank-badge {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    border-radius: 10px;
    margin-right: 12px;
    flex-shrink: 0;
}

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

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

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

.rank-other {
    /* Theme-specific background, color, and border are in theme files */
}

/* Profile Picture */
.profile-pic {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
    flex-shrink: 0;
    /* Theme-specific border is in theme files */
}

/* User Info */
.user-info {
    flex: 1;
    min-width: 0;
}

.username {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Theme-specific color is in theme files (defaults to #fff) */
    color: #fff;
}

.user-id {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Coins Display */
.coins-display {
    text-align: right;
    flex-shrink: 0;
    margin-left: 10px;
}

.coins-amount {
    font-size: 18px;
    font-weight: 700;
    /* Theme-specific color and text-shadow are in theme files */
}

.coins-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    /* Theme-specific color is in theme files (defaults to rgba(255, 255, 255, 0.5)) */
    color: rgba(255, 255, 255, 0.5);
}

/* Rank Change Animation */
.leaderboard-entry.rank-up {
    animation: rankUp 0.8s ease;
}

@keyframes rankUp {
    0% {
        transform: translateX(0) scale(1);
    }
    20% {
        transform: translateX(-15px) scale(1.08);
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
    }
    40% {
        transform: translateX(15px) scale(1.08);
    }
    60% {
        transform: translateX(-10px) scale(1.05);
    }
    80% {
        transform: translateX(5px) scale(1.02);
    }
    100% {
        transform: translateX(0) scale(1);
    }
}

.leaderboard-entry.rank-up-big {
    animation: rankUpBig 1s ease;
}

@keyframes rankUpBig {
    0% {
        transform: translateX(0) scale(1) rotate(0deg);
    }
    15% {
        transform: translateX(-20px) scale(1.15) rotate(-5deg);
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.8);
    }
    30% {
        transform: translateX(20px) scale(1.15) rotate(5deg);
    }
    45% {
        transform: translateX(-15px) scale(1.1) rotate(-3deg);
    }
    60% {
        transform: translateX(15px) scale(1.1) rotate(3deg);
    }
    75% {
        transform: translateX(-5px) scale(1.05) rotate(-1deg);
    }
    90% {
        transform: translateX(5px) scale(1.02) rotate(1deg);
    }
    100% {
        transform: translateX(0) scale(1) rotate(0deg);
    }
}

.leaderboard-entry.rank-down {
    animation: rankDown 0.6s ease;
}

@keyframes rankDown {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* New Entry Animation */
.leaderboard-entry.new-entry {
    animation: newEntry 0.8s ease;
}

@keyframes newEntry {
    0% {
        transform: scale(0.8) translateY(-20px);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) translateY(0);
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Scrollbar Styling */
.leaderboard-panel::-webkit-scrollbar {
    width: 8px;
}

.leaderboard-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.leaderboard-panel::-webkit-scrollbar-thumb {
    border-radius: 10px;
    /* Theme-specific background is in theme files */
}

.leaderboard-panel::-webkit-scrollbar-thumb:hover {
    /* Theme-specific background is in theme files */
}

/* Glow effect for top 3 */
.rank-1 .username,
.rank-2 .username,
.rank-3 .username {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Responsive adjustments */
@media (max-width: 500px) {
    .container {
        width: 100%;
        border-radius: 0;
    }
    
    .profile-pic {
        width: 40px;
        height: 40px;
    }
    
    .username {
        font-size: 14px;
    }
    
    .coins-amount {
        font-size: 16px;
    }
}
