/* Styles pour le chat OpenAI */
.mabible-chat-single-container,
.mabible-chat-single-container * {
  font-family: "Poppins", sans-serif !important;
}

/* ===================================
   ONGLET LATÉRAL D'HISTORIQUE
   =================================== */

/* Sidebar d'historique */
.mabible-history-sidebar {
  position: fixed;
  top: 0;
  left: -400px;
  width: 400px;
  height: 100vh;
  background: #ffffff;
  box-shadow: 2px 0 15px rgba(0, 0, 0, 0.1);
  z-index: 9999;
  transition: left 0.3s ease;
  display: flex;
  flex-direction: column;
}

.mabible-history-sidebar.open {
  left: 0;
  margin-top: 5%;
}

/* Header de la sidebar */
.history-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #006738 0%, #94c11f 100%);
  color: white;
  border-bottom: 2px solid #f16521;
}

.history-sidebar-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: white;
}

/* Conteneur des boutons du header */
.history-header-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Bouton supprimer tout l'historique */
.history-delete-all-btn {
  background: rgba(241, 101, 33, 0.3);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  padding: 0;
}

.history-delete-all-btn:hover {
  background: rgba(241, 101, 33, 0.5);
  transform: scale(1.1);
}

.history-delete-all-btn svg {
  width: 16px;
  height: 16px;
  stroke: white;
}

/* Bouton fermer */
.history-close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  padding: 0;
}

.history-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.history-close-btn svg {
  width: 18px;
  height: 18px;
  stroke: white;
}

/* Contenu de la sidebar */
.history-sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f9f9f9;
}

/* Loading state */
.history-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #666;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e0e0e0;
  border-top-color: #006738;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Question item dans l'historique (conversations) */
.history-question-item,
.history-conversation-item {
  background: white;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  border-left: 4px solid #94c11f;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.history-question-item:hover,
.history-conversation-item:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border-left-color: #f16521;
}

.history-question-text {
  font-size: 14px;
  color: #2c3e50;
  margin: 0 0 8px 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-question-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #999;
  gap: 10px;
}

.history-question-source {
  background: #006738;
  color: white;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 10px;
  text-transform: uppercase;
}

.history-question-source.source-chat {
  background: #006738;
}

.history-question-source.source-reading {
  background: #94c11f;
}

.history-question-source.source-verset {
  background: #f16521;
}

.history-question-source.source-Dictionnaire {
  background: #666;
}

.history-question-date {
  color: #999;
  font-size: 11px;
}

.history-message-count {
  color: #666;
  font-size: 11px;
  font-weight: 500;
}

/* État vide */
.history-empty {
  text-align: center;
  padding: 40px 20px;
  color: #999;
}

.history-empty-icon {
  font-size: 48px;
  margin-bottom: 15px;
  opacity: 0.5;
}

.history-empty-text {
  font-size: 14px;
  line-height: 1.6;
}

/* Bouton toggle flottant */
.history-toggle-btn {
  position: fixed;
  left: 20px;
  top: 150px;
  background: linear-gradient(135deg, #006738 0%, #94c11f 100%);
  color: white;
  border: none;
  border-radius: 25px;
  padding: 12px 20px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 103, 56, 0.3);
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  font-family: "Poppins", sans-serif;
}

.history-toggle-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 103, 56, 0.4);
}

.history-toggle-btn svg {
  width: 20px;
  height: 20px;
  stroke: white;
}

.history-toggle-btn.hidden {
  display: none;
}

/* Responsive */
@media (max-width: 768px) {
  .mabible-history-sidebar {
    width: 85%;
    left: -85%;
  }

  .history-toggle-btn {
    left: 10px;
    top: 80px;
    padding: 10px 16px;
    font-size: 13px;
  }

  .history-toggle-btn span {
    display: none;
  }
}

.mabible-model-selector {
  margin-bottom: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
}

.mabible-model-selector h3 {
  margin: 0 0 10px 0;
  color: #2c3e50;
  font-size: 16px;
}
.disclaimer-single-message {
  font-size: 11px;
  color: #666;
  margin: 0;
  text-align: center;
  font-family: "Poppins", sans-serif;
  font-weight: 400;
}
.model-options {
  display: flex;
  gap: 15px;
}

.model-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.model-option input[type="radio"] {
  margin: 0;
}

.model-name {
  font-size: 14px;
  color: #2c3e50;
}

.conversation-header {
  margin-bottom: 20px;
}

.conversation-header h3 {
  margin: 0 0 10px 0;
  color: #2c3e50;
  font-size: 18px;
}

.disclaimer {
  font-size: 12px;
  color: #666;
  margin: 0;
}

.message {
  margin-bottom: 20px;
  padding: 15px 20px;
  border-radius: 12px;
  max-width: 90%;
  animation: fadeInUp 0.3s ease;
  position: relative;
}

/* Ajouter une marge supplémentaire au dernier message pour éviter qu'il soit caché */
.message:last-child {
  margin-bottom: 50px;
}

.message.user {
  background: #dcc7b2;
  margin-left: auto;
  border-bottom-right-radius: 4px;
  background: linear-gradient(
    90deg,
    rgba(139, 198, 63, 0.322) 0%,
    rgba(147, 193, 31, 0.512) 50%,
    rgb(140, 198, 62) 100%
  );
}

.message.assistant {
  background: #f5f5f5;
  margin-right: auto;
  border-bottom-left-radius: 4px;
  margin-bottom: 45px; /* Plus d'espace après chaque réponse de Jean (augmenté pour la section audio) */
}

/* Marge importante pour le dernier message assistant pour éviter qu'il soit caché par le champ de saisie */
.message.assistant:last-of-type,
#conversation-history .message.assistant:last-child,
.conversation-history .message.assistant:last-child {
  margin-bottom: 350px !important; /* Augmenté pour la section audio intégrée + encart questions */
}

.message-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
  opacity: 1; /* rendre visible par défaut */
  transition: opacity 0.2s ease;
  gap: 8px;
  z-index: 5; /* s'assurer qu'il est au-dessus du contenu */
}

.message.assistant:hover .message-header {
  opacity: 1;
}

.copy-response-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  color: #666;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.copy-response-btn:hover {
  background: #e0e0e0;
  color: #51483f;
  transform: scale(1.1);
}

.copy-response-btn:active {
  transform: scale(0.95);
}

.copy-response-btn svg {
  width: 16px;
  height: 16px;
}

/* Styles pour le bouton play TTS */
.play-tts-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  color: #666;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-tts-btn:hover {
  background: #e0e0e0;
  color: #51483f;
  transform: scale(1.1);
}

.play-tts-btn:active {
  transform: scale(0.95);
}

.play-tts-btn svg {
  width: 16px;
  height: 16px;
}

/* Forcer visibilité des boutons situés dans .message-header sur mobile */
@media (max-width: 980px) {
  .et_pb_section {
    padding: 5px 0 !important;
  }
}
@media (max-width: 768px) {
  .message-header {
    opacity: 1 !important;
    position: relative;
    top: 0;
    right: 0;
  }

  /* Ajuster la marge du dernier message assistant pour mobile */
  .message.assistant:last-of-type,
  #conversation-history .message.assistant:last-child,
  .conversation-history .message.assistant:last-child {
    margin-bottom: 280px !important; /* Plus d'espace sur mobile car le clavier virtuel peut réduire l'espace */
  }

  .copy-response-btn,
  .play-tts-btn {
    min-width: 36px;
    min-height: 36px;
    padding: 6px;
    background: #fff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    color: #333;
  }
}

/* ===================================
   SECTION AUDIO COMPLÈTE (BOUTON + STATUT + LECTEUR)
   =================================== */

/* Section audio complète en dessous de chaque message */
.message-audio-section {
  margin-top: 15px;
  margin-bottom: 40px;
  padding-top: 15px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeInSection 0.3s ease;
}

@keyframes fadeInSection {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Bouton "Écouter la réponse" en dessous du message */
.play-tts-btn-bottom {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #006738 0%, #94c11f 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 103, 56, 0.2);
  align-self: flex-start;
}

.play-tts-btn-bottom:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 103, 56, 0.3);
  background: linear-gradient(135deg, #007840 0%, #a0d020 100%);
}

.play-tts-btn-bottom:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 103, 56, 0.2);
}

.play-tts-btn-bottom svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.play-tts-btn-bottom span {
  font-family: "Poppins", sans-serif;
}

/* Messages de statut (génération en cours, prêt, erreur) */
.voice-status-message {
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  animation: fadeInMessage 0.3s ease;
}

@keyframes fadeInMessage {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.voice-status-message.voice-status-info {
  background: #c3e6cb;
  color: #006738;
  border-left: 3px solid #c3e6cb;
}

.voice-status-message.voice-status-success {
  background: #c3e6cb;
  color: #006738;
  border-left: 3px solid #c3e6cb;
}

.voice-status-message.voice-status-error {
  background: #ffebee;
  color: #c62828;
  border-left: 3px solid #f44336;
}

/* Container du lecteur audio dans chaque message */
.message-audio-player {
  margin-top: 5px;
  animation: fadeInPlayer 0.4s ease;
}

@keyframes fadeInPlayer {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Styles pour les lecteurs Essential Audio */
.message-audio-player .essential_audio {
  height: 35px;
  margin-top: 10px;
}

/* Assurer que les sections s'affichent correctement sur mobile */
@media (max-width: 768px) {
  .message-audio-section {
    margin-top: 12px;
    margin-bottom: 20px;
    padding-top: 12px;
  }

  .play-tts-btn-bottom {
    padding: 8px 14px;
    font-size: 13px;
  }

  .voice-status-message {
    padding: 8px 12px;
    font-size: 12px;
  }

  .message-audio-player {
    margin-top: 12px;
    padding-top: 12px;
  }
}

.message-content {
  font-size: 14px;
  line-height: 1.6;
  color: #2c3e50;
  font-family: "Poppins", sans-serif !important;
}

.mabible-quick-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.quick-question {
  padding: 8px 12px;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 13px;
  color: #2c3e50;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-question:hover {
  background: #f5ece3;
  border-color: #51483f;
  color: #51483f;
}

.mabible-ai-input {
  margin-top: auto;
  flex-shrink: 0;
  background: #fff;
  padding: 15px;
  border-top: 1px solid #e0e0e0;
  border-radius: 0 0 8px 8px;
}

.mabible-ai-input textarea {
  width: 100%;
  min-height: 80px;
  max-height: 150px;
  padding: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-family: "Poppins", sans-serif;
  resize: vertical;
  margin-bottom: 10px;
  box-sizing: border-box;
}

.mabible-ai-input textarea:focus {
  outline: none;
  border-color: #51483f;
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}
/*** CHAT SINGLE ***/
.mabible-single-ai-input {
  flex-shrink: 0;
  background: #fff;
  padding: 9px;
  width: 80%;
  margin-left: auto;
  margin-right: auto;
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  z-index: 999;
  max-width: 1000px;
}

.mabible-single-ai-input textarea {
  width: 100%;
  min-height: 20px;
  max-height: 150px;
  padding: 5px;
  border: none !important;
  font-size: 14px;
  font-family: "Poppins", sans-serif;
  resize: vertical;
  margin-bottom: 0px;
  box-sizing: border-box;
}

.mabible-single-ai-input textarea:focus {
  outline: none;
  border-color: #51483f;
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

.mabible-single-ai-input textarea:disabled {
  background-color: #f8f9fa;
  color: #6c757d;
  cursor: not-allowed;
  opacity: 0.7;
}

.user-welcome-message {
  font-size: 1.8em;
  text-align: center;
  font-weight: bold;
  color: #ea5b0c;
  margin: 0 0 10px 0;
  padding: 10px;
}

.welcome-single-message {
  font-size: 32px;
  text-align: center;
  font-weight: bold;
  margin: 20px 0;
}

.mabible-chat-single-container {
  width: 95%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  background: white;
  min-height: 100vh;
}

.single-disclaimer {
  font-size: 12px;
  color: #666;
  margin: 30px 0 200px 0;
  text-align: center;
  padding: 0 20px;
}

.mabible-single-conversation-header {
  margin-bottom: 20px;
  background-color: white;
  text-align: center;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Messages d'essai gratuit */
.free-trial-notice {
  margin: 20px auto;
  max-width: 600px;
  padding: 15px 20px;
  background: #fff3cd;
  border: 2px solid #f16521;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(241, 101, 33, 0.2);
}

.trial-message {
  margin: 0;
  font-size: 15px;
  color: #2c3e50;
  line-height: 1.6;
}

.trial-message strong {
  color: #f16521;
  font-weight: 600;
}

#questions-remaining {
  font-size: 18px;
  font-weight: bold;
  color: #006738;
}

.trial-link {
  color: #006738;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid #94c11f;
  transition: all 0.2s ease;
}

.trial-link:hover {
  color: #f16521;
  border-bottom-color: #f16521;
}

/* Message d'essai gratuit expiré */
.free-trial-expired {
  margin: 30px auto;
  max-width: 500px;
  padding: 30px;
  background: #f8f9fa;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.free-trial-expired .mabible-ai-avatar {
  margin-bottom: 15px;
}

.expired-message {
  font-size: 16px;
  color: #2c3e50;
  margin: 0 0 20px 0;
  line-height: 1.6;
}

.trial-link-primary {
  display: inline-block;
  padding: 12px 30px;
  background: #f16521;
  color: white;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(241, 101, 33, 0.3);
}

.trial-link-primary:hover {
  background: #d65a1e;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(241, 101, 33, 0.4);
}

.login-alternative {
  margin: 15px 0 0 0;
  font-size: 14px;
  color: #666;
}

/* Champ de saisie désactivé */
.mabible-single-ai-input.disabled {
  opacity: 0.6;
  pointer-events: none;
}

/* Lecteur audio sticky (masqué par défaut) */
.global-audio-sticky {
  position: fixed;
  bottom: 202px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  max-width: 600px;
  z-index: 999;
  animation: slideInUp 0.3s ease;
}

/* Lecteur audio simple - compatible tous navigateurs */
.audio-player-simple {
  position: relative;
  padding: 15px 20px;
  background: linear-gradient(135deg, #006738 0%, #94c11f 100%);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 103, 56, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.audio-player-simple audio {
  width: 100%;
  max-width: 500px;
  height: 40px;
  border-radius: 8px;
  outline: none;
}

.audio-close-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 32px;
  height: 32px;
  background: #dc3545;
  border: 2px solid white;
  border-radius: 50%;
  color: white;
  font-size: 20px;
  font-weight: bold;
  line-height: 28px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.audio-close-btn:hover {
  background: #c82333;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Ajuster la position du compteur quand le lecteur audio est visible */
.global-audio-sticky:not([style*="display: none"])
  ~ .free-trial-counter-sticky {
  bottom: 125px;
}

/* Compteur d'essai gratuit sticky (toujours visible) */
.free-trial-counter-sticky {
  position: fixed;
  bottom: 125px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  max-width: 1000px;
  padding: 10px 20px;
  background: #fff3cd;
  border: 2px solid #f16521;
  border-radius: 8px;
  box-shadow: 0 -2px 8px rgba(241, 101, 33, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  z-index: 998;
  animation: slideInUp 0.3s ease;
  transition: bottom 0.3s ease;
}

.free-trial-counter-sticky.expired {
  background: #ffe0e0;
  border-color: #dc3545;
}

.counter-icon {
  font-size: 20px;
}

.counter-text {
  font-size: 14px;
  color: #2c3e50;
  font-weight: 500;
}

.counter-text strong {
  font-size: 16px;
  color: #f16521;
  font-weight: 700;
}

.counter-link {
  padding: 6px 15px;
  background: #006738;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.counter-link:hover {
  background: #94c11f;
  transform: translateY(-1px);
}

.counter-link-cta {
  padding: 8px 20px;
  background: #f16521;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(241, 101, 33, 0.3);
}

.counter-link-cta:hover {
  background: #d65a1e;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(241, 101, 33, 0.4);
}

/* Animation d'apparition */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Conteneur de conseils */
.mabible-tips-container {
  margin: 30px auto;
  max-width: 800px;
  padding: 25px 30px;
  background: #e8f5e9;
  border: 2px solid #94c11f;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 103, 56, 0.1);
}

.tips-title {
  margin: 0 0 20px 0;
  font-size: 18px;
  font-weight: 600;
  color: #006738;
  text-align: center;
}

.tips-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.tips-column h5 {
  margin: 0 0 12px 0;
  font-size: 15px;
  font-weight: 600;
  color: #006738;
  padding-bottom: 8px;
  border-bottom: 2px solid #94c11f;
}

.tips-column ul {
  margin: 0;
  padding-left: 20px;
  list-style-type: none;
}

.tips-column li {
  margin-bottom: 8px;
  font-size: 12px;
  line-height: 1.6;
  color: #2c3e50;
  position: relative;
  text-align: left;
}

.tips-column li:before {
  content: "✓";
  position: absolute;
  left: -15px;
  color: #94c11f;
  font-weight: bold;
}

/* Responsive pour mobile */
@media (max-width: 768px) {
  .mabible-tips-container {
    padding: 20px;
    margin: 20px 15px;
  }

  .tips-title {
    font-size: 16px;
  }

  .tips-columns {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .tips-column h5 {
    font-size: 14px;
  }

  .tips-column li {
    font-size: 13px;
  }

  /* Ajustements pour le lecteur audio sur mobile */
  .global-audio-sticky {
    bottom: 125px;
    width: 90%;
    max-width: 90%;
  }

  .audio-player-simple {
    padding: 12px 15px;
  }

  .audio-player-simple audio {
    height: 35px;
    max-width: 100%;
  }

  .audio-close-btn {
    width: 28px;
    height: 28px;
    top: -8px;
    right: -8px;
    font-size: 18px;
    line-height: 24px;
  }

  /* Ajuster la position du compteur quand le lecteur audio est visible sur mobile */
  .global-audio-sticky:not([style*="display: none"])
    ~ .free-trial-counter-sticky {
    bottom: 210px;
  }

  /* Ajustements pour le compteur sticky sur mobile */
  .free-trial-counter-sticky {
    bottom: 145px;
    width: 90%;
    padding: 8px 15px;
    gap: 10px;
    flex-wrap: wrap;
  }

  .counter-icon {
    font-size: 18px;
  }

  .counter-text {
    font-size: 12px;
  }

  .counter-text strong {
    font-size: 14px;
  }

  .counter-link,
  .counter-link-cta {
    font-size: 12px;
    padding: 6px 12px;
  }
}

.mabible-single-ai-container {
  background-color: white !important;
  display: flex;
  flex-direction: column;
}

/* Styles pour les exemples de questions (style Gemini) */
.conversation-examples {
  margin-top: 30px;
}

.examples-title {
  font-size: 16px;
  color: #666;
  margin-bottom: 15px;
  font-weight: 500;
}

.example-questions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 800px;
  margin: 0 auto;
  justify-content: center;
}

.example-question {
  padding: 10px 20px;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  font-size: 12px;
  color: #2c3e50;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  font-family: "Poppins", sans-serif;
  font-weight: 400;
  flex: 1;
  min-width: 200px;
  max-width: 250px;
}

.example-question:hover {
  background: #8cc63e73;
  border-color: #8cc63e;
  color: #006738;
  transform: translateY(-1px);
}

.example-question:active {
  transform: translateY(0);
}

/* Zone de conversation - Style One-Page */
.mabible-conversation {
  padding: 20px;
  padding-bottom: 250px; /* Espace pour le champ de saisie fixe */
  background: white;
  position: relative;
  min-height: 100vh;
  overflow: visible; /* Pas de scroll ici */
}

/* Historique de conversation - Pas de scroll */
.conversation-history {
  overflow: visible; /* Pas de scroll, le contenu s'étend naturellement */
  max-height: none; /* Pas de limite de hauteur */
  height: auto;
  padding-bottom: 50px; /* Espace permanent en bas pour tous les messages */
}

/* Personnalisation de la scrollbar pour la page entière */
html:has(.mabible-chat-single-container) {
  scroll-behavior: smooth;
}

body:has(.mabible-chat-single-container)::-webkit-scrollbar {
  width: 10px;
}

body:has(.mabible-chat-single-container)::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

body:has(.mabible-chat-single-container)::-webkit-scrollbar-thumb {
  background: #94c11f;
  border-radius: 10px;
  transition: background 0.3s ease;
}

body:has(.mabible-chat-single-container)::-webkit-scrollbar-thumb:hover {
  background: #006738;
}

/* Scrollbar pour Firefox sur la page */
body:has(.mabible-chat-single-container) {
  scrollbar-width: thin;
  scrollbar-color: #94c11f #f1f1f1;
}

/* Boutons de navigation flottants - Petit et discret au-dessus du champ de saisie */
.scroll-to-bottom,
.scroll-to-top {
  position: fixed;
  left: 50%;
  width: 16px;
  height: 16px;
  background: #f16521;
  color: #ffffff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(241, 101, 33, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) scale(0.8);
  transition: all 0.3s ease;
  padding: 0;
  line-height: 1;
}

.scroll-to-bottom.visible,
.scroll-to-top.visible {
  opacity: 0.85;
  visibility: visible;
  transform: translateX(-50%) scale(1);
}

.scroll-to-bottom {
  bottom: 115px;
}

.scroll-to-top {
  bottom: 115px;
}

.scroll-to-bottom:hover {
  opacity: 1;
  background: #d65418;
  transform: translateX(-50%) scale(1.15);
  box-shadow: 0 2px 6px rgba(241, 101, 33, 0.4);
}

.scroll-to-top:hover {
  opacity: 1;
  background: #d65418;
  transform: translateX(-50%) scale(1.15);
  box-shadow: 0 2px 6px rgba(241, 101, 33, 0.4);
}

.scroll-to-bottom:active {
  transform: translateX(-50%) scale(0.9);
}

.scroll-to-top:active {
  transform: translateX(-50%) scale(0.9);
}

.scroll-to-bottom svg,
.scroll-to-top svg {
  width: 10px;
  height: 10px;
  stroke: #ffffff;
  fill: none;
}

/* Badge indicateur de nouveaux messages */
.new-messages-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #f16521;
  color: white;
  font-size: 10px;
  font-weight: bold;
  padding: 3px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* Animation d'apparition */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Indication pour la touche Entrée */
.enter-hint {
  font-size: 12px;
  color: #666;
  font-style: italic;
  display: flex;
  align-items: center;
}

.enter-hint::before {
  content: "⏎";
  margin-right: 5px;
  font-size: 14px;
  color: #51483f;
}

/* Styles pour l'état de chargement */
.loading-message {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #666;
  font-style: italic;
}

.loading-dots {
  display: inline-flex;
  gap: 2px;
}

.loading-dots span {
  width: 4px;
  height: 4px;
  background: #666;
  border-radius: 50%;
  animation: loadingDots 1.4s infinite ease-in-out;
}

.loading-dots span:nth-child(1) {
  animation-delay: -0.32s;
}
.loading-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes loadingDots {
  0%,
  80%,
  100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* Responsive pour mobile */
@media (max-width: 768px) {
  .user-welcome-message {
    font-size: 1em;
    padding: 8px;
  }

  .welcome-single-message {
    font-size: 4vw;
    margin: 15px 0;
  }

  .mabible-single-ai-input {
    width: 90%;
    bottom: 10px;
    max-width: none;
  }

  .mabible-conversation {
    padding-bottom: 250px; /* Plus d'espace sur mobile */
    padding-left: 0px !important;
    padding-right: 0px !important;
  }

  .example-questions {
    max-width: 100%;
    flex-direction: column;
  }

  .example-question {
    padding: 12px 15px;
    font-size: 13px;
    min-width: auto;
    max-width: none;
    flex: none;
  }

  .message {
    max-width: 95%;
    padding: 12px 15px;
  }

  /* Marge encore plus grande sur mobile pour le dernier message */
  .message:last-child {
    margin-bottom: 180px;
  }

  .mabible-single-conversation-header {
    padding: 15px;
  }
  .conversation-history {
    margin: 0 auto;
    max-width: 100%;
    overflow: visible; /* Pas de scroll sur mobile non plus */
    max-height: none;
    padding-bottom: 100px; /* Plus d'espace sur mobile */
  }

  .copy-notification {
    top: 30px;
    right: 10px;
    font-size: 13px;
    padding: 10px 16px;
  }

  .message.assistant:hover .message-header {
    opacity: 1;
  }

  .message-header {
    opacity: 1;
  }

  /* Ajustements pour les boutons de scroll sur mobile */
  .scroll-to-bottom,
  .scroll-to-top {
    width: 14px;
    height: 14px;
  }

  .scroll-to-bottom {
    bottom: 135px;
    margin-left: 10px;
  }

  .scroll-to-top {
    bottom: 135px;
    margin-left: -10px;
  }

  .scroll-to-bottom svg,
  .scroll-to-top svg {
    width: 9px;
    height: 9px;
  }
}

/* Style pour la notice de connexion */
.mabible-login-notice-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}

.mabible-login-notice {
  background: #f8f9fa;
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  max-width: 500px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.mabible-ai-avatar {
  margin-bottom: 15px;
}

.mabible-login-link,
.mabible-register-link {
  color: #51483f;
  text-decoration: none;
  font-weight: 500;
}

.mabible-login-link:hover,
.mabible-register-link:hover {
  text-decoration: underline;
}

/*** END CHAT SINGLE ***/

.input-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.char-count {
  font-size: 9px;
  color: #acabab;
}
/* Conteneur parent pour les boutons voice et send */
.input-buttons-container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1px;
  margin-bottom: 0px;
}

/* Conteneur du bouton send du textarea */
.send-input-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  margin-right: 20px;
  padding: 0;
}
.send-input-btn {
  padding: 12px;
  cursor: pointer;
  color: #495057;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  background: #fff;
}

.send-input-btn:hover {
  color: white;
  transform: scale(1.05);
}
/* Conteneur du bouton vocal au-dessus du textarea */
.voice-input-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  padding: 0;
}

.voice-hint {
  font-size: 12px;
  color: #666;
  font-style: italic;
  transition: color 0.3s ease;
}

.voice-input-container:hover .voice-hint {
  color: #51483f;
}

/* Bouton de reconnaissance vocale */
.voice-input-btn {
  padding: 12px;
  cursor: pointer;
  color: #495057;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  background: #fff;
}

.voice-input-btn:hover {
  color: white;
  transform: scale(1.05);
}

.voice-input-btn:active {
  transform: scale(0.95);
}

/* État d'écoute du bouton vocal */
.voice-input-btn.listening {
  background: #dc3545;
  border-color: #dc3545;
  color: white;
  animation: voicePulse 1.5s infinite;
  box-shadow: 0 0 20px rgba(220, 53, 69, 0.5);
}

.voice-input-btn.listening:hover {
  background: #c82333;
  border-color: #c82333;
}

@keyframes voicePulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}

/* Statuts de la reconnaissance vocale */
.voice-status {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Poppins", sans-serif !important;
  animation: slideInDown 0.3s ease;
  line-height: 1.4;
}

/* Bouton d'annulation dans le statut vocal */
.voice-status #cancel-auto-send {
  background: #dc3545 !important;
  color: white !important;
  border: none !important;
  border-radius: 3px !important;
  padding: 2px 6px !important;
  cursor: pointer !important;
  font-size: 11px !important;
  margin-left: 10px !important;
  transition: background-color 0.2s ease !important;
}

.voice-status #cancel-auto-send:hover {
  background: #c82333 !important;
  transform: scale(1.05);
}

.voice-status-info {
  background: #e3f2fd;
  color: #1976d2;
  border: 1px solid #bbdefb;
}

.voice-status-listening {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.voice-status-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.voice-status-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive pour la reconnaissance vocale */
@media (max-width: 768px) {
  .footer-controls {
    gap: 8px;
  }

  .voice-input-container {
    margin-bottom: 8px;
    gap: 8px;
  }

  .voice-input-btn {
    min-width: 40px;
    height: 40px;
    padding: 10px;
  }

  .voice-input-btn svg {
    width: 14px;
    height: 14px;
  }

  .voice-hint {
    font-size: 11px;
  }

  .voice-status {
    font-size: 12px;
    padding: 6px 10px;
  }

  .enter-hint {
    font-size: 11px;
  }
}

/* Styles pour le bouton Envoyer (gardé pour compatibilité avec l'autre shortcode) */
#ask-ai {
  padding: 8px 20px;
  background: #51483f;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

#ask-ai:hover {
  background: #3d342e;
}

#ask-ai:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.ai-response {
  line-height: 1.6;
  font-family: "Poppins", sans-serif !important;
}

.ai-response p {
  margin-bottom: 10px;
  font-family: "Poppins", sans-serif !important;
}

.ai-response p:last-child {
  margin-bottom: 0;
}

.ai-response strong {
  color: #2c3e50;
  font-weight: 600;
  font-family: "Poppins", sans-serif !important;
}

.ai-response br {
  display: block;
  margin: 5px 0;
  content: "";
}

.ai-response strong:contains(":") {
  display: block;
  margin-top: 15px;
  margin-bottom: 5px;
  color: #51483f;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 3px;
}

.ai-response p:has-text("1. "),
.ai-response p:has-text("2. "),
.ai-response p:has-text("3. "),
.ai-response p:has-text("4. "),
.ai-response p:has-text("5. ") {
  margin-left: 15px;
  padding-left: 10px;
  border-left: 2px solid #e3f2fd;
}

/* Liens vers les références bibliques dans les réponses de l'IA */
.ai-response .bible-reference-link {
  color: #006738 !important;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px dotted #006738;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.ai-response .bible-reference-link:hover {
  color: #004d28 !important;
  border-bottom-color: #004d28;
  background-color: rgba(0, 103, 56, 0.05);
  padding: 2px 4px;
  border-radius: 3px;
}

.ai-response .bible-reference-link:active {
  transform: scale(0.98);
}

/* Style pour l'icône de livre dans le lien */
.ai-response .bible-reference-link::after {
  font-size: 0.9em;
  opacity: 0.7;
}

/* Amélioration visuelle au survol */
.ai-response .bible-reference-link:hover::after {
  opacity: 1;
}

.message.assistant .message-content {
  color: #2c3e50;
}

.message.assistant .ai-response p + p {
  margin-top: 8px;
}

/* Notification de copie */
.copy-notification {
  position: fixed;
  top: 120px;
  right: 20px;
  background: #51483f;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-family: "Poppins", sans-serif;
  z-index: 10000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: none;
}

.copy-notification::before {
  content: "✓";
  margin-right: 8px;
  font-weight: bold;
}
