/* ===== VARIABLES ===== */
:root {
  --jai-primary: #0A4DA2;
}

/* ===== CONTENEUR PRINCIPAL ===== */
#ai-chat-box {
  position: fixed;
  bottom: 20px;
  width: 340px;
  max-width: 90%;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  font-family: Arial, sans-serif;
  z-index: 9999;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Position */
#ai-chat-box.pos-right { right: 20px; left: auto; }
#ai-chat-box.pos-left  { left: 20px;  right: auto; }

/* MODE RÉDUIT = MASCOTTE */
#ai-chat-box.minimized {
  width: auto;
  height: auto;
  background: transparent;
  box-shadow: none;
}

/* ===== HEADER ===== */
#ai-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--jai-primary);
  color: #ffffff;
  padding: 12px 16px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 16px;
  max-height: 70px;
  overflow: hidden;
}

/* Avatar */
#ai-chat-header img {
  width: 46px !important;
  height: 46px !important;
  min-width: 46px !important;
  min-height: 46px !important;
  border-radius: 60% !important;
  object-fit: cover !important;
  flex-shrink: 0 !important;
  border: 2px solid #ffffff;
  background: #ffffff;
}

/* Nom */
#ai-chat-header span {
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
}

/* WhatsApp link */
#ai-chat-wa{
  margin-left: auto;
  font-size: 12px;
  color: #fff;
  text-decoration: none;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 999px;
}
#ai-chat-wa:hover{
  border-color: rgba(255,255,255,0.9);
}

/* ===== ZONE MESSAGES ===== */
#ai-chat-messages {
  padding: 15px;
  max-height: 320px;
  overflow-y: auto;
  background: #fafafa;
  overflow-anchor: none;
}

/* LIENS */
#ai-chat-messages a {
  color: var(--jai-primary);
  font-weight: 600;
  text-decoration: none;
}

/* ===== ZONE SAISIE ===== */
#ai-chat-input {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #eee;
  background: #ffffff;
}

#ai-chat-input input {
  flex: 1;
  padding: 10px;
  border-radius: 20px;
  border: 1px solid #ddd;
  outline: none;
}

/* BOUTON ENVOI */
#ai-chat-input button {
  background: var(--jai-primary);
  color: #ffffff;
  border: none;
  border-radius: 60%;
  width: 42px;
  height: 42px;
  cursor: pointer;
  font-size: 18px;
}

/* MASQUER CONTENU QUAND MINIMISÉ */
#ai-chat-box.minimized #ai-chat-messages,
#ai-chat-box.minimized #ai-chat-input {
  display: none;
}

/* ===== MESSAGES ===== */
.clarisse-message {
  padding: 8px 10px;
  margin: 6px 0;
  background: #f6f8fa;
  border-radius: 6px;
  scroll-margin-top: 12px;
}

.user-message {
  padding: 6px 8px;
  margin: 6px 0;
}

.clarisse-loader {
  font-size: 0.9em;
  color: #666;
  margin: 4px 0;
}
