/* High Scores Page Styles */
.high-scores-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* High Score Modal Styles */
.error-message {
    display: none;
    margin-bottom: 10px;
    margin-top: 8px;
    font-size: 13px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.modal-header h2 {
    margin: 0;
    color: #4CAF50;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #fff;
}

.modal-body {
    padding: 20px 0;
}

.modal-body p {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
}

.form-group input {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #444;
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.submit-button,
.leaderboard-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    flex: 1;
    min-width: 120px;
}

.submit-button:hover,
.leaderboard-button:hover {
    background-color: #45a049;
}

.back-to-game {
    text-align: center;
    margin-top: 30px;
}

.back-button i {
    width: 20px;
    height: 20px;
}

.submit-button:disabled {
    background-color: #555;
    cursor: not-allowed;
}

.success-message {
    color: #4CAF50;
    margin-top: 10px;
}

.high-scores-container h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--accent-color);
    font-size: 2.5rem;
}

.game-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: var(--bg-primary);
    border-radius: 0.5rem;
    position: relative;
    width: 100%;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.game-selector label {
    white-space: nowrap;
    margin-right: 1rem;
    font-weight: bold;
    color: var(--text-primary);
}

.select2-container--classic .select2-selection--single {
    height: 42px;
    border-radius: 0.25rem;
    border: 1px solid var(--accent-color);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
}

.select2-container--classic .select2-selection--single:hover {
    border-color: var(--accent-hover);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3);
}

.select2-container--classic .select2-selection--single .select2-selection__rendered {
    color: var(--text-primary);
    line-height: 42px;
    padding-left: 15px;
}

.select2-container--classic .select2-selection--single .select2-selection__arrow {
    height: 40px;
}

.select2-container--classic .select2-dropdown {
    border-color: var(--accent-color);
    background-color: var(--bg-primary);
}

.select2-container--classic .select2-results__option {
    padding: 8px 15px;
    color: var(--text-primary) !important;
    background-color: var(--bg-primary) !important;
}

.select2-container--classic .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: var(--accent-color) !important;
    color: white !important;
}

.select2-container--classic .select2-search--dropdown .select2-search__field {
    border: 1px solid var(--accent-color);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    padding: 8px;
    border-radius: 4px;
}

.leaderboard {
    background-color: var(--bg-primary);
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.leaderboard h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-size: 1.8rem;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 0.5rem;
    overflow: hidden;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-table th {
    background-color: var(--accent-color);
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

.leaderboard-table tr:last-child td {
    border-bottom: none;
}

.leaderboard-table tr:nth-child(even) {
    background-color: var(--bg-secondary);
}

.leaderboard-table tr:hover {
    background-color: var(--accent-color);
    color: white;
}

.leaderboard-table tr:hover td {
    color: white;
}

.leaderboard-table td:first-child {
    font-weight: bold;
    color: var(--accent-color);
}

.leaderboard-table td.loading,
.leaderboard-table td.error,
.leaderboard-table td.no-scores {
    padding: 2rem;
    text-align: center;
}

.leaderboard-table td.loading {
    color: var(--text-secondary);
}

.leaderboard-table td.error {
    color: #e74c3c;
}

.leaderboard-table td.no-scores {
    color: var(--text-secondary);
    font-style: italic;
}

/* Medal icons for top 3 */
.leaderboard-table tr:nth-child(1) td:first-child::before {
    content: "🥇 ";
    font-size: 1.4rem;
}

.leaderboard-table tr:nth-child(2) td:first-child::before {
    content: "🥈 ";
    font-size: 1.4rem;
}

.leaderboard-table tr:nth-child(3) td:first-child::before {
    content: "🥉 ";
    font-size: 1.4rem;
}

.leaderboard-table tr:nth-child(n+4) td:first-child::before {
    content: "🏅​ ";
    visibility: hidden;
    font-size: 1.4rem;
}


/* Responsive adjustments */
@media (max-width: 768px) {
    .high-scores-container {
        padding: 1rem;
    }
    
    .leaderboard-table th,
    .leaderboard-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }
    
    .game-selector {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .game-selector label {
        margin-right: 0;
    }
}
