/* ============================================================ */
/* Japanese Pronunciation Practice Styles */
/* Version: 2.20.0 */
/* ============================================================ */

/* ============ Pronunciation Controls Panel ============ */
.pronunciation-controls {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    color: white;
}

.pronunciation-controls h3 {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.95;
}

.control-group select,
.control-group input[type="range"] {
    padding: 8px 12px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 14px;
}

.control-group select {
    cursor: pointer;
}

.control-group select option {
    background: #4c1d95;
    color: white;
}

.rate-display {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    min-width: 60px;
}

input[type="range"] {
    accent-color: white;
    cursor: pointer;
}

.controls-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.controls-actions button {
    flex: 1;
    min-width: 140px;
    padding: 10px 16px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.controls-actions button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.controls-actions button:active {
    transform: translateY(0);
}

/* ============ Pronunciation Buttons ============ */
.pronunciation-buttons {
    display: flex;
    gap: 12px;
    margin: 16px 0;
    flex-wrap: wrap;
}

.pron-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pron-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.pron-btn-listen {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.pron-btn-listen:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.pron-btn-test {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.pron-btn-test:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(245, 87, 108, 0.3);
}

/* ============ Speaking Animation ============ */
.pron-btn.speaking {
    animation: pulse-speak 1s ease-in-out infinite;
}

@keyframes pulse-speak {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* ============ Listening Animation ============ */
.pron-btn.listening {
    background: linear-gradient(135deg, #ffa726 0%, #fb8c00 100%);
    animation: pulse-listening 1.5s ease-in-out infinite;
}

@keyframes pulse-listening {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 167, 38, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(255, 167, 38, 0);
    }
}

/* ============ Feedback Display ============ */
.pronunciation-feedback {
    margin: 16px 0;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 15px;
    display: none;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feedback-listening {
    background: #fff3cd;
    color: #856404;
    border: 2px solid #ffc107;
}

.feedback-success {
    background: #d4edda;
    color: #155724;
    border: 2px solid #28a745;
}

.feedback-error {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #dc3545;
}

.feedback-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 2px solid #17a2b8;
}

/* ============ Statistics Display ============ */
.pronunciation-stats {
    margin: 12px 0;
    padding: 10px 14px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    text-align: center;
    border: 1px solid #dee2e6;
}

.pronunciation-stats.good {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.pronunciation-stats.fair {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.pronunciation-stats.poor {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

/* ============ Pronunciation Card Container ============ */
.pronunciation-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

/* ============ Browser Support Warning ============ */
.browser-warning {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    color: #856404;
    display: flex;
    align-items: center;
    gap: 12px;
}

.browser-warning i {
    font-size: 24px;
}

.browser-warning strong {
    display: block;
    margin-bottom: 4px;
}

/* ============ Mobile Responsive ============ */
@media (max-width: 640px) {
    .pronunciation-controls {
        padding: 16px;
    }
    
    .controls-grid {
        grid-template-columns: 1fr;
    }
    
    .pronunciation-buttons {
        flex-direction: column;
    }
    
    .pron-btn {
        width: 100%;
        min-width: unset;
    }
    
    .controls-actions {
        flex-direction: column;
    }
    
    .controls-actions button {
        width: 100%;
        min-width: unset;
    }
}

/* ============ Loading State ============ */
.pron-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============ Accessibility ============ */
.pron-btn:focus {
    outline: 3px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}

input[type="range"]:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

select:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* ============ Success Rate Colors ============ */
.rate-excellent {
    color: #28a745;
}

.rate-good {
    color: #17a2b8;
}

.rate-fair {
    color: #ffc107;
}

.rate-poor {
    color: #dc3545;
}
