:root {
  --jl-blue: #1e73be;
  --jl-blue-hover: #1764a5;
  --jl-bg: #ffffff;
  --jl-bg-alt: #f5f7fa;
  --jl-border: #d9dde2;
  --jl-text: #1f2937;
  --jl-text-muted: #6b7280;
  --jl-radius-lg: 18px;
  --jl-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
  --jl-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ROOT */
#jl-chatbot-root {
  font-family: var(--jl-font);
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9999;
}

/* BOUTON BULLE */
.jl-chatbot-bubble {
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: 999px;
  border: 2px solid rgba(248, 250, 252, 0.18);
  background: #1e73be; /* Couleur unie */
  box-shadow: var(--jl-shadow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.25s ease;
}

.jl-chatbot-bubble:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.jl-chatbot-bubble-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 22px;
  color: #ffffff;
}

.jl-chatbot-bubble-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ff0000;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 7px;
  box-shadow: 0 6px 18px rgba(249, 115, 22, 0.65);
  text-transform: uppercase;
}

/* INFOBULLE */
.jl-chatbot-tooltip {
  position: absolute;
  left: 80px;
  bottom: 9px;
  background: #ffffff; /* Fond blanc */
  color: var(--jl-text); /* Texte gris foncé */
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 13px;
  white-space: nowrap;
  border: 1px solid rgba(0, 0, 0, 0.12); /* Légère bordure gris clair */
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15); /* Ombre douce, style Elfsight */
  opacity: 0;
  transform: translateX(8px);
  pointer-events: none;
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}


.jl-chatbot-tooltip-dot {
  width: 6px;
  height: 6px;
  background: var(--jl-blue);
  border-radius: 999px;
  display: inline-block;
  margin-right: 6px;
}

#jl-chatbot-root:not(.jl-open) .jl-chatbot-bubble:hover + .jl-chatbot-tooltip {
  opacity: 1;
  transform: translateX(0);
}

/* FENÊTRE */
.jl-chatbot-window {
  position: absolute;
  bottom: 78px;
  left: 0;
  width: min(360px, 94vw);
  max-height: 520px;
  background: white;
  border-radius: 20px;
  border: 1px solid var(--jl-border);
  box-shadow: var(--jl-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;

  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#jl-chatbot-root.jl-open .jl-chatbot-window {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* HEADER */
.jl-chatbot-header {
  background: var(--jl-bg-alt);
  border-bottom: 1px solid var(--jl-border);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.jl-chatbot-header-logo {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--jl-blue);
  color: white;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.jl-chatbot-header-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--jl-text);
}

.jl-chatbot-header-title span {
  background: var(--jl-blue);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  margin-left: 4px;
}

.jl-chatbot-header-subtitle {
  font-size: 11px;
  color: var(--jl-text-muted);
}

.jl-chatbot-header-close {
  background: transparent;
  border: none;
  color: var(--jl-text-muted);
  font-size: 18px;
  cursor: pointer;
}

.jl-chatbot-header-close:hover {
  color: var(--jl-text);
}

/* MESSAGES */
.jl-chatbot-messages {
  padding: 12px;
  flex: 1;
  overflow-y: auto;
  background: white;
}

.jl-chatbot-message {
  margin-bottom: 10px;
  max-width: 85%;
}

.jl-chatbot-message.user {
  margin-left: auto;
}

.jl-chatbot-bubble-inner {
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.4;
}

/* BULLES */
.jl-chatbot-message.bot .jl-chatbot-bubble-inner {
  background: var(--jl-bg-alt);
  color: var(--jl-text);
  border: 1px solid var(--jl-border);
  border-radius: 14px 14px 14px 4px;
}

.jl-chatbot-message.user .jl-chatbot-bubble-inner {
  background: var(--jl-blue);
  color: white;
  border-radius: 14px 14px 4px 14px;
}

.jl-chatbot-meta {
  font-size: 10px;
  color: var(--jl-text-muted);
  margin-top: 2px;
}

/* QUESTIONS RAPIDES */
.jl-chatbot-quick-questions {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.jl-chatbot-quick-title {
  width: 100%;
  font-size: 11px;
  color: var(--jl-text-muted);
}

.jl-chatbot-quick-questions button {
  font-size: 11px;
  background: white;
  border: 1px solid var(--jl-border);
  color: var(--jl-text);
  border-radius: 999px;
  padding: 5px 10px;
  cursor: pointer;
}

.jl-chatbot-quick-questions button:hover {
  border-color: var(--jl-blue);
}

/* INPUT */
.jl-chatbot-input {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--jl-bg-alt);
  border-top: 1px solid var(--jl-border);
  padding: 10px;
}

.jl-chatbot-input input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--jl-border);
  border-radius: 999px;
  background: white;
  color: var(--jl-text);
}

.jl-chatbot-input input::placeholder {
  color: var(--jl-text-muted);
}

.jl-chatbot-input button#jl-chatbot-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;                   /* espace entre l’icône et le texte */
  padding: 0 16px;            /* largeur suffisante */
  height: 38px;               /* hauteur adaptée */
  
  background: var(--jl-blue);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;

  border: none;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;        /* pour éviter le passage à la ligne */

  box-shadow: 0 10px 24px rgba(30, 115, 190, 0.35);
  transition:
    background 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.jl-chatbot-input button#jl-chatbot-send:hover {
  background: var(--jl-blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(30, 115, 190, 0.5);
}

/* Icône avion */
#jl-chatbot-send .icon i {
  font-size: 14px;
  color: #ffffff;
  margin-top: 1px; /* léger ajustement vertical */
}

/* Texte "Envoyer" */
#jl-chatbot-send .label {
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
}

/* TYPING */
.jl-chatbot-typing {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  font-size: 11px;
  color: var(--jl-text-muted);
}

.jl-chatbot-typing-dot {
  width: 5px;
  height: 5px;
  background: var(--jl-text-muted);
  border-radius: 999px;
  animation: typing 1s infinite ease-in-out;
}

.jl-chatbot-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.jl-chatbot-typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing {
  0%, 80%, 100% { opacity: 0.4; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

/* MOBILE */
@media (max-width: 480px) {
  #jl-chatbot-root {
    bottom: 10px;
    left: 10px;
  }
  .jl-chatbot-window {
    width: 100vw;
    bottom: 75px;
    border-radius: 20px 20px 0 0;
  }
  .jl-chatbot-tooltip { display: none; }
}

.jl-chatbot-powered {
  display: inline-block;
  margin-top: 6px;
  background: #22c55e;
  color: white;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  width: fit-content;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
}

/* Réduire la taille du texte dans le champ de saisie */
.jl-chatbot-input input {
  font-size: 12px !important;
  padding: 7px 12px; /* optionnel : garde une belle hauteur */
}

.jl-chatbot-input input::placeholder {
  font-size: 12px !important;
}

/* Nouveau champ textarea */
.jl-chatbot-input textarea {
  flex: 1;
  resize: none; /* empêché le redimensionnement manuel */
  overflow-y: hidden; /* évite le scroll inutile */
  padding: 8px 12px;
  border: 1px solid var(--jl-border);
  background: #ffffff;
  color: var(--jl-text);
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.4;
  max-height: 90px; /* limite pour ne pas casser le design */
  outline: none;
}

.jl-chatbot-input textarea::placeholder {
  color: var(--jl-text-muted);
  font-size: 12px;
}
