/* ===================================
   REDARROW - ASK AI WIDGET
   Assistant IA intelligent
   =================================== */

/* ========== BOUTON ASK AI HEADER ========== */
/* Animation du dégradé tournant (comme le chat contact) */
@property --btn-gradient-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes rotateBtnGradient {
    0% { --btn-gradient-angle: 0deg; }
    100% { --btn-gradient-angle: 360deg; }
}

.ask-ai-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 46px !important;
    height: 46px !important;
    padding: 3px !important;
    border-radius: 50% !important;
    background: conic-gradient(from var(--btn-gradient-angle, 0deg), #00d4aa, #06b6d4, #8b5cf6, #a855f7, #00d4aa) !important;
    animation: rotateBtnGradient 3s linear infinite !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    margin-left: 1rem !important;
    text-decoration: none !important;
    position: relative !important;
    overflow: visible !important;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3), 0 0 20px rgba(6, 182, 212, 0.15) !important;
}

.ask-ai-btn-inner {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    background: #000000 !important;
    border-radius: 50% !important;
}

.ask-ai-btn:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 6px 25px rgba(139, 92, 246, 0.5), 0 0 35px rgba(6, 182, 212, 0.3) !important;
}

.ask-ai-btn.active {
    transform: scale(1.05) !important;
}

/* Icône cachée */
.ask-ai-btn-icon {
    display: none !important;
}

/* Texte "?" centré + "IA" en haut à droite à l'extérieur */
.ask-ai-btn-text {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
}

.ask-ai-btn-text .question-mark {
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    line-height: 1 !important;
}

.ask-ai-btn-text .ia-label {
    position: absolute !important;
    top: -6px !important;
    right: -8px !important;
    font-size: 0.55rem !important;
    font-weight: 700 !important;
    color: #a5f3fc !important;
    text-transform: uppercase !important;
    letter-spacing: 0.02em !important;
    background: rgba(0, 0, 0, 0.8) !important;
    padding: 2px 4px !important;
    border-radius: 4px !important;
    border: 1px solid rgba(6, 182, 212, 0.4) !important;
}

/* ========== MOBILE : Désactiver animation gradient pour performances ========== */
@media (max-width: 768px) {
    .ask-ai-btn {
        background: linear-gradient(135deg, #00d4aa, #06b6d4, #8b5cf6, #a855f7) !important;
        animation: none !important;
        box-shadow: none !important;
    }
}

/* ========== OVERLAY (sous le header) - transparent pour voir le site ========== */
.ask-ai-overlay {
    position: fixed !important;
    top: 80px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: transparent !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    z-index: 9998 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.4s ease !important;
}

.ask-ai-overlay.active {
    opacity: 1 !important;
    visibility: visible !important;
}

/* ========== PANNEAU TRAPÈZE FULLSCREEN (sous le header) ========== */
.ask-ai-panel {
    position: fixed !important;
    top: 80px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 9999 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    padding: 0 !important;
    background: transparent !important;
    pointer-events: none !important;
}

.ask-ai-panel.active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Conteneur trapèze avec biseau */
.ask-ai-panel-inner {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(180deg, rgba(10, 10, 15, 0.92) 0%, rgba(5, 5, 10, 0.95) 100%) !important;
    /* clip-path supprimé */
    border-top: 1px solid rgba(139, 92, 246, 0.3) !important;
    box-shadow: 
        0 0 80px rgba(139, 92, 246, 0.15),
        0 0 40px rgba(6, 182, 212, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
    transform: translateY(-20px) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    pointer-events: auto !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
}

.ask-ai-panel.active .ask-ai-panel-inner {
    transform: translateY(0) !important;
}

/* Bordure dégradée du trapèze - désactivée car crée du noir */
/*
.ask-ai-panel-inner::before {
    content: '' !important;
    position: absolute !important;
    top: -1px !important;
    left: -1px !important;
    right: -1px !important;
    bottom: -1px !important;
    background: linear-gradient(180deg, rgba(6, 182, 212, 0.4) 0%, rgba(139, 92, 246, 0.4) 50%, rgba(168, 85, 247, 0.3) 100%) !important;
    clip-path: polygon(0 0, 100% 0, 100% 75%, 50% 100%, 0 75%) !important;
    z-index: -1 !important;
}
*/

/* Bouton fermer */
.ask-ai-close-btn {
    position: absolute !important;
    top: 20px !important;
    right: 20px !important;
    width: 44px !important;
    height: 44px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    z-index: 10 !important;
}

.ask-ai-close-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(139, 92, 246, 0.3) !important;
    transform: rotate(90deg) !important;
}

.ask-ai-close-btn svg {
    width: 20px !important;
    height: 20px !important;
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Contenu */
.ask-ai-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 20px 40px 40px !important;
    height: 100% !important;
    max-height: calc(100% - 20px) !important;
    box-sizing: border-box !important;
}

/* Layout principal : vidéo + chat côte à côte */
.ask-ai-main-layout {
    display: flex !important;
    align-items: stretch !important;
    gap: 40px !important;
    width: 100% !important;
    max-width: 1000px !important;
    height: 100% !important;
    flex: 1 !important;
    min-height: 0 !important;
}

/* Colonne vidéo avatar */
.ask-ai-avatar-column {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    width: 280px !important;
    gap: 16px !important;
}

.ask-ai-avatar-wrapper {
    width: 260px !important;
    height: 260px !important;
    border-radius: 50% !important;
    overflow: visible !important;
    border: 3px solid transparent !important;
    background: conic-gradient(from var(--btn-gradient-angle, 0deg), #00d4aa, #06b6d4, #8b5cf6, #a855f7, #00d4aa) border-box !important;
    animation: rotateBtnGradient 3s linear infinite !important;
    box-shadow:
        0 0 40px rgba(139, 92, 246, 0.3),
        0 0 80px rgba(6, 182, 212, 0.15) !important;
    position: relative !important;
    transition: box-shadow 0.3s ease !important;
}

/* Lueur pendant que l'agent parle */
.ask-ai-avatar-wrapper.speaking {
    animation: rotateBtnGradient 3s linear infinite, avatarSpeakingGlow 1.5s ease-in-out infinite !important;
}

@keyframes avatarSpeakingGlow {
    0%, 100% { 
        box-shadow: 0 0 40px rgba(139, 92, 246, 0.5), 0 0 80px rgba(6, 182, 212, 0.3), 0 0 120px rgba(139, 92, 246, 0.2) !important;
    }
    50% { 
        box-shadow: 0 0 60px rgba(139, 92, 246, 0.7), 0 0 100px rgba(6, 182, 212, 0.5), 0 0 150px rgba(139, 92, 246, 0.4) !important;
    }
}

.ask-ai-avatar-wrapper::before {
    content: '' !important;
    position: absolute !important;
    inset: 3px !important;
    border-radius: 50% !important;
    background: rgba(10, 10, 15, 0.95) !important;
    z-index: 0 !important;
}

.ask-ai-avatar-video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center top !important;
    border-radius: 50% !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Badge IA sur l'avatar */
.ask-ai-avatar-ia-label {
    position: absolute !important;
    top: 5px !important;
    right: -5px !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #a5f3fc !important;
    text-transform: uppercase !important;
    background: rgba(0, 0, 0, 0.9) !important;
    padding: 6px 12px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(6, 182, 212, 0.5) !important;
    z-index: 10 !important;
    letter-spacing: 0.05em !important;
}

/* ─── Bouton Son (TTS ElevenLabs) sous l'avatar ─── */
.ask-ai-sound-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 50px !important;
    padding: 8px 20px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    color: rgba(255, 255, 255, 0.5) !important;
}

.ask-ai-sound-btn svg {
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0 !important;
}

.sound-btn-label {
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.02em !important;
}

.ask-ai-sound-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    color: rgba(255, 255, 255, 0.7) !important;
}

/* État actif (TTS ON) */
.ask-ai-sound-btn.active {
    background: rgba(139, 92, 246, 0.15) !important;
    border-color: rgba(139, 92, 246, 0.5) !important;
    color: #a78bfa !important;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2) !important;
}

.ask-ai-sound-btn.active:hover {
    background: rgba(139, 92, 246, 0.25) !important;
    border-color: rgba(139, 92, 246, 0.7) !important;
}

/* Animation pendant la lecture audio */
.ask-ai-sound-btn.speaking {
    animation: soundPulse 1.5s ease-in-out infinite !important;
}

@keyframes soundPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(139, 92, 246, 0.2) !important; }
    50% { box-shadow: 0 0 25px rgba(139, 92, 246, 0.4), 0 0 40px rgba(6, 182, 212, 0.15) !important; }
}

/* Colonne chat */
.ask-ai-chat-column {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    min-height: 0 !important;
    min-width: 0 !important;
}

/* État initial : centrer verticalement le header */
.ask-ai-content:not(.has-conversation) .ask-ai-header-row {
    margin-top: auto !important;
    margin-bottom: 20px !important;
}

.ask-ai-content:not(.has-conversation) .ask-ai-chat-container {
    margin-bottom: auto !important;
}

/* Quand conversation engagée : contenu en haut */
.ask-ai-content.has-conversation {
    padding-top: 60px !important;
}

.ask-ai-content.has-conversation .ask-ai-header-row {
    margin-top: 0 !important;
}

/* Header avec logo + message */
.ask-ai-header-row {
    display: flex !important;
    align-items: center !important;
    gap: 24px !important;
    margin-bottom: 40px !important;
}

/* Logo IA */
.ask-ai-logo {
    position: relative !important;
    margin-bottom: 0 !important;
    flex-shrink: 0 !important;
}

.ask-ai-logo-circle {
    width: 100px !important;
    height: 100px !important;
    background: conic-gradient(from var(--btn-gradient-angle, 0deg), #00d4aa, #06b6d4, #8b5cf6, #a855f7, #00d4aa) !important;
    animation: rotateBtnGradient 3s linear infinite !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 4px !important;
    box-shadow: 
        0 0 40px rgba(139, 92, 246, 0.4),
        0 0 80px rgba(6, 182, 212, 0.2) !important;
}

.ask-ai-logo-circle::before {
    content: '' !important;
    position: absolute !important;
    width: 92px !important;
    height: 92px !important;
    background: rgba(10, 10, 15, 0.95) !important;
    border-radius: 50% !important;
}

.ask-ai-logo-question {
    position: relative !important;
    font-size: 3rem !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    z-index: 1 !important;
}

.ask-ai-logo-label {
    position: absolute !important;
    top: -5px !important;
    right: -10px !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    color: #a5f3fc !important;
    text-transform: uppercase !important;
    background: rgba(0, 0, 0, 0.9) !important;
    padding: 4px 8px !important;
    border-radius: 6px !important;
    border: 1px solid rgba(6, 182, 212, 0.5) !important;
}

/* Message d'accueil */
.ask-ai-welcome {
    font-family: 'DM Sans', sans-serif !important;
    font-size: 1.8rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    text-align: left !important;
    margin: 0 !important;
    opacity: 0.95 !important;
}

/* Zone de chat */
.ask-ai-chat-container {
    width: 100% !important;
    max-width: 600px !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
}

/* État initial : input juste sous le header */
.ask-ai-chat-container.initial-state {
    flex: 0 !important;
    margin-top: 20px !important;
}

.ask-ai-chat-container.initial-state .ask-ai-messages {
    display: none !important;
}

/* État conversation : input en bas */
.ask-ai-chat-container.conversation-state {
    flex: 1 !important;
    margin-top: 0 !important;
}

.ask-ai-chat-container.conversation-state .ask-ai-messages {
    display: flex !important;
}

/* Messages */
.ask-ai-messages {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 10px 0 !important;
    margin-bottom: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
}

.ask-ai-message {
    max-width: 85% !important;
    padding: 14px 18px !important;
    border-radius: 16px !important;
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
    animation: messageAppear 0.3s ease !important;
}

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

.ask-ai-message p {
    margin: 0 !important;
}

.ask-ai-message-user {
    align-self: flex-end !important;
    background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%) !important;
    color: #ffffff !important;
    border-bottom-right-radius: 4px !important;
}

.ask-ai-message-ai {
    align-self: flex-start !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-bottom-left-radius: 4px !important;
}

/* Loader dots */
.ask-ai-loading {
    padding: 18px 24px !important;
}

.ask-ai-loader-dots {
    display: flex !important;
    gap: 6px !important;
}

.ask-ai-loader-dots span {
    width: 8px !important;
    height: 8px !important;
    background: rgba(139, 92, 246, 0.6) !important;
    border-radius: 50% !important;
    animation: dotPulse 1.4s ease-in-out infinite !important;
}

.ask-ai-loader-dots span:nth-child(2) {
    animation-delay: 0.2s !important;
}

.ask-ai-loader-dots span:nth-child(3) {
    animation-delay: 0.4s !important;
}

@keyframes dotPulse {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Champ de saisie */
.ask-ai-input-wrapper {
    position: relative !important;
    width: 100% !important;
}

.ask-ai-input {
    width: 100% !important;
    padding: 18px 110px 18px 24px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 30px !important;
    color: #ffffff !important;
    font-size: 1rem !important;
    font-family: inherit !important;
    transition: all 0.3s ease !important;
    box-sizing: border-box !important;
}

.ask-ai-input::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}

.ask-ai-input:focus {
    outline: none !important;
    border-color: rgba(139, 92, 246, 0.5) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1) !important;
}

.ask-ai-submit-btn {
    position: absolute !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 44px !important;
    height: 44px !important;
    background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%) !important;
    border: none !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.ask-ai-submit-btn:hover {
    transform: translateY(-50%) scale(1.1) !important;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.5) !important;
}

.ask-ai-submit-btn:active {
    transform: translateY(-50%) scale(0.95) !important;
}

.ask-ai-submit-btn svg {
    width: 20px !important;
    height: 20px !important;
    color: white !important;
}

/* Footer */
.ask-ai-footer {
    margin-top: auto !important;
    padding-top: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
}

.ask-ai-footer-text {
    font-size: 0.75rem !important;
    color: rgba(255, 255, 255, 0.3) !important;
}

.ask-ai-footer-brand {
    font-size: 0.75rem !important;
    color: rgba(139, 92, 246, 0.6) !important;
    font-weight: 600 !important;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    /* Désactiver les animations et effets gourmands sur mobile */
    .ask-ai-logo-circle {
        animation: none !important;
        background: linear-gradient(135deg, #00d4aa, #06b6d4, #8b5cf6, #a855f7) !important;
        box-shadow: none !important;
    }
    
    .ask-ai-btn {
        animation: none !important;
        background: linear-gradient(135deg, #00d4aa, #06b6d4, #8b5cf6, #a855f7) !important;
        box-shadow: none !important;
        padding: 8px !important;
        margin-left: 0.5rem !important;
    }
    
    .ask-ai-panel {
        padding: 0 !important;
        top: 0 !important;
    }
    
    .ask-ai-panel-inner {
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        clip-path: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        box-shadow: none !important;
        background: rgba(10, 10, 15, 0.98) !important;
        border-radius: 0 !important;
    }
    
    .ask-ai-panel-inner::before {
        display: none !important;
    }
    
    .ask-ai-content {
        padding: 15px 15px 20px !important;
        max-height: 100% !important;
        height: 100% !important;
        justify-content: flex-start !important;
    }
    
    .ask-ai-avatar-column {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        gap: 10px !important;
        padding: 30px 0 20px !important;
        flex-shrink: 0 !important;
        transition: all 0.3s ease !important;
        position: relative !important;
    }
    
    /* Bouton son à gauche de l'avatar */
    .ask-ai-sound-btn {
        position: absolute !important;
        top: 70px !important;
        left: calc(50% - 125px) !important;
        z-index: 11 !important;
        padding: 12px !important;
    }
    
    .ask-ai-sound-btn .sound-btn-label {
        display: none !important;
    }
    
    .ask-ai-avatar-wrapper {
        width: 160px !important;
        height: 160px !important;
        border: 3px solid transparent !important;
        background: linear-gradient(135deg, #00d4aa, #06b6d4, #8b5cf6, #a855f7) border-box !important;
        animation: none !important;
        box-shadow: 0 0 30px rgba(139, 92, 246, 0.25) !important;
        overflow: visible !important;
        transition: all 0.3s ease !important;
    }
    
    .ask-ai-avatar-wrapper::before {
        content: '' !important;
        position: absolute !important;
        inset: 3px !important;
        border-radius: 50% !important;
        background: rgba(10, 10, 15, 1) !important;
        z-index: 0 !important;
    }
    
    .ask-ai-avatar-video {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center top !important;
        border-radius: 50% !important;
        position: relative !important;
        z-index: 1 !important;
    }
    
    .ask-ai-avatar-ia-label {
        font-size: 0.7rem !important;
        padding: 4px 8px !important;
        top: 2px !important;
        right: -5px !important;
        transition: all 0.3s ease !important;
    }
    
    .ask-ai-main-layout {
        flex-direction: column !important;
        gap: 0 !important;
        justify-content: center !important;
        transition: all 0.3s ease !important;
    }
    
    /* État initial : centré verticalement */
    .ask-ai-content:not(.has-conversation) .ask-ai-main-layout {
        justify-content: center !important;
        flex: 1 !important;
    }
    
    .ask-ai-content:not(.has-conversation) .ask-ai-chat-column {
        flex: 0 !important;
    }
    
    /* Quand conversation engagée : avatar en haut au centre, taille conservée */
    .ask-ai-content.has-conversation .ask-ai-main-layout {
        justify-content: flex-start !important;
    }
    
    .ask-ai-content.has-conversation .ask-ai-avatar-column {
        padding: 0 !important;
        margin-top: -10px !important;
    }
    
    .ask-ai-content.has-conversation .ask-ai-avatar-wrapper {
        width: 160px !important;
        height: 160px !important;
    }
    
    .ask-ai-content.has-conversation .ask-ai-avatar-ia-label {
        font-size: 0.7rem !important;
        padding: 4px 8px !important;
        top: 2px !important;
        right: -5px !important;
    }
    
    .ask-ai-content.has-conversation .ask-ai-welcome {
        display: none !important;
    }
    
    /* Réduire le bouton son quand conversation engagée */
    .ask-ai-content.has-conversation .ask-ai-sound-btn {
        padding: 12px !important;
    }
    
    .ask-ai-content.has-conversation .ask-ai-sound-btn svg {
        width: 16px !important;
        height: 16px !important;
    }
    
    .ask-ai-close-btn {
        top: 10px !important;
        right: 10px !important;
        width: 36px !important;
        height: 36px !important;
    }
    
    .ask-ai-header-row {
        margin-bottom: 15px !important;
        gap: 12px !important;
        padding-right: 0 !important;
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
    }
    
    .ask-ai-logo-circle {
        width: 50px !important;
        height: 50px !important;
        flex-shrink: 0 !important;
    }
    
    .ask-ai-logo-circle::before {
        width: 42px !important;
        height: 42px !important;
    }
    
    .ask-ai-logo-question {
        font-size: 1.6rem !important;
    }
    
    .ask-ai-welcome {
        font-size: 1rem !important;
        margin-bottom: 0 !important;
        line-height: 1.3 !important;
        text-align: center !important;
    }
    
    .ask-ai-chat-container {
        flex: 1 !important;
        min-height: 0 !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    .ask-ai-chat-container.conversation-state {
        flex: 1 !important;
    }
    
    .ask-ai-messages {
        flex: 1 !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        margin-bottom: 10px !important;
    }
    
    .ask-ai-input-wrapper {
        flex-shrink: 0 !important;
        margin-top: auto !important;
    }
    
    .ask-ai-input {
        padding: 12px 45px 12px 14px !important;
        font-size: 16px !important;
    }
    
    .ask-ai-submit-btn {
        width: 36px !important;
        height: 36px !important;
    }
    
    .ask-ai-message {
        animation: none !important;
        padding: 12px 14px !important;
        font-size: 0.9rem !important;
    }
    
    .ask-ai-footer {
        display: none !important;
    }
    
    /* Header compact quand conversation engagée */
    .ask-ai-content.has-conversation .ask-ai-header-row {
        margin-bottom: 10px !important;
        gap: 8px !important;
    }
    
    .ask-ai-content.has-conversation .ask-ai-logo-circle {
        width: 35px !important;
        height: 35px !important;
    }
    
    .ask-ai-content.has-conversation .ask-ai-logo-circle::before {
        width: 29px !important;
        height: 29px !important;
    }
    
    .ask-ai-content.has-conversation .ask-ai-logo-question {
        font-size: 1.1rem !important;
    }
    
    .ask-ai-content.has-conversation .ask-ai-logo-label {
        font-size: 0.45rem !important;
        padding: 1px 3px !important;
        top: -3px !important;
        right: -5px !important;
    }
    
    .ask-ai-content.has-conversation .ask-ai-welcome {
        font-size: 0.85rem !important;
    }
}

/* Bloquer le scroll quand le widget est ouvert */
html.ask-ai-open,
body.ask-ai-open {
    overflow: hidden !important;
    height: 100% !important;
}

@media (max-width: 768px) {
    html.ask-ai-open,
    body.ask-ai-open {
        position: fixed !important;
        width: 100% !important;
    }
}

/* ========== BOUTON MOBILE DANS LE MENU ========== */
.mobile-ask-ai-btn {
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 300px !important;
    padding: 1rem 2rem !important;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(236, 72, 153, 0.2) 100%) !important;
    border: 1px solid rgba(139, 92, 246, 0.3) !important;
    border-radius: 8px !important;
    color: #e9d5ff !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.02em !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    margin-top: 0.5rem !important;
}

.mobile-ask-ai-btn:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3) 0%, rgba(236, 72, 153, 0.3) 100%) !important;
}

@media (max-width: 768px) {
    .mobile-ask-ai-btn {
        display: flex !important;
    }
}

/* Scrollbar personnalisée pour les messages */
.ask-ai-messages::-webkit-scrollbar {
    width: 6px !important;
}

.ask-ai-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: 3px !important;
}

.ask-ai-messages::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3) !important;
    border-radius: 3px !important;
}

.ask-ai-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.5) !important;
}


/* ===================================
   VOICE CHAT CONTROLS
   =================================== */

/* Bouton microphone */
.ask-ai-mic-btn {
    position: absolute !important;
    right: 56px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 40px !important;
    height: 40px !important;
    background: transparent !important;
    border: 1.5px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    z-index: 2 !important;
}

.ask-ai-mic-btn:hover {
    border-color: rgba(239, 68, 68, 0.5) !important;
    background: rgba(239, 68, 68, 0.1) !important;
}

.ask-ai-mic-btn svg {
    width: 18px !important;
    height: 18px !important;
    color: rgba(255, 255, 255, 0.6) !important;
    transition: color 0.3s ease !important;
}

.ask-ai-mic-btn:hover svg {
    color: #ef4444 !important;
}

/* État désactivé (pendant transcription/TTS) */
.ask-ai-mic-btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    background: transparent !important;
}

.ask-ai-mic-btn:disabled svg {
    color: rgba(255, 255, 255, 0.4) !important;
}

/* Reset hover sur mobile (évite le hover "collé") */
@media (hover: none) {
    .ask-ai-mic-btn:not(.listening):not(.speaking) {
        border-color: rgba(255, 255, 255, 0.2) !important;
        background: transparent !important;
    }
    .ask-ai-mic-btn:not(.listening):not(.speaking) svg {
        color: rgba(255, 255, 255, 0.6) !important;
    }
}

/* État : écoute en cours */
.ask-ai-mic-btn.listening {
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.15) !important;
    animation: micPulse 1.5s ease-in-out infinite !important;
}

.ask-ai-mic-btn.listening svg {
    color: #ef4444 !important;
}

/* État : lecture audio */
.ask-ai-mic-btn.speaking {
    border-color: #22d3ee !important;
    background: rgba(34, 211, 238, 0.1) !important;
}

.ask-ai-mic-btn.speaking svg {
    color: #22d3ee !important;
}

/* Pulse animation micro */
.mic-pulse {
    display: none;
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #ef4444;
    animation: micRing 1.5s ease-out infinite;
}

.ask-ai-mic-btn.listening .mic-pulse {
    display: block;
}

@keyframes micPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3); }
    50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

@keyframes micRing {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.8); opacity: 0; }
}

/* Texte intermédiaire (pendant la transcription) */
.ask-ai-input.voice-interim {
    color: rgba(255, 255, 255, 0.5) !important;
    font-style: italic !important;
}

/* Toggle mode vocal continu - SUPPRIMÉ, remplacé par bouton son */

/* Sélecteur de source micro */
.ask-ai-mic-select-wrapper {
    width: 100% !important;
    display: flex !important;
    justify-content: flex-end !important;
}

.ask-ai-mic-select {
    appearance: none !important;
    -webkit-appearance: none !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 6px !important;
    padding: 4px 24px 4px 8px !important;
    font-size: 0.7rem !important;
    font-family: inherit !important;
    cursor: pointer !important;
    max-width: 200px !important;
    outline: none !important;
    transition: all 0.2s ease !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='1.5'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
}

.ask-ai-mic-select:hover {
    border-color: rgba(255, 255, 255, 0.25) !important;
    color: rgba(255, 255, 255, 0.7) !important;
}

.ask-ai-mic-select:focus {
    border-color: rgba(139, 92, 246, 0.5) !important;
}

.ask-ai-mic-select option {
    background: #1a1a2e !important;
    color: rgba(255, 255, 255, 0.8) !important;
}

/* ─── Speaking Indicator (Aurora parle...) ─── */
.ask-ai-message-speaking {
    background: rgba(139, 92, 246, 0.15) !important;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.ask-ai-speaking-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
}

.speaking-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-style: italic;
}

.speaking-wave {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 20px;
}

.speaking-wave span {
    display: inline-block;
    width: 3px;
    height: 8px;
    background: rgba(139, 92, 246, 0.8);
    border-radius: 2px;
    animation: speakingWave 1s ease-in-out infinite;
}

.speaking-wave span:nth-child(1) { animation-delay: 0s; }
.speaking-wave span:nth-child(2) { animation-delay: 0.15s; }
.speaking-wave span:nth-child(3) { animation-delay: 0.3s; }
.speaking-wave span:nth-child(4) { animation-delay: 0.45s; }

@keyframes speakingWave {
    0%, 100% { height: 6px; opacity: 0.5; }
    50% { height: 18px; opacity: 1; }
}


/* ═══════════════════════════════════════════════
   ORBE FLUIDE — Animation "parle" de l'avatar
   CSS-only, GPU-accelerated, mobile-friendly
   ═══════════════════════════════════════════════ */

.ask-ai-orb {
    position: absolute !important;
    inset: 3px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    z-index: 2 !important;
    opacity: 0 !important;
    transform: scale(0.92) !important;
    transition: opacity 0.5s ease, transform 0.5s ease !important;
    pointer-events: none !important;
    /* Un seul blur sur le conteneur — performant */
    filter: blur(20px) saturate(1.4) !important;
    background: radial-gradient(circle at 50% 50%, #0c1a2e 0%, #0a0f1a 100%) !important;
}

.ask-ai-orb.active {
    opacity: 1 !important;
    transform: scale(1) !important;
}

/* Transition douce sur la vidéo */
.ask-ai-avatar-video {
    transition: opacity 0.5s ease !important;
}

/* ─── Blobs individuels ─── */
.orb-blob {
    position: absolute !important;
    border-radius: 50% !important;
    will-change: transform !important;
}

/* Blob 1 — Grand, bleu clair central */
.orb-blob-1 {
    width: 65% !important;
    height: 65% !important;
    top: 15% !important;
    left: 18% !important;
    background: radial-gradient(circle, #7ec8e3 0%, #4a9eca 60%, transparent 100%) !important;
    opacity: 0.9 !important;
    animation: orbFloat1 3s ease-in-out infinite !important;
}

/* Blob 2 — Moyen, blanc chaud (lumière haute) */
.orb-blob-2 {
    width: 50% !important;
    height: 45% !important;
    top: 5% !important;
    left: 25% !important;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(200, 230, 255, 0.6) 50%, transparent 100%) !important;
    opacity: 0.85 !important;
    animation: orbFloat2 3.5s ease-in-out infinite !important;
}

/* Blob 3 — Bleu profond en bas */
.orb-blob-3 {
    width: 55% !important;
    height: 55% !important;
    bottom: 0% !important;
    left: 10% !important;
    background: radial-gradient(circle, #2980b9 0%, #1a5276 60%, transparent 100%) !important;
    opacity: 0.8 !important;
    animation: orbFloat3 4s ease-in-out infinite !important;
}

/* Blob 4 — Petit, accent cyan vif */
.orb-blob-4 {
    width: 35% !important;
    height: 35% !important;
    top: 30% !important;
    right: 5% !important;
    background: radial-gradient(circle, #5dade2 0%, #2e86c1 50%, transparent 100%) !important;
    opacity: 0.7 !important;
    animation: orbFloat4 2.5s ease-in-out infinite !important;
}

/* Blob 5 — Touche de lumière douce */
.orb-blob-5 {
    width: 40% !important;
    height: 40% !important;
    top: 20% !important;
    left: 5% !important;
    background: radial-gradient(circle, rgba(174, 214, 241, 0.9) 0%, rgba(133, 193, 233, 0.4) 50%, transparent 100%) !important;
    opacity: 0.6 !important;
    animation: orbFloat5 4.5s ease-in-out infinite !important;
}

/* ─── Keyframes — uniquement des transforms (GPU) ─── */
@keyframes orbFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25%      { transform: translate(18%, -20%) scale(1.18); }
    50%      { transform: translate(-15%, 18%) scale(0.85); }
    75%      { transform: translate(20%, 12%) scale(1.12); }
}

@keyframes orbFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(-25%, 18%) scale(1.2); }
    66%      { transform: translate(18%, -15%) scale(0.82); }
}

@keyframes orbFloat3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25%      { transform: translate(20%, -18%) scale(1.15); }
    50%      { transform: translate(-18%, -25%) scale(1.22); }
    75%      { transform: translate(12%, 15%) scale(0.85); }
}

@keyframes orbFloat4 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(-28%, 22%) scale(1.25); }
    66%      { transform: translate(22%, -25%) scale(0.8); }
}

@keyframes orbFloat5 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    20%      { transform: translate(22%, 18%) scale(1.2); }
    40%      { transform: translate(-15%, -22%) scale(0.85); }
    60%      { transform: translate(-22%, 25%) scale(1.18); }
    80%      { transform: translate(18%, -12%) scale(0.82); }
}

/* ─── Respect des préférences utilisateur ─── */
@media (prefers-reduced-motion: reduce) {
    .orb-blob {
        animation-duration: 20s !important;
    }
}

/* ─── Mobile : taille réduite, animation simplifiée ─── */
@media (max-width: 768px) {
    .ask-ai-orb {
        filter: blur(15px) saturate(1.3) !important;
    }
    /* Animations un peu plus lentes sur mobile pour les perfs */
    .orb-blob-1 { animation-duration: 4s !important; }
    .orb-blob-2 { animation-duration: 4.5s !important; }
    .orb-blob-3 { animation-duration: 5s !important; }
    .orb-blob-4 { animation-duration: 3.5s !important; }
    .orb-blob-5 { animation-duration: 5.5s !important; }
}


/* ─── CARTES DE REDIRECTION AGENT ─── */
.contact-cards-row {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.contact-card-link {
    display: flex;
    flex-direction: column;
    width: 170px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.25);
    text-decoration: none;
    transition: all 0.25s ease;
    cursor: pointer;
}
.contact-card-link:hover {
    border-color: rgba(139, 92, 246, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.15);
}
.contact-card-img {
    width: 100%;
    height: 85px;
    background-size: cover;
    background-position: center;
}
.contact-card-title {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'DM Sans', sans-serif;
    line-height: 1.2;
}
.contact-card-title svg {
    flex-shrink: 0;
    opacity: 0.5;
}

.contact-inline-link {
    color: #a78bfa;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}
.contact-inline-link:hover {
    color: #c4b5fd;
    text-decoration: underline;
}
