
/* =========================================================
   CHATBOT IA CIMEF - BOUTON FLOTTANT
   ========================================================= */

#cimef-ai-chat {
    position: fixed;
    right: 25px;
    bottom: 25px;
    z-index: 99999;
    font-family: Arial, Helvetica, sans-serif;
}

/* ---------------------------------------------------------
   Bouton flottant
   --------------------------------------------------------- */

#cimef-ai-button {
    width: 65px;
    height: 65px;
    border: none;
    border-radius: 50%;

    background: #051a53;
    color: #ffffff;

    font-size: 28px;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        background 0.3s ease;
}

#cimef-ai-button:hover {
    transform: scale(1.08);
    background: #0a2a7a;

    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
}

/* Petite animation du bouton */

#cimef-ai-button {
    animation: cimefPulse 2.5s infinite;
}

@keyframes cimefPulse {

    0% {
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    }

    50% {
        box-shadow:
            0 6px 20px rgba(0, 0, 0, 0.25),
            0 0 0 10px rgba(5, 26, 83, 0.10);
    }

    100% {
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    }
}


/* =========================================================
   FENÊTRE DU CHAT
   ========================================================= */

#cimef-ai-window {

    position: absolute;

    right: 0;
    bottom: 80px;

    width: 380px;
    height: 550px;

    background: #ffffff;

    border-radius: 18px;

    overflow: hidden;

    box-shadow:
        0 15px 50px rgba(0, 0, 0, 0.25);

    display: none;

    flex-direction: column;

    border: 1px solid #eeeeee;

    animation: cimefChatOpen 0.25s ease;
}


/* Animation ouverture */

@keyframes cimefChatOpen {

    from {
        opacity: 0;
        transform: translateY(15px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

}


/* =========================================================
   EN-TÊTE
   ========================================================= */

.cimef-ai-header {

    height: 70px;

    background: #051a53;
    color: white;

    display: flex;

    align-items: center;
    justify-content: space-between;

    padding: 0 20px;

}


/* Logo / titre */

.cimef-ai-header strong {

    font-size: 17px;

    display: block;

}

.cimef-ai-header small {

    display: block;

    margin-top: 4px;

    font-size: 12px;

    opacity: 0.8;

}


/* Bouton fermeture */

#cimef-ai-close {
    width: 35px !important;
    height: 35px !important;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 10px !important;
    font-size: 22px;
    cursor: pointer;
    transition: background 0.2s ease;
}

#cimef-ai-close:hover {
    background: rgba(255, 255, 255, 0.30);
}


/* =========================================================
   ZONE DES MESSAGES
   ========================================================= */

#cimef-ai-messages {

    flex: 1;

    padding: 20px;

    overflow-y: auto;

    background: #f5f7fb;

}


/* Scroll */

#cimef-ai-messages::-webkit-scrollbar {

    width: 6px;

}

#cimef-ai-messages::-webkit-scrollbar-thumb {

    background: #cbd2df;

    border-radius: 10px;

}


/* =========================================================
   MESSAGE IA
   ========================================================= */

.ai-message {

    max-width: 85%;

    background: #ffffff;

    color: #222222;

    padding: 12px 15px;

    border-radius: 15px 15px 15px 4px;

    margin-bottom: 12px;

    font-size: 14px;

    line-height: 1.5;

    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);

}


/* =========================================================
   MESSAGE UTILISATEUR
   ========================================================= */

.user-message {

    max-width: 85%;

    margin-left: auto;

    background: #051a53;

    color: #ffffff;

    padding: 12px 15px;

    border-radius: 15px 15px 4px 15px;

    margin-bottom: 12px;

    font-size: 14px;

    line-height: 1.5;

}


/* =========================================================
   PIED DU CHAT
   ========================================================= */

.cimef-ai-footer {

    min-height: 65px;

    padding: 10px;

    background: #ffffff;

    border-top: 1px solid #eeeeee;

    display: flex;

    align-items: center;

    gap: 8px;

}


/* Champ message */

#cimef-ai-input {

    flex: 1;

    height: 44px;

    border: 1px solid #d9dce3;

    border-radius: 22px;

    padding: 0 16px;

    outline: none;

    font-size: 14px;

    color: #333333;

}

#cimef-ai-input:focus {

    border-color: #051a53;

    box-shadow: 0 0 0 2px rgba(5, 26, 83, 0.08);

}


/* Bouton envoyer */

#cimef-ai-send {

    width: 44px;
    height: 44px;

    border: none;

    border-radius: 50%;

    background: #051a53;

    color: white;

    font-size: 18px;

    cursor: pointer;

    display: flex;

    align-items: center;
    justify-content: center;

    transition:
        transform 0.2s ease,
        background 0.2s ease;

}

#cimef-ai-send:hover {

    background: #0a2a7a;

    transform: scale(1.05);

}


/* =========================================================
   VERSION OUVERTE
   ========================================================= */

#cimef-ai-chat.open #cimef-ai-window {

    display: flex;

}

#cimef-ai-chat.open #cimef-ai-button {

    animation: none;

}


/* =========================================================
   RESPONSIVE MOBILE
   ========================================================= */

@media (max-width: 600px) {

    #cimef-ai-chat {

        right: 15px;
        bottom: 15px;

    }

    #cimef-ai-window {

        position: fixed;

        right: 10px;
        bottom: 90px;

        width: calc(100vw - 20px);

        height: calc(100vh - 120px);

        max-height: 650px;

        border-radius: 16px;

    }

    #cimef-ai-button {

        width: 58px;
        height: 58px;

        font-size: 25px;

    }

}


/* =========================================================
   INDICATEUR "IA EN TRAIN D'ÉCRIRE"
   ========================================================= */

.cimef-ai-typing {

    display: flex;

    align-items: center;

    gap: 4px;

    padding: 12px 15px;

    width: fit-content;

    background: white;

    border-radius: 15px;

    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);

    margin-bottom: 12px;

}


.cimef-ai-typing span {

    width: 7px;
    height: 7px;

    background: #777;

    border-radius: 50%;

    animation: cimefTyping 1.2s infinite;

}

.cimef-ai-typing span:nth-child(2) {

    animation-delay: 0.2s;

}

.cimef-ai-typing span:nth-child(3) {

    animation-delay: 0.4s;

}


@keyframes cimefTyping {

    0%,
    60%,
    100% {

        transform: translateY(0);

    }

    30% {

        transform: translateY(-5px);

    }

}
```
