/* Firebase Game Service Leaderboard Styles */

.leaderboard-container {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #4ade80;
    border-radius: 15px;
    padding: 20px;
    margin: 20px;
    color: white;
    font-family: 'Orbitron', Arial, sans-serif;
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.3);
    max-width: 600px;
    margin: 20px auto;
}

.leaderboard-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(74, 222, 128, 0.3);
}

.leaderboard-header h2 {
    color: #4ade80;
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}

.leaderboard-list {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #4ade80 #1a1a2e;
}

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

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

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

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

.leaderboard-entry {
    display: grid;
    grid-template-columns: 60px 1fr 120px 100px;
    gap: 15px;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(74, 222, 128, 0.2);
    transition: all 0.3s ease;
}

.leaderboard-entry:hover {
    background: rgba(74, 222, 128, 0.1);
    border-color: rgba(74, 222, 128, 0.4);
    transform: translateX(5px);
}

.leaderboard-entry.current-user {
    background: rgba(74, 222, 128, 0.15);
    border-color: #4ade80;
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.3);
}

.position {
    font-weight: bold;
    font-size: 1.1rem;
    text-align: center;
    color: #4ade80;
}

.username {
    font-weight: 500;
    color: #ffffff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.score {
    font-weight: bold;
    color: #4ade80;
    text-align: right;
    font-size: 1.1rem;
}

.date {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    text-align: right;
}

.no-scores {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    padding: 40px 20px;
}

/* Score Submission Notifications */
.score-submission-success,
.score-submission-error {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    padding: 15px 20px;
    border-radius: 10px;
    font-family: 'Orbitron', Arial, sans-serif;
    font-weight: 500;
    animation: slideInRight 0.3s ease-out;
    max-width: 300px;
}

.score-submission-success {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    color: white;
    border: 2px solid #4ade80;
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.4);
}

.score-submission-error {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    color: white;
    border: 2px solid #f56565;
    box-shadow: 0 0 15px rgba(245, 101, 101, 0.4);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-content .icon {
    font-size: 1.2rem;
}

.notification-content .message {
    font-size: 0.9rem;
}

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

/* Loading States */
.leaderboard-loading {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.7);
}

.leaderboard-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #4ade80;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .leaderboard-container {
        margin: 10px;
        padding: 15px;
    }
    
    .leaderboard-entry {
        grid-template-columns: 50px 1fr 80px 80px;
        gap: 10px;
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .position {
        font-size: 1rem;
    }
    
    .score {
        font-size: 1rem;
    }
    
    .date {
        font-size: 0.7rem;
    }
    
    .leaderboard-header h2 {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .leaderboard-entry {
        grid-template-columns: 40px 1fr 70px;
        gap: 8px;
        padding: 8px;
        font-size: 0.8rem;
    }
    
    .date {
        display: none;
    }
    
    .score-submission-success,
    .score-submission-error {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Tournament Specific Styles */
.leaderboard-container.tournament {
    border-color: #f59e0b;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.leaderboard-container.tournament .leaderboard-header h2 {
    color: #f59e0b;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.leaderboard-container.tournament .position {
    color: #f59e0b;
}

.leaderboard-container.tournament .score {
    color: #f59e0b;
}

/* PVP Specific Styles */
.leaderboard-container.pvp {
    border-color: #ef4444;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.leaderboard-container.pvp .leaderboard-header h2 {
    color: #ef4444;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.leaderboard-container.pvp .position {
    color: #ef4444;
}

.leaderboard-container.pvp .score {
    color: #ef4444;
}
