/* [2026-05-09] — révision scroll chat + responsive fenêtre */

/* RÉSUMÉ : Chat flottant (wrapper, bouton pilule, fenêtre), zone messages scrollable en flex,
   bulles ; FAQ premium inchangée au-delà de cette section */

/* ========================================= */

/* --- DESIGN DE L'AGENT IA SUPPORT --- */

/* ========================================= */

/* Conteneur principal */

#chat-wrapper {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* Bouton flottant */

#btn-flottant {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 15px 25px;
  border-radius: 50px;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  box-shadow: 0 8px 25px rgba(30, 58, 138, 0.3);
  border: none;
  color: white;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  margin-top: 15px;
}

#btn-flottant:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 30px rgba(30, 58, 138, 0.4);
}

@media (max-width: 576px) {
  #btn-flottant {
    width: 60px;
    height: 60px;
    padding: 0;
    border-radius: 50%;
  }
}

@media (max-width: 576px) {
  #btn-flottant span {
    display: none;
  }
}

#btn-flottant svg {
  width: 1.5em;
  height: 1.5em;
}

/* Fenêtre : pas de hauteur fixe absolue seule — max-height pour petits écrans */

#chat-window {
  width: min(350px, calc(100vw - 40px));
  max-height: min(500px, calc(100vh - 120px));
  background: white;
  border-radius: 20px;
  overflow: hidden;
  border: none;
  display: none;
}

/* Ouverte : colonne flex — la zone #chat-messages prend l'espace restant et défile */

#chat-window.collapse.show {
  display: flex !important;
  flex-direction: column;
}

#chat-window .card-header {
  flex-shrink: 0;
}

#chat-window .card-footer {
  flex-shrink: 0;
}

/* Zone messages : min-height: 0 est indispensable pour overflow-y dans un parent flex */

#chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 16px 20px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Bulles */

.bubble {
  padding: 12px 18px;
  border-radius: 18px;
  max-width: 85%;
  font-size: 0.95rem;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.bubble-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  color: white;
  border-bottom-right-radius: 2px;
}

.bubble-ai {
  align-self: flex-start;
  background: white;
  color: #1e293b;
  border-bottom-left-radius: 2px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* ========================================= */

/* --- DESIGN PREMIUM DE LA FAQ --- */

/* ========================================= */

#accordion-faq .accordion-item {
  border: none;
  margin-bottom: 1rem;
  border-radius: 12px !important;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

#accordion-faq .accordion-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

#accordion-faq .accordion-button {
  font-weight: 700;
  color: #1e3a8a;
  padding: 1.25rem;
  background-color: #ffffff !important;
}

#accordion-faq .accordion-button:not(.collapsed) {
  background-color: #f8fafc !important;
  color: #3b82f6;
  box-shadow: none;
}

#accordion-faq .accordion-button::after {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%231e3a8a'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
  transition: transform 0.3s ease;
}

#accordion-faq .accordion-body {
  padding-top: 0;
  line-height: 1.6;
  color: #475569;
}

#zone-faq-cachee.collapse {
  width: auto;
  margin: 0;
}

