/* Chatbot IKO — iko3d.fr (thème sombre / or) */
.iko-chat {
  --iko-primary: #d4af37;
  --iko-primary-dark: #b8962e;
  --iko-on-primary: #111111;
  --iko-dark: #0b0b10;
  --iko-bg: #15151c;
  --iko-soft: #101016;
  --iko-bubble: #1f1f28;
  --iko-border: rgba(212, 175, 55, 0.25);
  --iko-text: #ececf1;
  --iko-muted: #8e8e9c;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9000;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.45;
  color: var(--iko-text);
}

/* Bouton flottant */
.iko-chat__btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border: none;
  border-radius: 999px;
  background: var(--iko-primary);
  color: var(--iko-on-primary);
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(212, 175, 55, 0.35);
  transition: transform 0.15s, background 0.15s;
}
.iko-chat__btn:hover { background: var(--iko-primary-dark); transform: translateY(-2px); }
.iko-chat--open .iko-chat__btn { display: none; }

/* Fenêtre */
.iko-chat__panel {
  display: none;
  flex-direction: column;
  width: 370px;
  height: 560px;
  max-height: calc(100vh - 40px);
  background: var(--iko-bg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
  border: 1px solid var(--iko-border);
}
.iko-chat--open .iko-chat__panel { display: flex; }

.iko-chat__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--iko-dark);
  color: var(--iko-text);
  border-bottom: 1px solid var(--iko-border);
}
.iko-chat__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--iko-primary);
  color: var(--iko-on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.iko-chat__titles { flex: 1; min-width: 0; }
.iko-chat__title { font-weight: 700; font-size: 15px; }
.iko-chat__subtitle { font-size: 12px; opacity: 0.7; }
.iko-chat__close {
  background: none;
  border: none;
  color: var(--iko-text);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
  padding: 0 4px;
}
.iko-chat__close:hover { opacity: 1; }

/* Messages */
.iko-chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--iko-soft);
}
.iko-chat__msg {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 14px;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.iko-chat__msg--assistant {
  align-self: flex-start;
  background: var(--iko-bubble);
  border: 1px solid var(--iko-border);
  border-bottom-left-radius: 4px;
}
.iko-chat__msg--user {
  align-self: flex-end;
  background: var(--iko-primary);
  color: var(--iko-on-primary);
  border-bottom-right-radius: 4px;
  white-space: pre-wrap;
}
.iko-chat__msg a { color: var(--iko-primary); text-decoration: underline; }

/* Indicateur de saisie */
.iko-chat__typing { display: flex; gap: 4px; padding: 13px 14px; }
.iko-chat__typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--iko-muted);
  animation: iko-blink 1.2s infinite ease-in-out;
}
.iko-chat__typing span:nth-child(2) { animation-delay: 0.2s; }
.iko-chat__typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes iko-blink {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

/* Suggestions */
.iko-chat__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px 0;
  background: var(--iko-soft);
}
.iko-chat__chip {
  border: 1px solid var(--iko-primary);
  background: transparent;
  color: var(--iko-primary);
  border-radius: 999px;
  padding: 6px 11px;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.iko-chat__chip:hover { background: var(--iko-primary); color: var(--iko-on-primary); }

/* Saisie */
.iko-chat__form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--iko-border);
  background: var(--iko-bg);
}
.iko-chat__input {
  flex: 1;
  resize: none;
  border: 1px solid var(--iko-border);
  border-radius: 10px;
  padding: 9px 11px;
  font: inherit;
  font-size: 14px;
  max-height: 110px;
  outline: none;
  background: var(--iko-soft);
  color: var(--iko-text);
}
.iko-chat__input:focus { border-color: var(--iko-primary); }
.iko-chat__send {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: var(--iko-primary);
  color: var(--iko-on-primary);
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}
.iko-chat__send:disabled { opacity: 0.5; cursor: default; }

.iko-chat__disclaimer {
  padding: 6px 12px 9px;
  font-size: 11px;
  color: var(--iko-muted);
  text-align: center;
  background: var(--iko-bg);
}

/* Mobile : plein écran */
@media (max-width: 520px) {
  .iko-chat { right: 14px; bottom: 14px; }
  .iko-chat__btn-label { display: none; }
  .iko-chat__btn { padding: 14px; font-size: 20px; }
  .iko-chat--open { top: 0; left: 0; right: 0; bottom: 0; }
  .iko-chat__panel { width: 100%; height: 100%; max-height: none; border-radius: 0; border: none; }
  .iko-chat__input { font-size: 16px; } /* évite le zoom auto sur iOS */
}
