/* Typing Test Plugin Styles */
/* Color Palette: Black, Purple #653a56, Grey #9a988b, Teal #0e5d64 */

#typing-test-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #000000;
    color: #9a988b;
    padding: 40px;
    border-radius: 12px;
    max-width: 900px;
    margin: 20px auto;
    box-sizing: border-box;
}

#typing-test-container * {
    box-sizing: border-box;
}

/* Header */
.typing-test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.typing-test-header h2 {
    color: #0e5d64;
    margin: 0;
    font-size: 28px;
    font-weight: 600;
}

/* Mode Selector */
.mode-selector {
    display: flex;
    gap: 10px;
}

.mode-btn {
    background-color: transparent;
    border: 2px solid #653a56;
    color: #9a988b;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    background-color: #653a56;
    color: #ffffff;
}

.mode-btn.active {
    background-color: #653a56;
    color: #ffffff;
}

/* Stats Display */
.typing-test-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 48px;
    font-weight: 700;
    color: #0e5d64;
    line-height: 1;
}

.stat-label {
    font-size: 14px;
    color: #9a988b;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
    display: block;
}

/* Quote Display */
.typing-test-quote-container {
    background-color: #0a0a0a;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 20px;
    min-height: 120px;
    border: 1px solid #1a1a1a;
}

#quote-display {
    font-size: 24px;
    line-height: 1.8;
    letter-spacing: 0.5px;
    word-wrap: break-word;
}

#quote-display .char {
    transition: color 0.1s ease;
}

#quote-display .char.correct {
    color: #0e5d64;
}

#quote-display .char.incorrect {
    color: #ff6b6b;
    text-decoration: underline;
}

#quote-display .char.current {
    background-color: #653a56;
    color: #ffffff;
    border-radius: 2px;
}

#quote-display .char.pending {
    color: #4a4a4a;
}

/* Input Field */
#typing-input {
    width: 100%;
    background-color: #0a0a0a;
    border: 2px solid #653a56;
    color: #ffffff;
    padding: 15px 20px;
    font-size: 18px;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s ease;
}

#typing-input:focus {
    border-color: #0e5d64;
}

#typing-input::placeholder {
    color: #4a4a4a;
}

/* Actions */
.typing-test-actions {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.action-btn {
    background-color: transparent;
    border: 2px solid #653a56;
    color: #9a988b;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.action-btn:hover {
    background-color: #653a56;
    color: #ffffff;
}

.action-btn.primary {
    background-color: #0e5d64;
    border-color: #0e5d64;
    color: #ffffff;
}

.action-btn.primary:hover {
    background-color: #0a4a50;
    border-color: #0a4a50;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: #0a0a0a;
    border: 2px solid #653a56;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    max-width: 450px;
    width: 90%;
}

.modal-content h3 {
    color: #0e5d64;
    margin: 0 0 30px 0;
    font-size: 28px;
}

.results-stats {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-bottom: 30px;
}

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

.result-value {
    display: block;
    font-size: 42px;
    font-weight: 700;
    color: #0e5d64;
}

.result-label {
    font-size: 14px;
    color: #9a988b;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.leaderboard-submit p {
    color: #9a988b;
    margin-bottom: 15px;
}

#nickname-input {
    width: 100%;
    background-color: #000000;
    border: 2px solid #653a56;
    color: #ffffff;
    padding: 12px 15px;
    font-size: 16px;
    border-radius: 8px;
    outline: none;
    margin-bottom: 20px;
    text-align: center;
}

#nickname-input:focus {
    border-color: #0e5d64;
}

#nickname-input::placeholder {
    color: #4a4a4a;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Leaderboard */
.leaderboard-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #1a1a1a;
}

.leaderboard-section h3 {
    color: #0e5d64;
    margin: 0 0 20px 0;
    font-size: 24px;
    text-align: center;
}

.leaderboard-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.leaderboard-tab {
    background-color: transparent;
    border: 2px solid #653a56;
    color: #9a988b;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.leaderboard-tab:hover {
    background-color: #653a56;
    color: #ffffff;
}

.leaderboard-tab.active {
    background-color: #653a56;
    color: #ffffff;
}

#leaderboard-table {
    overflow-x: auto;
}

#leaderboard-table table {
    width: 100%;
    border-collapse: collapse;
}

#leaderboard-table th,
#leaderboard-table td {
    padding: 15px 20px;
    text-align: left;
}

#leaderboard-table th {
    background-color: #0a0a0a;
    color: #0e5d64;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
    border-bottom: 2px solid #653a56;
}

#leaderboard-table td {
    border-bottom: 1px solid #1a1a1a;
    color: #9a988b;
}

#leaderboard-table tr:hover td {
    background-color: #0a0a0a;
}

#leaderboard-table tr:first-child td {
    color: #ffd700;
    font-weight: 600;
}

#leaderboard-table tr:nth-child(2) td {
    color: #c0c0c0;
}

#leaderboard-table tr:nth-child(3) td {
    color: #cd7f32;
}

.leaderboard-empty {
    text-align: center;
    padding: 30px;
    color: #4a4a4a;
}

/* Responsive */
@media (max-width: 600px) {
    #typing-test-container {
        padding: 20px;
    }
    
    .typing-test-header {
        flex-direction: column;
        text-align: center;
    }
    
    .typing-test-stats {
        gap: 30px;
    }
    
    .stat-value {
        font-size: 36px;
    }
    
    #quote-display {
        font-size: 18px;
    }
    
    .results-stats {
        gap: 30px;
    }
    
    .result-value {
        font-size: 32px;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
}
