/* Leaderboard Hamburger Menu Styles */

/* Floating Action Button */
.leaderboard-fab {
    position: fixed;
    bottom: 70px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00cfff 0%, #0066ff 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 207, 255, 0.4);
    z-index: 999;
    transition: all 0.3s ease;
}

.leaderboard-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 207, 255, 0.6);
}

.leaderboard-fab:active {
    transform: scale(0.95);
}

.leaderboard-fab svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.leaderboard-fab.open {
    background: linear-gradient(135deg, #ff4757 0%, #ff6b81 100%);
    box-shadow: 0 4px 20px rgba(255, 71, 87, 0.4);
}

.leaderboard-fab.open svg {
    transform: rotate(45deg);
}

/* Menu Panel */
.leaderboard-menu {
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    width: 360px;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(10, 15, 25, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(0, 207, 255, 0.2);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    font-family: 'JetBrains Mono', 'Inter', monospace;
}

.leaderboard-menu.open {
    transform: translateX(0);
}

/* Backdrop overlay */
.leaderboard-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
}

.leaderboard-backdrop.open {
    opacity: 1;
    visibility: visible;
}

/* Menu Header */
.leaderboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid rgba(100, 116, 139, 0.2);
}

.leaderboard-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.leaderboard-title svg {
    width: 24px;
    height: 24px;
    fill: #00cfff;
}

.leaderboard-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.leaderboard-close:hover {
    background: rgba(255, 71, 87, 0.2);
}

.leaderboard-close svg {
    width: 20px;
    height: 20px;
    stroke: #9ca3af;
}

/* Time Filter Pills */
.time-filter-container {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(100, 116, 139, 0.2);
}

.time-filter-pills {
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 4px;
}

.time-pill {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #9ca3af; /* Improved contrast from #6b7280 */
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.time-pill:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.time-pill.active {
    background: linear-gradient(135deg, #00cfff 0%, #0066ff 100%);
    color: #fff;
    box-shadow: 0 2px 10px rgba(0, 207, 255, 0.3);
}

/* Leaderboard Sections */
.leaderboard-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.leaderboard-section {
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(100, 116, 139, 0.1);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: background 0.2s ease;
}

.section-header:hover {
    background: rgba(0, 207, 255, 0.1);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.section-title .icon {
    width: 20px;
    height: 20px;
}

.view-all-link {
    font-size: 11px;
    color: #00cfff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: opacity 0.2s;
}

.view-all-link:hover {
    opacity: 0.8;
}

.view-all-link svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

/* Entry Rows */
.section-entries {
    padding: 8px;
}

.entry-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    transition: background 0.2s ease;
}

.entry-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.entry-rank {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

.entry-rank.gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
}

.entry-rank.silver {
    background: linear-gradient(135deg, #c0c0c0 0%, #a0a0a0 100%);
}

.entry-rank.bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #a0522d 100%);
}

.entry-rank.other {
    background: rgba(100, 116, 139, 0.3);
    color: #9ca3af;
}

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

.entry-name {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.entry-subtitle {
    font-size: 11px;
    color: #9ca3af; /* Improved contrast from #6b7280 */
    margin-top: 2px;
}

.entry-value {
    text-align: right;
}

.entry-primary {
    font-size: 13px;
    font-weight: 600;
    color: #10b981;
}

.entry-secondary {
    font-size: 10px;
    color: #9ca3af; /* Improved contrast from #6b7280 */
    margin-top: 2px;
}

/* Loading State */
.leaderboard-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #9ca3af; /* Improved contrast from #6b7280 */
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(0, 207, 255, 0.2);
    border-top-color: #00cfff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 24px;
    color: #9ca3af; /* Improved contrast from #6b7280 */
    font-size: 12px;
}

/* Mobile Styles - Bottom Sheet */
@media (max-width: 480px) {
    .leaderboard-fab {
        bottom: 80px;
        right: 16px;
        width: 50px;
        height: 50px;
    }

    .leaderboard-fab svg {
        width: 24px;
        height: 24px;
    }

    .leaderboard-menu {
        width: 100%;
        height: 75vh;
        top: auto;
        bottom: 0;
        border-radius: 24px 24px 0 0;
        border-left: none;
        border-top: 1px solid rgba(0, 207, 255, 0.2);
        transform: translateY(100%);
    }

    .leaderboard-menu.open {
        transform: translateY(0);
    }

    /* Drag handle for bottom sheet */
    .leaderboard-menu::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: rgba(255, 255, 255, 0.3);
        border-radius: 2px;
    }

    .leaderboard-header {
        padding-top: 24px;
    }

    .time-pill {
        padding: 8px 12px;
        font-size: 11px;
    }

    .section-header {
        padding: 12px 14px;
    }

    .section-title {
        font-size: 13px;
    }

    .entry-row {
        padding: 8px 10px;
    }
}

/* Tablet Styles */
@media (min-width: 481px) and (max-width: 768px) {
    .leaderboard-menu {
        width: 320px;
    }

    .leaderboard-fab {
        bottom: 75px;
    }
}

/* Animation for entries */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.entry-row {
    animation: slideIn 0.3s ease forwards;
}

.entry-row:nth-child(1) { animation-delay: 0.05s; }
.entry-row:nth-child(2) { animation-delay: 0.1s; }
.entry-row:nth-child(3) { animation-delay: 0.15s; }

/* Count up animation */
.count-up {
    animation: countPulse 0.3s ease;
}

@keyframes countPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}
