/* ===== BOT WIDGET v2 ===== */

@font-face {
  font-family: 'Zen Dots Local';
  src: url('../Fonts/ZenDots-Regular.woff2') format('woff2');
  font-display: swap;
}

#bot-bubble {
  font-family: 'Zen Dots Local', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
}

#bot-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--bot-color, #1a1a2e);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 9999;
  transition: transform 0.15s;
  font-size: 22px;
  border: none;
  outline: none;
}
#bot-bubble:hover { transform: scale(1.08); }

#bot-window {
  position: fixed;
  bottom: 88px;
  right: 24px;
  width: 360px;
  height: 550px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9998;
  font-family: system-ui, -apple-system, sans-serif;
  transition: opacity 0.2s, transform 0.2s;
  transform-origin: bottom right;
}
#bot-window.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95);
}

#bot-header {
  background: var(--bot-color, #1a1a2e);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.bot-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.bot-name    { font-size: 14px; font-weight: 600; }
.bot-tagline { font-size: 11px; opacity: 0.7; }
.bot-close {
  margin-left: auto; background: none; border: none;
  color: #fff; font-size: 20px; cursor: pointer;
  opacity: 0.7; line-height: 1; padding: 0;
}
.bot-close:hover { opacity: 1; }

#bot-messages {
  flex: 1; overflow-y: auto;
  padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
  scrollbar-width: thin;
}

.bot-msg {
  max-width: 82%; padding: 9px 13px;
  border-radius: 14px; font-size: 13px;
  line-height: 1.5; word-break: break-word; white-space: pre-wrap;
}
.bot-msg.from-bot  { background: #f1f1f1; color: #1a1a1a; align-self: flex-start; border-bottom-left-radius: 4px; }
.bot-msg.from-user { background: var(--bot-color, #1a1a2e); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }

.bot-btns { display: flex; flex-direction: column; gap: 6px; align-self: flex-start; max-width: 90%; }
.bot-btn {
  background: #fff; border: 1px solid #ddd;
  border-radius: 20px; padding: 7px 14px;
  font-size: 12.5px; cursor: pointer; color: #1a1a1a;
  text-align: left; transition: background 0.15s, border-color 0.15s;
  font-family: inherit;
}
.bot-btn:hover { background: #f5f5f5; border-color: var(--bot-color, #1a1a2e); }

.bot-link-btn {
  display: inline-block; margin-top: 4px;
  background: var(--bot-color, #1a1a2e); color: #fff;
  border-radius: 8px; padding: 7px 14px;
  font-size: 12.5px; text-decoration: none; font-family: inherit;
}

/* Formulaire contact */
.bot-form {
  display: flex; flex-direction: column; gap: 8px;
  align-self: stretch; padding: 4px 0;
}
.bot-field {
  width: 100%; box-sizing: border-box;
  padding: 8px 10px; border: 1px solid #ddd;
  border-radius: 8px; font-size: 13px;
  font-family: inherit; background: #f9f9f9;
  outline: none; resize: none;
}
.bot-field:focus { border-color: var(--bot-color, #1a1a2e); background: #fff; }
.bot-submit {
  background: var(--bot-color, #1a1a2e); color: #fff;
  border: none; border-radius: 8px;
  padding: 9px 16px; font-size: 13px;
  cursor: pointer; font-family: inherit;
  transition: opacity 0.15s;
}
.bot-submit:hover   { opacity: 0.85; }
.bot-submit:disabled { opacity: 0.5; cursor: default; }
.bot-cancel {
  background: none; border: none;
  color: #999; font-size: 12px;
  cursor: pointer; font-family: inherit;
  padding: 2px 0; text-align: left;
}
.bot-cancel:hover { color: #555; }
.bot-form-feedback  { font-size: 12px; min-height: 16px; }
.bot-form-feedback.error { color: #c0392b; }

#bot-input-area {
  padding: 10px 12px; border-top: 1px solid #eee;
  display: flex; gap: 8px; flex-shrink: 0;
}
#bot-input {
  flex: 1; padding: 8px 12px;
  border: 1px solid #ddd; border-radius: 20px;
  font-size: 13px; outline: none;
  font-family: inherit; background: #f9f9f9;
}
#bot-input:focus { border-color: var(--bot-color, #1a1a2e); background: #fff; }
#bot-send {
  background: var(--bot-color, #1a1a2e); color: #fff;
  border: none; border-radius: 50%;
  width: 34px; height: 34px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
#bot-send:hover { opacity: 0.85; }

/* Nudge */
#bot-nudge {
  position: fixed;
  bottom: 40px;
  right: 90px;
  background: #fff;
  color: #1a1a1a;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 9997;
  white-space: nowrap;
  animation: nudge-in 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
#bot-nudge-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  color: #999;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}
#bot-nudge-close:hover { color: #333; }
#bot-nudge::after {
  content: '';
  position: absolute;
  right: -6px;
  bottom: 10px;
  width: 0; height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 6px solid #fff;
}
@keyframes nudge-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 400px) {
  #bot-window { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; }
  #bot-bubble { bottom: 16px; right: 16px; }
}
