/* CSS Variables for Dark Mode - Leaderboard */
:root {
    --lb-bg-primary: #ffffff;
    --lb-bg-secondary: #f8f9fa;
    --lb-text-primary: #333333;
    --lb-text-secondary: #666666;
    --lb-text-muted: #999999;
    --lb-border-color: #e0e0e0;
    --lb-shadow-light: rgba(0,0,0,0.08);
    --lb-shadow-medium: rgba(0,0,0,0.12);
    --lb-hover-bg: #f5f5f5;
}

.dark {
    --lb-bg-primary: #1f2937;
    --lb-bg-secondary: #374151;
    --lb-text-primary: #f9fafb;
    --lb-text-secondary: #d1d5db;
    --lb-text-muted: #9ca3af;
    --lb-border-color: #4b5563;
    --lb-shadow-light: rgba(0,0,0,0.3);
    --lb-shadow-medium: rgba(0,0,0,0.4);
    --lb-hover-bg: #4b5563;
}

/* Main Layout */
.main-layout-container {
    display: grid;
    grid-template-columns: 300px 1fr 350px;
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    min-height: calc(100vh - 48px);
}

/* Left Sidebar */
.left-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.daily-challenges-panel {
    background: linear-gradient(135deg, #4285f4 0%, #5a6fee 100%);
    border-radius: 24px;
    padding: 32px 24px;
    color: white;
    text-align: center;
    box-shadow: 0 12px 40px rgba(66, 133, 244, 0.3);
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.daily-challenges-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.trophy-icon-challenges {
    font-size: 80px;
    margin-left: 10px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

/* Center Content */
.center-content {
    display: flex;
    flex-direction: column;
}

.leaderboard-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    flex: 1;
    transition: all 0.3s ease;
}

.dark .leaderboard-container {
    background: linear-gradient(135deg, #4b5563 0%, #6b7280 100%);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Right Sidebar */
.right-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}



/* Ad Panels */
.ad-panel {
    background: var(--lb-bg-primary);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px var(--lb-shadow-light);
    border: 1px solid var(--lb-border-color);
    transition: all 0.3s ease;
}

.ad-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--lb-shadow-medium);
}

.ad-content h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--lb-text-primary);
}

.ad-content p {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--lb-text-secondary);
    line-height: 1.4;
}

.ad-button {
    background: linear-gradient(135deg, #4285f4 0%, #5a6fee 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ad-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

.leaderboard-header {
    text-align: center;
    margin-bottom: 24px;
}

.leaderboard-title {
    font-size: 28px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.leaderboard-subtitle {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
}

.podium-container {
    display: flex;
    justify-content: center;
    align-items: end;
    margin-bottom: 24px;
    gap: 12px;
}

.podium-item {
    text-align: center;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 0px 12px;
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    min-width: 120px;
    transition: all 0.3s ease;
}

.dark .podium-item {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
}

.podium-first {
    order: 2;
    transform: scale(1.1);
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #333;
    box-shadow: 0 8px 32px rgba(255, 215, 0, 0.4);
}

.podium-second {
    order: 1;
    background: linear-gradient(135deg, #C0C0C0 0%, #A8A8A8 100%);
    color: #333;
}

.podium-third {
    order: 3;
    background: linear-gradient(135deg, #CD7F32 0%, #B8860B 100%);
    color: white;
}

.podium-medal {
    font-size: 32px;
    margin-bottom: 8px;
}

.podium-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.podium-score {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 2px;
}

.podium-time {
    font-size: 12px;
    opacity: 0.8;
}

.leaderboard-list {
    background: var(--lb-bg-primary);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--lb-shadow-light);
    transition: all 0.3s ease;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--lb-border-color);
    transition: all 0.3s ease;
}

.leaderboard-item:last-child {
    border-bottom: none;
}


.rank-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: var(--lb-text-secondary);
    margin-right: 16px;
}

.rank-medal {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-right: 16px;
}

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

.player-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--lb-text-primary);
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-details {
    font-size: 12px;
    color: var(--lb-text-secondary);
}

.player-score {
    text-align: right;
    margin-left: 12px;
}

.score-value {
    font-weight: 700;
    font-size: 18px;
    color: var(--lb-text-primary);
    margin-bottom: 2px;
}

.score-time {
    font-size: 12px;
    color: var(--lb-text-secondary);
}

.difficulty-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.difficulty-easy { background: #4caf50; color: white; }
.difficulty-medium { background: #ff9800; color: white; }
.difficulty-hard { background: #f44336; color: white; }
.difficulty-expert { background: #9c27b0; color: white; }
.difficulty-evil { background: #000; color: white; }

.refresh-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.6);
}

.back-btn {
    position: fixed;
    top: 24px;
    left: 24px;
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.back-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.loading-skeleton {
    background: linear-gradient(90deg, var(--lb-bg-secondary) 25%, var(--lb-border-color) 50%, var(--lb-bg-secondary) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Filter Styles */
.leaderboard-filters {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    margin-bottom: 16px;
}

.filter-tab {
    background: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.3);
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-tab:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.filter-tab.active {
    background: white;
    color: #667eea;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.mode-difficulty-filters {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.mode-select, .difficulty-select {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    outline: none;
}

.mode-select option, .difficulty-select option {
    background: #667eea;
    color: white;
}

/* Scrollbar Styles */
.leaderboard-list::-webkit-scrollbar {
    width: 8px;
}

.leaderboard-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.leaderboard-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.leaderboard-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}



/* Responsive Design */
@media (max-width: 1200px) {
    .main-layout-container {
        grid-template-columns: 280px 1fr 320px;
        gap: 20px;
        padding: 20px;
    }
    
    .daily-challenges-panel {
        min-height: 250px;
        padding: 24px 20px;
    }
    
    .daily-challenges-title {
        font-size: 24px;
    }
    
    .trophy-icon-challenges {
        font-size: 60px;
    }
}

@media (max-width: 1024px) {
    .main-layout-container {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 16px;
    }
    
    .left-sidebar,
    .right-sidebar {
        order: 2;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 16px;
    }
    
    .center-content {
        order: 1;
    }
    
    .daily-challenges-panel {
        min-height: 200px;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .main-layout-container {
        padding: 12px;
        gap: 16px;
    }
    
    .left-sidebar,
    .right-sidebar {
        grid-template-columns: 1fr;
    }
    
    .leaderboard-container {
        padding: 20px;
        border-radius: 16px;
    }
    
    .leaderboard-filters {
        flex-direction: column;
        gap: 8px;
        margin-top: 12px;
        margin-bottom: 12px;
    }
    
    .filter-tab {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .mode-difficulty-filters {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 12px;
    }
    
    .mode-select, .difficulty-select {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .leaderboard-list {
        max-height: 400px;
    }
    
    .podium-container {
        gap: 8px;
        margin-bottom: 20px;
    }
    
    .podium-item {
        min-width: 100px;
        padding: 12px 8px;
    }
    
    .podium-medal {
        font-size: 24px;
        margin-bottom: 6px;
    }
    
    .podium-name {
        font-size: 12px;
    }
    
    .podium-score {
        font-size: 16px;
    }
    
    .leaderboard-item {
        padding: 12px 16px;
    }
    
    .player-name {
        font-size: 14px;
    }
    
    .score-value {
        font-size: 16px;
    }
    
    .daily-challenges-panel {
        min-height: 180px;
        padding: 16px;
    }
    
    .daily-challenges-title {
        font-size: 20px;
        margin-bottom: 12px;
    }
    
    .trophy-icon-challenges {
        font-size: 50px;
        margin: 12px 0;
    }
    

}

@media (max-width: 480px) {
    .main-layout-container {
        padding: 8px;
        gap: 12px;
    }
    
    .back-btn {
        top: 16px;
        left: 16px;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .refresh-btn {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
    
    .leaderboard-title {
        font-size: 24px;
    }
    
    .leaderboard-subtitle {
        font-size: 12px;
    }
    
    .leaderboard-filters {
        gap: 6px;
        margin-top: 8px;
        margin-bottom: 8px;
    }
    
    .filter-tab {
        padding: 6px 12px;
        font-size: 11px;
        gap: 4px;
    }
    
    .difficulty-select {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .leaderboard-list {
        max-height: 350px;
    }
    
    .podium-container {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    
    .podium-item {
        min-width: 200px;
        max-width: 250px;
    }
    
    .podium-first {
        order: 1;
        transform: scale(1);
    }
    
    .podium-second {
        order: 2;
    }
    
    .podium-third {
        order: 3;
    }
    
    .daily-challenges-panel {
        min-height: 150px;
        padding: 12px;
    }
    
    .daily-challenges-title {
        font-size: 18px;
        margin-bottom: 8px;
    }
    
    .trophy-icon-challenges {
        font-size: 40px;
        margin: 8px 0;
    }
    
    .ad-panel {
        padding: 16px;
    }
    
    .ad-content h3 {
        font-size: 14px;
    }
    
    .ad-content p {
        font-size: 12px;
    }
}
