/**
 * ZeroTracas Voice Agent - Styles CSS
 * Version: 1.0.0
 */

/* Bouton de toggle du chatbot */
#zt-voice-toggle-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--zt-primary-color, #2563eb);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#zt-voice-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

#zt-voice-toggle-btn svg {
    width: 28px;
    height: 28px;
}

#zt-voice-toggle-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Fenêtre du chatbot */
#zt-voice-chatbot-window {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 380px;
    max-width: calc(100vw - 60px);
    height: 500px;
    max-height: calc(100vh - 100px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    transform: scale(0.8) translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

#zt-voice-chatbot-window.active {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* Header du chatbot */
.zt-voice-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: var(--zt-primary-color, #2563eb);
    color: white;
    border-radius: 16px 16px 0 0;
}

.zt-voice-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.zt-voice-close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.zt-voice-close-btn:hover {
    opacity: 0.8;
}

.zt-voice-close-btn svg {
    width: 20px;
    height: 20px;
}

/* Corps du chatbot */
.zt-voice-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Zone de messages */
.zt-voice-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.zt-voice-message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.zt-voice-message.assistant {
    align-items: flex-start;
}

.zt-voice-message.user {
    align-items: flex-end;
}

.zt-voice-message-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.zt-voice-message.assistant .zt-voice-message-bubble {
    background: #f3f4f6;
    color: #1f2937;
}

.zt-voice-message.user .zt-voice-message-bubble {
    background: var(--zt-primary-color, #2563eb);
    color: white;
}

/* Message de bienvenue */
.zt-voice-welcome-message {
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    padding: 40px 20px;
}

/* Contrôles du chatbot */
.zt-voice-controls {
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    background: #fafafa;
}

.zt-voice-mic-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* Bouton microphone */
.zt-voice-mic-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--zt-primary-color, #2563eb);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.zt-voice-mic-btn:hover {
    transform: scale(1.05);
}

.zt-voice-mic-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

.zt-voice-mic-btn.recording {
    background: #dc2626;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(220, 38, 38, 0);
    }
}

.zt-voice-mic-btn svg {
    width: 28px;
    height: 28px;
}

.zt-voice-stop-icon {
    display: none;
}

.zt-voice-mic-btn.recording .zt-voice-mic-icon {
    display: none;
}

.zt-voice-mic-btn.recording .zt-voice-stop-icon {
    display: block;
}

/* Statut */
.zt-voice-status {
    font-size: 14px;
    color: #6b7280;
    text-align: center;
    min-height: 20px;
}

.zt-voice-status.recording {
    color: #dc2626;
    font-weight: 500;
}

.zt-voice-status.processing {
    color: var(--zt-primary-color, #2563eb);
}

/* Visualiseur audio */
.zt-voice-visualizer {
    display: none;
    height: 40px;
    margin: 10px 0;
}

.zt-voice-visualizer.active {
    display: block;
}

/* Loader */
.zt-voice-loader {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top-color: var(--zt-primary-color, #2563eb);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 480px) {
    #zt-voice-chatbot-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 80px);
        bottom: 20px;
        right: 20px;
    }
    
    #zt-voice-toggle-btn {
        bottom: 20px;
        right: 20px;
    }
}

/* Position variations */
#zt-voice-toggle-btn.position-bottom-left,
#zt-voice-chatbot-window.position-bottom-left {
    right: auto;
    left: 30px;
}

#zt-voice-toggle-btn.position-top-right,
#zt-voice-chatbot-window.position-top-right {
    bottom: auto;
    top: 30px;
}

#zt-voice-toggle-btn.position-top-left,
#zt-voice-chatbot-window.position-top-left {
    bottom: auto;
    top: 30px;
    right: auto;
    left: 30px;
}

@media (max-width: 480px) {
    #zt-voice-toggle-btn.position-bottom-left,
    #zt-voice-chatbot-window.position-bottom-left {
        left: 20px;
    }
    
    #zt-voice-toggle-btn.position-top-right,
    #zt-voice-chatbot-window.position-top-right {
        top: 20px;
    }
    
    #zt-voice-toggle-btn.position-top-left,
    #zt-voice-chatbot-window.position-top-left {
        top: 20px;
        left: 20px;
    }
}
