/* ========================================
   STYLES POUR L'ENREGISTREMENT VOCAL
   ======================================== */

.voice-recorder-interface {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.3);
    margin: 20px 0;
    text-align: center;
}

.recorder-header h4 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 600;
}

.recorder-header p {
    margin: 0 0 25px 0;
    opacity: 0.9;
    font-size: 16px;
}

/* Contrôles d'enregistrement */
.recorder-controls {
    margin-bottom: 20px;
}

.btn-record, .btn-stop {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border: none;
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
    min-width: 250px;
}

.btn-stop {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
    animation: pulse 1.5s ease-in-out infinite;
}

.btn-record:hover, .btn-stop:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.5);
}

.btn-stop:hover {
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.5);
}

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

/* Statut d'enregistrement */
.recording-status {
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 600;
}

.recording-idle {
    color: rgba(255, 255, 255, 0.8);
}

.recording-active {
    color: #ff6b6b;
    animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.5; }
}

/* Visualiseur audio */
.audio-visualizer {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

#audio-visualizer-canvas {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
}

/* Lecteur audio */
.audio-player-container {
    margin-top: 25px;
}

.audio-player-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.recording-info h4 {
    margin: 0 0 10px 0;
    font-size: 20px;
}

.recording-info p {
    margin: 5px 0;
    opacity: 0.9;
    font-size: 14px;
}

.audio-controls {
    margin: 20px 0;
}

.audio-element {
    width: 100%;
    max-width: 400px;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
}

.audio-element::-webkit-media-controls-panel {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
}

/* Actions d'enregistrement */
.recording-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 15px;
}

.btn-action {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.btn-play {
    background: linear-gradient(135deg, #4CAF50, #45a049);
}

.btn-transcribe {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

.btn-save {
    background: linear-gradient(135deg, #FF9800, #F57C00);
}

.btn-delete {
    background: linear-gradient(135deg, #f44336, #d32f2f);
}

/* Conteneur de transcription */
.transcription-container {
    margin-top: 25px;
}

.transcription-loading {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.transcription-loading p {
    margin: 5px 0;
    font-size: 16px;
}

.transcription-loading small {
    opacity: 0.7;
}

.transcription-result {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.transcription-result h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
}

.transcription-text {
    margin-bottom: 15px;
}

#transcribed-text {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 15px;
    font-size: 16px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.3s ease;
}

#transcribed-text:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

.transcription-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-edit {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
}

.btn-copy {
    background: linear-gradient(135deg, #00BCD4, #0097A7);
}

.btn-speak {
    background: linear-gradient(135deg, #FF5722, #D84315);
}

/* Messages d'erreur et de succès */
.voice-error-message {
    animation: errorPop 0.3s ease;
}

.voice-success-message {
    animation: messagePopIn 0.3s ease;
}

@keyframes errorPop {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.error-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.error-icon {
    font-size: 24px;
}

.error-text {
    font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .voice-recorder-interface {
        padding: 20px 15px;
        margin: 15px 0;
    }
    
    .recorder-header h4 {
        font-size: 20px;
    }
    
    .btn-record, .btn-stop {
        padding: 12px 25px;
        font-size: 16px;
        min-width: 200px;
    }
    
    .recording-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-action {
        width: 100%;
        max-width: 200px;
        padding: 10px 15px;
    }
    
    .transcription-actions {
        flex-direction: column;
        align-items: center;
    }
    
    #audio-visualizer-canvas {
        width: 250px;
        height: 80px;
    }
    
    .audio-element {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .voice-recorder-interface {
        padding: 15px 10px;
    }
    
    .recorder-header h4 {
        font-size: 18px;
    }
    
    .recorder-header p {
        font-size: 14px;
    }
    
    .btn-record, .btn-stop {
        padding: 10px 20px;
        font-size: 14px;
        min-width: 180px;
    }
    
    #audio-visualizer-canvas {
        width: 200px;
        height: 60px;
    }
    
    .transcription-result,
    .audio-player-card {
        padding: 15px;
    }
    
    #transcribed-text {
        font-size: 14px;
        padding: 12px;
    }
}

/* Animations d'entrée */
.voice-recorder-interface {
    animation: slideInUp 0.5s ease;
}

@keyframes slideInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* États de permission */
.permission-request {
    background: rgba(255, 193, 7, 0.1);
    border: 2px solid #FFC107;
    color: #FFC107;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.permission-granted {
    background: rgba(76, 175, 80, 0.1);
    border: 2px solid #4CAF50;
    color: #4CAF50;
}

.permission-denied {
    background: rgba(244, 67, 54, 0.1);
    border: 2px solid #f44336;
    color: #f44336;
}

