/* Container principal */
body {
  overflow-x: hidden !important;
}

.chatbot-container {
  margin-right: 0 !important;
  padding-right: 0 !important;
  right: 0 !important;
}
.chatbot-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
}

/* Style du bouton icône */
.clear-history-btn {
  background: none;
  border: none;
  color: #ff4444; /* Rouge pour indiquer une action destructive */
  cursor: pointer;
  font-size: 16px;
  padding: 8px;
  margin-left: 10px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.clear-history-btn:hover {
  background: rgba(255, 0, 0, 0.1);
  transform: scale(1.1);
}

.clear-history-btn:active {
  transform: scale(0.95);
}
/* Bouton déclencheur */
.custom-chatbot__image {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.custom-chatbot__image:hover {
  transform: scale(1.05);
}

/* Fenêtre de chat */
.custom-chatbot {
  width: 350px;
  height: 500px;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.lwh-open-cbot .custom-chatbot {
  display: flex;
}

/* Structure de chat */
.chat {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Header */
.chat__header {
  background-color: #007bff;
  color: white;
  padding: 10px 15px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: 4px;
}

.chat__title {
  font-size: 16px;
  font-weight: bold;
  margin-right: 10px;
}

.chat__status {
  display: flex;
  align-items: center;
  font-size: 15px;
}

.chat__status span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #00ed14;
  margin-right: 6px;
}

.chat__close-icon {
  cursor: pointer;
  margin-left: auto;
}

/* Zone des messages */
.chat__messages {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  background: #f1f1f1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Messages */
.chat__message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 90%;
}

.message-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f1f1f1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.message-avatar i {
  font-size: 22px;
  color: #1890ff;
}

.chat__message--bot .message-avatar {
  background: #f0f7ff;
}

.chat__message--bot .message-avatar i {
  color: #1890ff;
}

.message-content {
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
  /* Ajoutez ces propriétés */
  white-space: pre-wrap;       /* Respecte les sauts de ligne */
  word-break: break-word;     /* Force la césure des mots */
  overflow-wrap: anywhere;    /* Gère les débordements */
  min-width: 0;               /* Corrige le flexbox */
  display: inline-block;      /* Maintien de la bulle */
  max-width: 100%; 
  font-weight: 500;/* Maintien du format bulle */
}
.message-content {
  /* Conservez vos styles existants et ajoutez : */

}

/* Style des messages utilisateur */
.chat__message--user {
  align-self: flex-end;
}

.chat__message--user .message-content {
  background-color: #d1e7dd;
  color: #000;
}

/* Style des messages bot */
.chat__message--bot {
  align-self: flex-start;
}

.chat__message--bot .message-content {
  background-color: #ffffff;
  color: #000;
  border: 1px solid #ddd;
}

/* Loader */
.chat__loader {
  display: none;
  align-self: flex-start;
  padding: 10px 15px;
}

.chat__loader-content {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat__loader-dots {
  display: flex;
  gap: 4px;
}

.chat__loader-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1890ff;
  animation: loader-bounce 1.4s infinite ease-in-out;
}

.chat__loader-dot:nth-child(1) { animation-delay: -0.32s; }
.chat__loader-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes loader-bounce {
  0%, 80%, 100% { transform: scale(0); } 
  40% { transform: scale(1); }
}

/* Zone de saisie */
.chat__input-area {
  position: sticky;
  bottom: 0;
  padding: 10px;
  border-top: 1px solid #ccc;
  background: white;
  display: flex;
}

.chat__input-area form {
  display: flex;
  gap: 8px;
  width: 100%;
}

.chat__input-area input[type="text"] {
  flex: 1;
  padding: 8px 12px;
  border-radius: 20px;
  border: 1px solid #ccc;
}

.chat__input-area button {
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
@media (max-width: 768px) {
  .custom-chatbot {
    height: 80vh !important; /* Réduit la hauteur */
    max-height: calc(100vh - 40px); /* Empêche le débordement */
    bottom: 10px !important;
    
    
    
  }
  .chat__header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 12px 15px !important;
}
}
@media (max-width: 768px) {
  .chatbot-container {
    left: 50% !important;
    transform: translateX(-50%) !important;
    right: auto !important;
    width: 95vw !important;
    max-width: 400px !important; /* Largeur maximale */
    margin: 0 !important;
    padding: 0 !important;
  }

  .custom-chatbot {
    width: 100% !important;
    margin: 0 auto !important;
  }
}
/* Responsive */
@media (max-width: 480px) {
  .custom-chatbot {
   
    height: 100vh;
    max-width: 400px !important;
     width: 95vw !important;
    bottom: 0;
    right: 0;
    border-radius: 5px;

  }
}