@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

p {
  margin-block-start: 0px!important;
  margin-block-end: 0px!important;
}

#embedChatBot {
  height: 100%;
  margin: 0;
}

#embedChatBot .chatbot-root {
  width: 100%;
  height: 100%;
}

/* Global font application */
#embedChatBot *, 
#embedChatBot *::before, 
#embedChatBot *::after {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

/* Ensure Montserrat is applied to input elements */
#embedChatBot input,
#embedChatBot textarea,
#embedChatBot button,
#embedChatBot select {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}


/* --- EMBED (dans l’iframe) --- */
.chatbot-modal.embed {
  /* IMPORTANT: neutraliser tout ce que .chatbot-modal fixe pour le mode standalone */
  position: static;                 /* au lieu de fixed/relative */
  top: auto; right: auto; bottom: auto; left: auto;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border-radius: 0;
  border: 0;                        /* évite double cadre (l’iframe a déjà un border-radius géré par le parent) */
  box-shadow: none;                 /* l’ombre est gérée par le parent quand ouvert */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

/* Barre compacte (iframe fermée = 400x74px dans le parent) */
.chatbot-compact-bar {
  height: 74px;
  display:flex; align-items:center; justify-content:space-between;
  padding: 0 16px;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:8px;
  box-sizing:border-box;
}

/* --- STANDALONE (quand pas embed) : tu conserves ton rendu actuel --- */
.chatbot-modal {
  height: 600px;
  width: 400px;
  background-color: white;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  padding: 0;
  position: fixed;
  right: 24px;
  bottom: 100px; /* au-dessus du trigger */
  box-shadow: 0 20px 25px -5px rgba(0,0,0,.1), 0 10px 10px -5px rgba(0,0,0,.04);
  display: flex;
  flex-direction: column;
  z-index: 9999;
}

/* Seulement sur desktop avec écran Retina/haute densité */
@media screen and (min-resolution: 2dppx) and (min-width: 1025px) {
  .chatbot-modal {
    transform: scale(0.8);
    transform-origin: bottom right; /* ajuste la position si besoin */
  }
}

.chatbot-trigger {
  position: fixed;
  display: flex;
  bottom: 24px;
  right: 24px;
  height: 64px;
  width: 64px;
  background-color: #2563eb;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  border: none;
  z-index: 999;
}

/* État fermé (bleu) */
.chatbot-trigger:not([data-open="true"]):hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* État ouvert (rouge) */
.chatbot-trigger[data-open="true"] {
  background-color: #dc2626 !important;
}

.chatbot-trigger[data-open="true"]:hover {
  background-color: #b91c1c !important;
}

@media (max-width: 768px) {
  .chatbot-modal {
    height: 100%;
    width: 100vw;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    border-radius: 0;
    border: none;
    max-height: none;
    max-width: none;
  }
  
  .chatbot-trigger {
    bottom: 20px;
    right: 20px;
    height: 56px;
    width: 56px;
  }
}

@media (max-width: 480px) {
  .chatbot-trigger {
    bottom: 16px;
    right: 16px;
    height: 52px;
    width: 52px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .chatbot-modal {
    width: 380px;
    height: 580px;
    right: 20px;
  }
}

@media (min-width: 1025px) {
  .chatbot-modal {
    width: 420px;
    height: 650px;
    bottom: 100px; /* Position au-dessus du trigger (64px + 36px de gap) */
  }
}

/* Responsive improvements for chat content */
@media (max-width: 768px) {
  .chat-message {
    max-width: 85% !important;
    font-size: 14px !important;
  }
  
  .chat-input-container {
    padding: 12px 16px !important;
    gap: 8px !important;
  }
  
  .chat-input {
    font-size: 16px !important; /* Prevents zoom on iOS */
    padding: 10px 14px !important;
  }
  
  .chat-send-button {
    width: 40px !important;
    height: 40px !important;
  }
  
  .modal-header {
    padding: 8px 12px !important;
  }
  
  .modal-header h3 {
    font-size: 14px !important;
  }
  
  .selection-buttons {
    padding: 16px !important;
  }
  
  .selection-button {
    padding: 14px 16px !important;
    font-size: 14px !important;
  }
}

@media (max-width: 480px) {
  .chat-message {
    max-width: 90% !important;
    font-size: 13px !important;
    padding: 10px 12px !important;
  }
  
  .chat-avatar {
    width: 28px !important;
    height: 28px !important;
  }
  
  .chat-input-container {
    padding: 10px 12px !important;
  }
  
  .faq-item-button {
    padding: 16px !important;
    font-size: 14px !important;
  }
  
  .faq-answer {
    padding: 0 16px 16px 16px !important;
    font-size: 13px !important;
  }
  
  .faq-intro {
    padding: 16px !important;
    font-size: 13px !important;
  }
  
  .faq-footer {
    padding: 16px !important;
  }
  
  .faq-search-input {
    padding: 8px 10px 8px 36px !important;
    font-size: 13px !important;
  }
}


