/* Conteneur principal du chatbot */
.chatbot-container {
    width: 350px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    background-color: #ffffff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: fixed;
    bottom: 100px; /* Remonter légèrement */
    right: 20px;
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 49;
}

/* Superposition d'arrière-plan */
.chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 48;
    display: none;
    overflow: hidden;
}

body.no-scroll {
    overflow: hidden;
}

/* En-tête du chatbot */
.chat-header {
    background-color: #007bff;
    color: white;
    text-align: center;
    padding: 8px 16px;
    font-size: 1.2em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: "Open Sans", helvetica, sans-serif;
}

.chat-header button {
    background: none;
    border: none;
    color: white;
    font-size: 1.2em;
    cursor: pointer;
    transition: transform 0.3s ease;
    font-family: "Open Sans", helvetica, sans-serif;
}

.chat-header button:hover {
    transform: scale(1.2);
    font-weight: 900;
}

.chat-header button::before {
    content: "\2715";
    display: inline-block;
}

/* Contenu du chatbot avec ascenseur */
.chat-content {
    flex: 1;
    padding: 10px;
    background-color: #f9f9f9;
    overflow-y: auto;
    max-height: 50vh; /* Limite la hauteur à 50% de l'écran */
    font-family: "Open Sans", helvetica, sans-serif;
}

/* Messages utilisateur et bot */
.chat-message {
    margin: 10px 0;
    display: flex;
    align-items: flex-start;
    font-family: "Open Sans", helvetica, sans-serif;
}

.chat-message.bot {
    justify-content: flex-start;
}

.chat-message.user {
    justify-content: flex-end;
}

.chat-message span {
    max-width: 70%;
    padding: 10px;
    border-radius: 10px;
    line-height: 1.5;
    font-size: 0.9em;
}

.chat-message.bot span {
    background-color: #e0e0e0;
    color: #333;
}

.chat-message.user span {
    background-color: #007bff;
    color: white;
}

/* Champ d'entrée du chatbot */
.chat-input {
    display: flex;
    padding: 10px;
    background-color: #f1f1f1;
    border-top: 1px solid #ddd;
    font-family: "Open Sans", helvetica, sans-serif;
}

.chat-input input {
    flex: 1;
    padding: 10px;
    border: none;
    outline: none;
    font-size: 1em;
    font-family: "Open Sans", helvetica, sans-serif;
}
#chatInput {
    display: flex; /* Masque le champ texte et le bouton */
}
.chat-input textarea {
    flex: 1;
    resize: none;
    padding: 10px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 5px;
    min-height: 50px;
    max-height: 150px;
    overflow-y: auto;
}

.chat-input button {
    margin-left: 10px;
    padding: 10px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
}

.chat-input button:hover {
    background-color: #0056b3;
}

/* Wrapper pour le bouton toggle */
.chat-toggle-wrapper {
    position: fixed;
    bottom: 50px; /* Ajusté pour remonter l'icône */
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 99;
}

/* Icône de message avec dégradé */
.chat-message-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #007bff, #226296); /* Dégradé délicat */
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 5px;
    font-size: 1.5em;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-family: "Open Sans", helvetica, sans-serif;
    z-index: 99;
}

/* Bouton pour afficher/fermer le chatbot */
.chat-toggle-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
    font-family: "Open Sans", helvetica, sans-serif;
}

.chat-toggle-button:hover {
    background-color: #0056b3;
}

/* Conteneur de la sélection d'avatars */
#chatAvatarSelection {
    text-align: center;
    margin-bottom: 15px;
}

#chatAvatarSelection p {
    font-size: 1em;
    color: #333;
    margin-bottom: 10px;
}

.avatar-list img {
    width: 50px;
    height: 50px;
    margin: 5px;
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: transform 0.2s, border 0.2s;
}

.avatar-list img:hover {
    transform: scale(1.1);
    border: 2px solid #007bff;
}

/* Image d'avatar dans les messages */
.chat-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
}

.chat-message {
    display: flex;
    align-items: center;
}
#chatAvatarSelection {
    display: none; /* Par défaut masqué, contrôlé en JS */
}

/* Style pour les liens dans les réponses du bot */
.chat-message.bot a {
    color: #007bff; /* Bleu vif */
    text-decoration: none; /* Supprime le soulignement par défaut */
    font-weight: bold; /* Met le texte en gras */
    border-bottom: 1px dashed #007bff; /* Ligne en pointillés pour plus de distinction */
}

.chat-message.bot a:hover {
    text-decoration: underline; /* Souligne au survol */
    color: #0056b3; /* Assombrit légèrement la couleur */
    border-bottom: 1px solid #0056b3; /* Change la ligne en un style solide */
}
