/* Pronunciation Practice Component Styles */

.pronunciation-practice {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    padding: 24px;
    margin: 20px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.practice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #dee2e6;
}

.practice-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 600;
}

.practice-toggle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.practice-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.practice-toggle:active {
    transform: translateY(0);
}

.toggle-icon {
    font-size: 1.1rem;
}



/* Recording Section */
.recording-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.recording-section h4 {
    margin: 0 0 16px 0;
    color: #495057;
    font-size: 1.2rem;
    font-weight: 600;
}

.recording-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.record-btn, .play-btn, .compare-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.record-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
}

.record-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.3);
}

.record-btn.recording {
    background: linear-gradient(135deg, #ff4757 0%, #c44569 100%);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.play-btn {
    background: linear-gradient(135deg, #2ed573 0%, #1e90ff 100%);
    color: white;
}

.play-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 213, 115, 0.3);
}

.play-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

.compare-btn {
    background: linear-gradient(135deg, #ffa726 0%, #ff7043 100%);
    color: white;
}

.compare-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 167, 38, 0.3);
}

.compare-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

.recording-visualizer {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    border: 2px dashed #dee2e6;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100px;
}

.recording-visualizer canvas {
    border-radius: 6px;
    background: white;
}

.recording-status {
    text-align: center;
    color: #6c757d;
    font-weight: 500;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

/* Comparison Section */
.comparison-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* AI Analysis Results */
.ai-analysis-results {
    background: linear-gradient(135deg, #f8f9fa 0%, #e3f2fd 100%);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    border: 2px solid #2196f3;
}

.ai-analysis-results h5 {
    margin: 0 0 16px 0;
    color: #1976d2;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
}

.score-overview {
    text-align: center;
    margin-bottom: 20px;
}

.overall-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.score-label {
    font-weight: 600;
    color: #495057;
}

.score-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1976d2;
}

.score-grade {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4caf50;
    background: #e8f5e8;
    padding: 4px 12px;
    border-radius: 20px;
    border: 2px solid #4caf50;
}

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

.score-item {
    background: white;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.score-name {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.score-bar {
    width: 100%;
    height: 12px;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.score-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.8s ease;
}

.score-fill.score-excellent {
    background: linear-gradient(90deg, #4caf50, #66bb6a);
}

.score-fill.score-good {
    background: linear-gradient(90deg, #8bc34a, #9ccc65);
}

.score-fill.score-fair {
    background: linear-gradient(90deg, #ff9800, #ffb74d);
}

.score-fill.score-poor {
    background: linear-gradient(90deg, #f44336, #ef5350);
}

.score-fill.score-very-poor {
    background: linear-gradient(90deg, #d32f2f, #e57373);
}

.score-percentage {
    font-weight: 600;
    color: #1976d2;
    font-size: 0.9rem;
}

.ai-feedback {
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.ai-feedback h6 {
    margin: 0 0 12px 0;
    color: #1976d2;
    font-size: 1rem;
    font-weight: 600;
}

.feedback-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feedback-item {
    background: #e3f2fd;
    color: #1565c0;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    border-left: 3px solid #2196f3;
}

/* AI Analysis Controls */
.ai-analysis-controls {
    text-align: center;
    margin-top: 20px;
}

/* Analysis Progress Bar */
.analysis-progress {
    background: linear-gradient(135deg, #f8f9fa 0%, #e3f2fd 100%);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    border: 2px solid #2196f3;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.1);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.progress-text {
    font-weight: 600;
    color: #1976d2;
    font-size: 1rem;
}

.progress-percentage {
    font-weight: 700;
    color: #2196f3;
    font-size: 1.1rem;
    background: white;
    padding: 4px 12px;
    border-radius: 20px;
    border: 2px solid #2196f3;
}

.progress-bar-container {
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 16px;
    background: #e3f2fd;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #bbdefb;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2196f3, #42a5f5);
    border-radius: 6px;
    width: 0%;
    transition: width 0.5s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.step {
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #6c757d;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
}

.step.completed {
    background: #e8f5e8;
    color: #2e7d32;
    border-color: #4caf50;
    transform: scale(1.05);
}

.step.completed::before {
    content: '✅';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.step:not(.completed)::before {
    content: '⏳';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #ff9800;
}

.analyze-btn {
    background: linear-gradient(135deg, #9c27b0 0%, #673ab7 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.analyze-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(156, 39, 176, 0.3);
}

.analyze-btn:active {
    transform: translateY(0);
}

.analyze-icon {
    font-size: 1.2rem;
}

/* Enhanced Feedback */
.feedback-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.feedback-score {
    font-size: 1.1rem;
    color: #1976d2;
    margin-bottom: 8px;
}

.feedback-transcription {
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.4;
}

.comparison-section h4 {
    margin: 0 0 20px 0;
    color: #495057;
    font-size: 1.2rem;
    font-weight: 600;
}

.comparison-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.correct-pronunciation, .user-pronunciation {
    text-align: center;
}

.correct-pronunciation h5, .user-pronunciation h5 {
    margin: 0 0 12px 0;
    color: #495057;
    font-size: 1rem;
    font-weight: 600;
}

.correct-pronunciation h5 {
    color: #27ae60;
}

.user-pronunciation h5 {
    color: #e74c3c;
}

.comparison-content audio {
    width: 100%;
    border-radius: 8px;
}

.comparison-feedback {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    border-left: 4px solid #667eea;
}

.feedback-content h5 {
    margin: 0 0 12px 0;
    color: #495057;
    font-size: 1rem;
    font-weight: 600;
}

.feedback-tips {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feedback-tip {
    background: white;
    color: #495057;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    border-left: 3px solid #667eea;
}

/* Toast Messages */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.toast-info {
    background: #3498db;
}

.toast-success {
    background: #27ae60;
}

.toast-error {
    background: #e74c3c;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .pronunciation-practice {
        padding: 16px;
        margin: 16px 0;
    }
    
    .practice-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .practice-toggle {
        align-self: center;
    }
    
    .phonetic-info {
        grid-template-columns: 1fr;
    }
    
    .recording-controls {
        justify-content: center;
    }
    
    .comparison-content {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .recording-visualizer canvas {
        width: 100%;
        height: auto;
    }
    
    .progress-steps {
        grid-template-columns: 1fr;
    }
    
    .progress-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .pronunciation-practice {
        padding: 12px;
    }
    
    .practice-header h3 {
        font-size: 1.3rem;
    }
    
    .record-btn, .play-btn, .compare-btn {
        padding: 10px 16px;
        font-size: 0.8rem;
    }
    
    .recording-controls {
        flex-direction: column;
        align-items: center;
    }
}
