/* Haiti Digital Chatbot v2.0 — Bleu #003087 + Or #C89B3C */
:root {
  --hdc-blue: #003087;
  --hdc-gold: #C89B3C;
  --hdc-dark: #0d1520;
  --hdc-bg:   #0d1a33;
}

/* ── Bouton flottant ── */
#hdc-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--hdc-blue), #1a4a9e);
  border: 2px solid var(--hdc-gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 28px rgba(0,48,135,.45);
  z-index: 999999;
  transition: transform .2s, box-shadow .2s;
}
#hdc-fab:hover { transform: scale(1.08); box-shadow: 0 12px 36px rgba(0,48,135,.6); }
#hdc-fab svg  { width: 26px; height: 26px; fill: white; }
#hdc-fab .hdc-badge {
  position: absolute;
  top: -4px; right: -4px;
  width: 18px; height: 18px;
  background: #e53e3e;
  border-radius: 50%;
  border: 2px solid #fff;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
}
#hdc-fab .hdc-badge.show { display: flex; }

/* ── Fenêtre ── */
#hdc-window {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 370px;
  max-height: 560px;
  background: var(--hdc-bg);
  border: 1px solid rgba(200,155,60,.25);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 72px rgba(0,0,0,.6);
  z-index: 999998;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(.96);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
#hdc-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ── Header ── */
#hdc-header {
  background: linear-gradient(135deg, var(--hdc-blue), #1a2744);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(200,155,60,.2);
  flex-shrink: 0;
}
#hdc-header .hdc-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(200,155,60,.15);
  border: 1.5px solid rgba(200,155,60,.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
#hdc-header .hdc-info h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--hdc-gold);
  font-family: Georgia, serif;
}
#hdc-header .hdc-info span {
  font-size: 11px;
  color: rgba(255,255,255,.45);
  display: flex;
  align-items: center;
  gap: 5px;
}
.hdc-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #48bb78;
  animation: hdc-blink 1.8s infinite;
}
@keyframes hdc-blink { 0%,100%{opacity:1} 50%{opacity:.3} }

/* Sélecteur langue + close */
#hdc-lang {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 11px;
  cursor: pointer;
  margin-left: auto;
}
#hdc-lang option { color: #333; background: #fff; }
#hdc-close {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 7px;
  width: 28px; height: 28px;
  cursor: pointer;
  color: rgba(255,255,255,.5);
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-left: 8px;
  flex-shrink: 0;
}
#hdc-close:hover { background: rgba(255,255,255,.16); color: #fff; }

/* ── Messages ── */
#hdc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
#hdc-messages::-webkit-scrollbar { width: 4px; }
#hdc-messages::-webkit-scrollbar-thumb { background: rgba(200,155,60,.2); border-radius: 2px; }

.hdc-msg-wrap { display: flex; gap: 7px; align-items: flex-end; }
.hdc-msg-wrap.user { flex-direction: row-reverse; }
.hdc-msg-av {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--hdc-blue), #1a3a7a);
  border: 1px solid rgba(200,155,60,.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0;
}
.hdc-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  font-family: 'DM Sans', sans-serif;
  animation: hdcIn .2s ease;
}
@keyframes hdcIn { from{opacity:0;transform:translateY(4px)} to{opacity:1;transform:translateY(0)} }
.hdc-bubble.bot {
  background: #1c2c44;
  color: rgba(255,255,255,.88);
  border: 1px solid rgba(200,155,60,.1);
  border-bottom-left-radius: 4px;
}
.hdc-bubble.user {
  background: linear-gradient(135deg, var(--hdc-blue), #1a4a9e);
  color: #fff;
  font-weight: 500;
  border-bottom-right-radius: 4px;
}

/* ── Résultats listings ── */
.hdc-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.hdc-result-card {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(200,155,60,.2);
  border-left: 3px solid var(--hdc-gold);
  border-radius: 8px;
  padding: 8px 10px;
  text-decoration: none;
  display: block;
  transition: background .15s;
}
.hdc-result-card:hover { background: rgba(200,155,60,.08); }
.hdc-result-card .hdc-rc-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--hdc-gold);
  margin-bottom: 3px;
}
.hdc-result-card .hdc-rc-meta {
  font-size: 11px;
  color: rgba(255,255,255,.5);
}

/* ── Typing ── */
.hdc-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 10px 14px;
  background: #1c2c44;
  border: 1px solid rgba(200,155,60,.1);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}
.hdc-typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(200,155,60,.5);
  animation: hdcBounce 1.2s infinite;
}
.hdc-typing span:nth-child(2) { animation-delay: .2s; }
.hdc-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes hdcBounce { 0%,80%,100%{transform:translateY(0);opacity:.5} 40%{transform:translateY(-6px);opacity:1} }

/* ── Suggestions ── */
#hdc-suggestions {
  padding: 0 14px 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  flex-shrink: 0;
}
.hdc-sug {
  background: rgba(200,155,60,.08);
  border: 1px solid rgba(200,155,60,.25);
  color: var(--hdc-gold);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 11.5px;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.hdc-sug:hover { background: rgba(200,155,60,.18); }

/* ── Input ── */
#hdc-footer {
  padding: 10px 14px 14px;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
}
#hdc-input {
  flex: 1;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  padding: 9px 13px;
  color: #fff;
  font-size: 13px;
  resize: none;
  outline: none;
  max-height: 80px;
  line-height: 1.4;
  transition: border-color .15s;
  font-family: inherit;
}
#hdc-input:focus { border-color: rgba(200,155,60,.5); }
#hdc-send {
  width: 38px; height: 38px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--hdc-gold), #d4b05a);
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all .15s;
}
#hdc-send:hover:not(:disabled) { transform: scale(1.06); filter: brightness(1.1); }
#hdc-send:disabled { opacity: .4; cursor: not-allowed; }
#hdc-send svg { width: 16px; height: 16px; fill: var(--hdc-blue); }

/* ── Footer branding ── */
#hdc-powered {
  text-align: center;
  font-size: 10px;
  color: rgba(255,255,255,.2);
  padding-bottom: 5px;
  flex-shrink: 0;
}

/* ── Mobile ── */
@media (max-width: 420px) {
  #hdc-window { width: calc(100vw - 16px); right: 8px; bottom: 90px; max-height: 70vh; }
  #hdc-fab    { bottom: 20px; right: 14px; }
}
