/* ═══════════════════════════════════════════════════════════
   L'AVENTURE CONTINUE — Widget Chatbot IA
   ═══════════════════════════════════════════════════════════ */

/* ── Bouton flottant ──────────────────────────────────── */
.ai-fab {
  position: fixed;
  bottom: 5.5rem; /* au-dessus du sticky CTA */
  right: 1.5rem;
  z-index: 700;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #C9A84C, #8B6914);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 20px rgba(201,168,76,0.45);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.25s;
  animation: fabPulse 3s ease-in-out infinite 2s;
}
.ai-fab:hover {
  transform: scale(1.12);
  box-shadow: 0 6px 28px rgba(201,168,76,0.6);
}
.ai-fab.open { animation: none; transform: rotate(45deg) scale(1.05); }
@keyframes fabPulse {
  0%,100% { box-shadow: 0 4px 20px rgba(201,168,76,0.45); }
  50%      { box-shadow: 0 4px 30px rgba(201,168,76,0.75); }
}

/* Bulle "Un conseil ?" */
.ai-fab-hint {
  position: fixed;
  bottom: 7rem; right: 4.8rem;
  background: rgba(13,12,10,0.96);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 12px 12px 2px 12px;
  padding: 0.5rem 0.9rem;
  font-size: 0.75rem; color: #e8e0ce;
  white-space: nowrap;
  z-index: 699;
  opacity: 0; transform: translateX(8px);
  transition: all 0.3s ease;
  pointer-events: none;
}
.ai-fab-hint.visible { opacity: 1; transform: translateX(0); }
.ai-fab.open ~ .ai-fab-hint { opacity: 0; }

/* ── Panneau chat ─────────────────────────────────────── */
.ai-panel {
  position: fixed;
  bottom: 5.5rem; right: 1.5rem;
  width: 360px; max-height: 520px;
  background: rgba(13,12,10,0.98);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 20px;
  display: flex; flex-direction: column;
  z-index: 699;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
  transform: scale(0.85) translateY(20px);
  transform-origin: bottom right;
  opacity: 0; pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  overflow: hidden;
}
.ai-panel.open {
  transform: scale(1) translateY(0);
  opacity: 1; pointer-events: all;
}

/* Header */
.ai-panel-header {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.ai-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #C9A84C, #8B6914);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.ai-panel-title { font-weight: 700; font-size: 0.88rem; color: #e8e0ce; }
.ai-panel-sub   { font-size: 0.65rem; color: #C9A84C; font-weight: 500; }
.ai-status-dot  {
  width: 8px; height: 8px; border-radius: 50%;
  background: #4ade80; margin-left: auto;
  box-shadow: 0 0 6px rgba(74,222,128,0.6);
  animation: blink 2s ease-in-out infinite;
}
@keyframes blink { 0%,100% { opacity:1; } 50% { opacity:0.4; } }
.ai-close-btn {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.4); font-size: 1rem;
  padding: 0.2rem; transition: color 0.2s;
}
.ai-close-btn:hover { color: rgba(255,255,255,0.9); }

/* Messages */
.ai-messages {
  flex: 1; overflow-y: auto; padding: 1rem;
  display: flex; flex-direction: column; gap: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(201,168,76,0.2) transparent;
}
.ai-msg {
  max-width: 82%; display: flex; flex-direction: column; gap: 0.25rem;
  animation: msgIn 0.25s ease-out;
}
@keyframes msgIn {
  from { opacity:0; transform: translateY(6px); }
  to   { opacity:1; transform: translateY(0); }
}
.ai-msg.bot  { align-self: flex-start; }
.ai-msg.user { align-self: flex-end; }
.ai-bubble {
  padding: 0.7rem 0.95rem;
  border-radius: 14px;
  font-size: 0.83rem; line-height: 1.6;
}
.ai-msg.bot .ai-bubble {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.08);
  color: #ddd5c5;
  border-radius: 4px 14px 14px 14px;
}
.ai-msg.user .ai-bubble {
  background: linear-gradient(135deg, rgba(201,168,76,0.2), rgba(201,168,76,0.1));
  border: 1px solid rgba(201,168,76,0.25);
  color: #e8e0ce;
  border-radius: 14px 14px 4px 14px;
}

/* Typing indicator */
.ai-typing { display: flex; gap: 4px; padding: 0.7rem 0.95rem; }
.ai-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(201,168,76,0.6);
  animation: typingBounce 1.2s ease-in-out infinite;
}
.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%,80%,100% { transform: translateY(0); }
  40%         { transform: translateY(-6px); }
}

/* Suggestions rapides */
.ai-quick {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  padding: 0 1rem 0.75rem; flex-shrink: 0;
}
.ai-quick-btn {
  padding: 0.3rem 0.7rem;
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 20px; cursor: pointer;
  font-size: 0.7rem; color: #C9A84C; font-weight: 500;
  transition: all 0.2s; white-space: nowrap;
}
.ai-quick-btn:hover {
  background: rgba(201,168,76,0.16);
  border-color: rgba(201,168,76,0.4);
}

/* Input */
.ai-input-row {
  display: flex; gap: 0.5rem; padding: 0.75rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.ai-input {
  flex: 1; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; padding: 0.6rem 0.85rem;
  color: #e8e0ce; font-size: 0.83rem; outline: none;
  resize: none; font-family: inherit;
  transition: border-color 0.2s;
  max-height: 80px;
}
.ai-input:focus { border-color: rgba(201,168,76,0.4); }
.ai-send {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #C9A84C, #8B6914);
  border: none; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; align-self: flex-end;
  transition: opacity 0.2s, transform 0.2s;
}
.ai-send:hover { opacity: 0.85; transform: scale(1.05); }
.ai-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ── Mobile ───────────────────────────────────────────── */
@media (max-width: 480px) {
  .ai-panel {
    width: calc(100vw - 2rem);
    right: 1rem; left: 1rem;
    bottom: 4.5rem;
    max-height: 65vh;
  }
  .ai-fab { bottom: 1rem; }
  .ai-fab-hint { bottom: 4.5rem; right: 4.5rem; }
}
