/**
 * leaderboard.css - Styles for the Vietnamese Hangman leaderboard
 */

.leaderboard-container {
    max-width: 900px;
    margin: 0 auto 40px;
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

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

.leaderboard-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #343a40;
    margin: 0;
    padding-bottom: 5px;
    border-bottom: 3px solid #007bff;
}

.leaderboard-filters {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.leaderboard-filter {
    padding: 8px 15px;
    border-radius: 5px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    color: #495057;
}

.leaderboard-filter:hover {
    background-color: #e9ecef;
    text-decoration: none;
}

.leaderboard-filter.active {
    background-color: #007bff;
    color: white;
    border-color: #0062cc;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.leaderboard-table thead th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
}

.player-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #e9ecef;
}

.player-name {
    font-weight: 500;
}

.rank-cell {
    font-weight: 700;
    text-align: center;
    width: 60px;
    font-size: 1.1rem;
}

.rank-1 {
    color: gold;
    font-size: 1.3rem;
}

.rank-2 {
    color: silver;
    font-size: 1.2rem;
}

.rank-3 {
    color: #cd7f32; /* bronze */
    font-size: 1.1rem;
}

.stats-cell {
    text-align: right;
    font-weight: 500;
}

.win-rate-cell {
    text-align: center;
}

.win-rate-bar {
    display: inline-block;
    width: 100px;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 3px;
}

.win-rate-progress {
    height: 100%;
    background-color: #28a745;
}

.current-user-row {
    background-color: #fff3cd;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.page-link {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 5px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #007bff;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.page-link:hover {
    background-color: #e9ecef;
    text-decoration: none;
}

.page-link.active {
    background-color: #007bff;
    color: white;
    border-color: #0062cc;
}

.page-link.disabled {
    color: #6c757d;
    pointer-events: none;
    cursor: default;
}

.guest-score-card {
    margin-top: 20px;
    padding: 15px;
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 5px;
    text-align: center;
}

.guest-score {
    font-weight: bold;
    font-size: 1.2rem;
    color: #856404;
}

.register-prompt {
    margin-top: 10px;
}

.dual-language {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.vi-text {
    color: #6c757d;
    margin-left: 5px;
    font-size: 0.9em;
}

.leaderboard-empty {
    text-align: center;
    padding: 30px;
    color: #6c757d;
    background-color: #f8f9fa;
    border-radius: 5px;
    margin: 20px 0;
}

.current-user-stats {
    background-color: #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
}

.current-user-stats h3 {
    margin-top: 0;
    border-bottom: 1px solid #ced4da;
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.stats-item {
    text-align: center;
    padding: 10px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stats-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 5px;
}

.stats-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #343a40;
}

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

.text-center {
    text-align: center;
}

.table-responsive {
    overflow-x: auto;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .leaderboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .leaderboard-table th, 
    .leaderboard-table td {
        padding: 10px 8px;
    }
    
    .player-avatar {
        width: 30px;
        height: 30px;
    }
    
    .win-rate-bar {
        width: 60px;
    }
    
    .hide-on-mobile {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .leaderboard-table {
        font-size: 0.8rem;
    }
    
    .leaderboard-table th, 
    .leaderboard-table td {
        padding: 8px 5px;
    }
    
    .player-avatar {
        width: 25px;
        height: 25px;
    }
}