/* Typewriting Practice Styles */
.typewriting-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.config-panel {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.config-panel label {
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
    color: #495057;
}

.config-panel .form-select {
    margin-bottom: 15px;
}

.practice-area {
    text-align: center;
    /* padding: 40px 20px; */
    min-height: 500px;
    outline: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.practice-area:focus {
    background-color: #f8f9fa;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.25);
    border: 2px solid #007bff;
}

.practice-area.error {
    background-color: #fff5f5;
    border: 2px solid #dc3545;
    box-shadow: 0 0 0 3px rgba(220,53,69,0.25);
}

/* Word Display Area */
.word-display {
    margin-bottom: 40px;
}

.current-word {
    font-size: 2.5rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.1em;
    margin-bottom: 20px;
    min-height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.current-word .letter {
    display: inline-block;
    padding: 5px 2px;
    margin: 0 1px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.current-word .letter.correct {
    background-color: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.current-word .letter.current {
    background-color: #cce7ff;
    color: #004085;
    border: 2px solid #80bdff;
    border-bottom: 3px solid #007bff;
    animation: blink 1s infinite;
}

.current-word .letter.incorrect {
    background-color: #f8d7da;
    color: #721c24;
    border: 2px solid #f1aeb5;
    animation: shake 0.5s ease-in-out;
}

.current-word .letter.pending {
    color: #6c757d;
    background-color: transparent;
}

@keyframes blink {
    0%, 50% { border-bottom-color: #007bff; }
    51%, 100% { border-bottom-color: transparent; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.word-progress {
    font-size: 1.2rem;
    color: #6c757d;
    margin-bottom: 20px;
}

/* Word Information */
.word-info {
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.phonetic {
    font-size: 1.4rem;
    color: #007bff;
    font-style: italic;
    margin-bottom: 15px;
    font-family: 'Times New Roman', serif;
}

.definition {
    font-size: 1.1rem;
    color: #495057;
    line-height: 1.6;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #007bff;
    border-right: 4px solid #007bff;
}

.definition .part-of-speech {
    font-weight: 600;
    color: #007bff;
    font-style: italic;
    margin-right: 10px;
}

.definition .meaning {
    margin-bottom: 8px;
}

.definition .example {
    font-style: italic;
    color: #6c757d;
    margin-left: 20px;
    border-left: 2px solid #dee2e6;
    padding-left: 10px;
}

/* Input Area */
.input-area {
    margin-bottom: 40px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

#typing-input {
    font-size: 1.5rem;
    text-align: center;
    padding: 15px;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.05em;
}

#typing-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

#typing-input.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220,53,69,0.25);
}

/* Statistics */
.statistics {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    background: #f8f9fa;
    border-radius: 10px;
    margin-top: 20px;
}

.stat-item {
    text-align: center;
    min-width: 115px;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 5px;
    font-weight: 500;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #007bff;
}

/* Results Modal */
.result-stats {
    text-align: left;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #dee2e6;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item strong {
    color: #495057;
}

.result-item span {
    color: #007bff;
    font-weight: 600;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .current-word {
        font-size: 1.8rem;
    }
    
    .statistics {
        gap: 15px;
    }
    
    .stat-item {
        min-width: 70px;
    }
    
    .config-panel .row > div {
        margin-bottom: 15px;
    }
    
    .practice-area {
        /* padding: 20px 10px; */
    }
}

@media (max-width: 480px) {
    .current-word {
        font-size: 1.5rem;
    }
    
    .statistics {
        flex-direction: column;
        gap: 10px;
    }
    
    .stat-item {
        min-width: auto;
    }
}

/* Success Animation */
.word-complete {
    animation: wordComplete 0.6s ease-in-out;
}

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

/* Error Sound Visual Feedback */
.error-feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(220, 53, 69, 0.9);
    color: white;
    padding: 20px;
    border-radius: 10px;
    font-size: 1.2rem;
    z-index: 1000;
    animation: errorFeedback 0.5s ease-in-out;
}

@keyframes errorFeedback {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}