.chatbot-container {
    position: fixed;
    top: 150px;
    right: -100px; /* Commence hors de la vue */
    width: 80px; /* Taille de la tête */
    height: 80px; /* Taille de la tête */
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 1000;
}

.chatbot-container.visible {
    right: 20px; /* Déplace dans la vue */
}

.chatbot-container.expanded {
    width: 420px; /* Taille par défaut pour les écrans plus grands */
    height: 600px; /* Taille par défaut pour les écrans plus grands */
    cursor: default;
    right: 20px; /* Ajuster la marge à droite */
}

.chatbot-container.mini {
    width: 80px; /* Taille de la tête */
    height: 80px; /* Taille de la tête */
    right: 20px;
}

.chatbot-icon {
    width: 80px; /* Taille de la tête */
    height: 80px; /* Taille de la tête */
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 2px solid rgb(243, 156, 18); /* Couleur orange */
    position: relative;
    transition: all 0.3s ease;
}

.chatbot-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chatbot-bubble {
    display: none;
    position: absolute;
    top: 50%; /* Centrer verticalement */
    left: calc(100% + 10px); /* Ajuster pour être à droite de l'icône */
    transform: translateY(-50%);
    background: rgb(221 224 227);
    padding: 10px 15px;
    border-radius: 18px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    white-space: normal;
    z-index: 1001; /* S'assurer qu'il soit au-dessus des autres éléments */
    color: black; /* S'assurer que le texte soit visible */
    width: 250px;
    padding-right: 25px; /* Ajouter une marge à droite pour la croix de fermeture */
}

.chatbot-bubble::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 10px solid #fff;
}

.chatbot-container.show-bubble .chatbot-bubble {
    display: block;
}

.bubble-close-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    cursor: pointer;
    background: transparent;
    border: none;
    font-size: 16px;
    color: #333;
    z-index: 1002;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.bubble-close-btn:hover {
    color: #666;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
}

.chatbot-content {
    display: none;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chatbot-container.expanded .chatbot-content {
    display: flex;
}

.chatbot-container.expanded .chatbot-icon,
.chatbot-container.expanded .chatbot-bubble {
    display: none;
}

.chatbot-header {
    background: rgb(198, 195, 199); /* Couleur gris */
    color: #fff;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header h3 {
    font-weight: 500;
    font-size: 1.1rem;
    margin: 0;
}

.chatbot-header .close-btn {
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    color: #fff;
    background: transparent;
    border: none;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-header .close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.chatbox {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    background: white;
}

.chat-message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
}

.chat-message.incoming {
    justify-content: flex-start;
}

.chat-message.outgoing {
    justify-content: flex-end;
}

.chat-avatar {
    width: 40px; /* Taille de l'avatar */
    height: 40px; /* Taille de l'avatar */
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.chat-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.chat-message.incoming .chat-bubble {
    background: #F1F0F0;
    color: #333;
}

.chat-message.outgoing .chat-bubble {
    background: #E3F2FD;
    color: #1565C0;
}

.chat-input {
    display: flex;
    align-items: center;
    padding: 15px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.chat-input input {
    flex-grow: 1;
    border: none;
    outline: none;
    padding: 10px;
    font-size: 0.95rem;
    border-radius: 20px;
    background: #f5f5f5;
}

.chat-input button {
    background: #1976D2;
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    margin-left: 10px;
    transition: background 0.3s ease;
    height: 40px;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.chat-input button:hover {
    background: #1565C0;
}

.typing-indicator {
    display: flex;
    align-items: center;
    margin-top: 5px;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    float: left;
    margin: 0 1px;
    background-color: #9E9EA1;
    display: block;
    border-radius: 50%;
    opacity: 0.4;
}

.typing-indicator span:nth-of-type(1) {
    animation: 1s blink infinite 0.3333s;
}

.typing-indicator span:nth-of-type(2) {
    animation: 1s blink infinite 0.6666s;
}

.typing-indicator span:nth-of-type(3) {
    animation: 1s blink infinite 0.9999s;
}

@keyframes blink {
    50% {
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .chatbot-container.expanded {
        width: 90%; /* Adaptation pour les petits écrans */
        height: 80%; /* Adaptation pour les petits écrans */
        right: 5%;
        top: 10%;
        border-radius: 10px; /* Ajouter un arrondi pour les coins sur mobile */
    }

    .chatbot-header {
        padding: 10px;
    }

    .chatbox {
        padding: 15px;
    }

    .chat-input {
        padding: 10px;
    }

    .chatbot-bubble {
        width: 200px;
        font-size: 12px;
    }
}