/* --- ANIMATION "COUCOU" --- */
    @keyframes rgoWave {
        0%, 90% { transform: scale(1) rotate(0deg); }
        92% { transform: scale(1.1) rotate(-10deg); }
        94% { transform: scale(1.1) rotate(10deg); }
        96% { transform: scale(1.1) rotate(-10deg); }
        98% { transform: scale(1.1) rotate(10deg); }
        100% { transform: scale(1) rotate(0deg); }
    }

    /* --- PC : TAB LATÉRAL --- */
    #chat-bubble {
        position: fixed !important;
        top: 50%; 
        right: -10px !important; /* Légèrement caché sur PC */
        transform: translateY(-50%);
        z-index: 9998 !important;
        
        background-color: white;
        padding: 8px 5px 8px 12px;
        border-radius: 50px 0 0 50px;
        box-shadow: -2px 0 10px rgba(0,0,0,0.15);
        border: 1px solid #e2e8f0;
        border-right: none;
        
        display: flex;
        align-items: center;
        gap: 10px;
        cursor: pointer;
        transition: right 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        
        width: auto;
        max-width: 220px;
    }

    #chat-bubble:hover {
        right: 0 !important;
        padding-right: 15px;
    }

    #chat-bubble img {
        width: 50px;
        height: 50px;
        object-fit: cover;
        display: block;
        animation: rgoWave 5s infinite ease-in-out; 
        transform-origin: bottom center; 
    }

    .bubble-text {
        font-family: sans-serif;
        font-weight: 600;
        color: #1a202c;
        font-size: 14px;
        display: none;
        white-space: nowrap;
    }

    #chat-bubble:hover .bubble-text {
        display: block;
        animation: fadeIn 0.3s;
    }
    
    @keyframes fadeIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: translateX(0); } }


    /* --- FENÊTRE DE CHAT --- */
    #chat-window {
        position: fixed !important;
        bottom: 20px !important;
        right: 20px !important;
        z-index: 9999 !important;
        width: 350px;
        height: 500px;
        background-color: white;
        border-radius: 15px;
        box-shadow: 0 5px 30px rgba(0,0,0,0.25);
        display: none;
        flex-direction: column;
        overflow: hidden;
        opacity: 0;
        transform: translateY(20px) scale(0.95);
        transition: all 0.3s ease-out;
    }

    #chat-window.visible {
        display: flex;
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    /* --- MOBILE (CORRIGÉ POUR RESSORTIR PLUS) --- */
    @media (max-width: 767px) {
        #chat-bubble {
            top: auto !important; 
            bottom: 30% !important; 
            
            /* MODIFICATION ICI : -5px au lieu de -15px */
            right: -5px !important; 
            
            transform: none;
            padding: 5px 0 5px 8px; /* Ajustement léger du padding */
        }
        
        #chat-bubble:active, #chat-bubble:focus {
            right: 0 !important;
        }

        #chat-bubble img {
            width: 50px; /* Un poil plus gros pour la visibilité */
            height: 50px;
        }
        
        .bubble-text { display: none !important; }

        #chat-window {
            width: 95% !important;
            height: 80% !important;
            bottom: 10px !important;
            right: 2.5% !important;
            left: 2.5% !important;
        }
    }

    /* --- RESTE DU DESIGN INTERNE --- */
    #chat-header { background-color: #1a202c; color: white; padding: 12px 15px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; border-top-left-radius: 10px; border-top-right-radius: 10px; }
    .header-actions { display: flex; gap: 10px; }
    .header-btn { background: none; border: none; color: #a0aec0; font-size: 18px; cursor: pointer; padding: 0; transition: color 0.2s; }
    .header-btn:hover { color: white; }
    #chat-messages { flex-grow: 1; padding: 15px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; background-color: #f7fafc; }
    .chat-msg { padding: 10px 15px; border-radius: 18px; max-width: 85%; line-height: 1.4; word-wrap: break-word; font-size: 14px;}
    .chat-msg.user { background-color: #e2e8f0; color: #333; align-self: flex-end; border-bottom-right-radius: 4px; }
    .chat-msg.bot { background-color: #ffffff; color: #333; align-self: flex-start; border: 1px solid #e2e8f0; border-bottom-left-radius: 4px; }
    .chat-msg.bot ul { margin-left: 20px; list-style-type: disc; margin-top: 5px; padding-left: 0; }
    .chat-msg.bot a { color: #059669; text-decoration: underline; }
    #chat-input-container { border-top: 1px solid #e2e8f0; display: flex; align-items: center; background: white; }
    #chat-input { flex-grow: 1; border: none; padding: 15px; font-size: 14px; box-sizing: border-box; outline: none; }
    #chat-send-btn { background-color: #059669; color: white; border: none; padding: 0 15px; height: 50px; cursor: pointer; font-size: 18px; transition: background-color 0.2s; }
    #chat-send-btn:hover { background-color: #047857; }
    .bot-button { background-color: #f0f2f5; border: 1px solid #cbd5e0; color: #2d3748; padding: 8px 12px; border-radius: 20px; cursor: pointer; font-size: 13px; font-weight: 500; margin: 4px 2px; display: inline-block; transition: background-color 0.2s; }
    
    #chat-window.fullscreen { width: 80vw; height: 70vh; bottom: 15vh; right: 10vw; }
    @media (max-width: 767px) { #chat-window.fullscreen { width: 100% !important; height: 100% !important; top:0; left:0; right:0; bottom:0; border-radius: 0; } }
