/**
 * chat_vocal.css - Styles pour le système de messages vocaux
 */

/* ============================================
   BOUTON MICROPHONE
   ============================================ */

#mic-button {
    padding: 0;
    background: #3ba55c !important;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: opacity 0.2s, transform 0.2s;
    margin-right: 4px;
    box-shadow: 0 2px 8px rgba(59, 165, 92, 0.35) !important;
    position: relative;
    overflow: visible;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

#mic-button::before {
    display: none;
}

#mic-button:hover {
    background: #2d8a4e !important;
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(59, 165, 92, 0.5) !important;
    opacity: 1;
}

#mic-button:active {
    transform: scale(0.95);
}

/* État enregistrement */
#mic-button.recording {
    background: #ed4245 !important;
    box-shadow: 0 2px 8px rgba(237, 66, 69, 0.4) !important;
    animation: pulse-mic 1.5s infinite;
    opacity: 1;
}

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

/* ============================================
   INDICATEUR D'ENREGISTREMENT
   ============================================ */

#recording-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #ed4245 0%, #c73537 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 14px;
    z-index: 10000;
    animation: pulse-indicator 1.5s infinite, slide-in 0.3s ease-out;
    box-shadow: 0 4px 20px rgba(237, 66, 69, 0.5);
    display: flex;
    align-items: center;
    gap: 8px;
}

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

@keyframes slide-in {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   MESSAGES VOCAUX
   ============================================ */

.vocal-message {
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.08) 0%, rgba(88, 101, 242, 0.05) 100%);
    border-left: 3px solid #5865f2;
    padding: 12px;
    border-radius: 8px;
    margin: 8px 0;
    transition: all 0.2s;
}

.vocal-message:hover {
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.12) 0%, rgba(88, 101, 242, 0.08) 100%);
    transform: translateX(2px);
}

/* Conteneur audio */
.vocal-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.15);
    padding: 10px 16px;
    border-radius: 25px;
    transition: all 0.2s;
}

.vocal-container:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* Player audio personnalisé */
.vocal-container audio {
    max-width: 320px;
    height: 36px;
    border-radius: 20px;
    outline: none;
}

.vocal-container audio::-webkit-media-controls-panel {
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.2) 0%, rgba(88, 101, 242, 0.1) 100%);
    border-radius: 20px;
}

.vocal-container audio::-webkit-media-controls-play-button {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.vocal-container audio::-webkit-media-controls-play-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.vocal-container audio::-webkit-media-controls-timeline {
    border-radius: 10px;
}

.vocal-container audio::-webkit-media-controls-current-time-display,
.vocal-container audio::-webkit-media-controls-time-remaining-display {
    color: #dcddde;
}

/* Affichage du temps */
.vocal-time {
    color: #8a8a8a;
    font-size: 13px;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

/* ============================================
   MODAL DE TEST DU MICROPHONE
   ============================================ */

.mic-test-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #2f3136 0%, #202225 100%);
    padding: 35px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    z-index: 10000;
    text-align: center;
    min-width: 350px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mic-test-modal h3 {
    margin: 0 0 25px 0;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
}

/* Niveau audio */
#level-meter {
    height: 24px;
    background: linear-gradient(135deg, #1e1e1e 0%, #0f0f0f 100%);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 25px;
    border: 2px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
}

#level-bar {
    height: 100%;
    background: linear-gradient(90deg, 
        #43b581 0%, 
        #43b581 60%, 
        #faa61a 70%, 
        #faa61a 85%, 
        #f04747 100%
    );
    width: 0%;
    transition: width 0.1s ease-out;
    box-shadow: 0 0 15px rgba(67, 181, 129, 0.5);
}

.mic-test-modal p {
    color: #b9bbbe;
    margin: 0 0 25px 0;
    font-size: 15px;
}

#close-test {
    padding: 12px 35px;
    background: linear-gradient(135deg, #5865f2 0%, #4752c4 100%);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
}

#close-test:hover {
    background: linear-gradient(135deg, #4752c4 0%, #3c44a8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(88, 101, 242, 0.4);
}

#close-test:active {
    transform: translateY(0);
}

/* ============================================
   MESSAGES VOCAUX CORROMPUS
   ============================================ */

.vocal-message.corrupted {
    background: linear-gradient(135deg, rgba(237, 66, 69, 0.1) 0%, rgba(237, 66, 69, 0.05) 100%);
    border-left-color: #ed4245;
}

.vocal-message.corrupted .message-content {
    color: #ff6b6b;
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

.vocal-message {
    animation: fadeIn 0.3s ease-out;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    #mic-button {
        font-size: 20px;
        margin-right: 2px;
    }
    
    #recording-indicator {
        top: 10px;
        right: 10px;
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .vocal-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .vocal-container audio {
        max-width: 100%;
        width: 100%;
    }
    
    .mic-test-modal {
        min-width: 90%;
        padding: 25px;
    }
}

/* ============================================
   THÈME JOUR (si nécessaire)
   ============================================ */

[data-theme="light"] .vocal-message {
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.12) 0%, rgba(88, 101, 242, 0.08) 100%);
}

[data-theme="light"] .vocal-container {
    background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .vocal-container:hover {
    background: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .vocal-time {
    color: #5a5a5a;
}

[data-theme="light"] .mic-test-modal {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .mic-test-modal h3 {
    color: #202225;
}

[data-theme="light"] .mic-test-modal p {
    color: #5a5a5a;
}
