/* ============================================
   TCHÈPE PRESTIGE — chatbot.css
   Assistant virtuel tchepePrestige 24/24
   ============================================ */

/* --- Bouton flottant --- */
.chatbot-toggle {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9998;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #C8A84E;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(200,168,78,0.45);
  transition: transform 0.2s, box-shadow 0.2s;
}
.chatbot-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(200,168,78,0.6);
}
.chatbot-toggle svg {
  width: 28px;
  height: 28px;
  fill: #0A0A0A;
  transition: opacity 0.2s;
}
.chatbot-toggle .icon-close { display: none; }
.chatbot-toggle.open .icon-open  { display: none; }
.chatbot-toggle.open .icon-close { display: block; }

/* Badge notification */
.chatbot-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: #e63946;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* --- Fenêtre chatbot --- */
.chatbot-window {
  position: fixed;
  bottom: 96px;
  left: 24px;
  z-index: 9999;
  width: 340px;
  max-width: calc(100vw - 48px);
  background: #111111;
  border: 1px solid rgba(200,168,78,0.3);
  border-radius: 16px;
  box-shadow: 0 16px 60px rgba(0,0,0,0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.85) translateY(20px);
  transform-origin: bottom left;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), opacity 0.2s;
  max-height: 70vh;
}
.chatbot-window.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: all;
}

/* Header */
.chatbot-header {
  background: #0A0A0A;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(200,168,78,0.2);
  flex-shrink: 0;
}
.chatbot-avatar {
  width: 38px;
  height: 38px;
  background: #C8A84E;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.chatbot-header-info {
  flex: 1;
}
.chatbot-header-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 14px;
  font-weight: 600;
  color: #C8A84E;
  line-height: 1.2;
}
.chatbot-header-status {
  font-size: 11px;
  color: #6dbb6d;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.chatbot-header-status::before {
  content: '';
  width: 7px;
  height: 7px;
  background: #6dbb6d;
  border-radius: 50%;
  display: inline-block;
}
.chatbot-header-close {
  background: none;
  border: none;
  color: #777;
  cursor: pointer;
  padding: 4px;
  font-size: 18px;
  line-height: 1;
  transition: color 0.15s;
}
.chatbot-header-close:hover { color: #C8A84E; }

/* Messages */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
  max-height: calc(70vh - 180px);
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}
.chatbot-messages::-webkit-scrollbar { width: 4px; }
.chatbot-messages::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }

/* Bulles */
.chat-msg {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  animation: msgIn 0.2s ease-out;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.chat-msg.bot { flex-direction: row; }
.chat-msg.user { flex-direction: row-reverse; }
.chat-msg-avatar {
  width: 28px;
  height: 28px;
  background: #C8A84E;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.chat-msg-bubble {
  max-width: 78%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  font-family: 'Inter', sans-serif;
}
.chat-msg.bot .chat-msg-bubble {
  background: #1E1E1E;
  color: #E0E0E0;
  border-bottom-left-radius: 4px;
}
.chat-msg.user .chat-msg-bubble {
  background: #C8A84E;
  color: #0A0A0A;
  font-weight: 500;
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
.chat-typing .chat-msg-bubble {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  align-items: center;
}
.chat-typing .dot {
  width: 7px;
  height: 7px;
  background: #C8A84E;
  border-radius: 50%;
  animation: typingDot 1.2s infinite;
}
.chat-typing .dot:nth-child(2) { animation-delay: 0.2s; }
.chat-typing .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
  40%           { transform: scale(1);   opacity: 1; }
}

/* Quick replies */
.chatbot-quick-replies {
  padding: 0 14px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  flex-shrink: 0;
}
.chatbot-quick-replies.hidden { display: none; }
.qr-btn {
  background: transparent;
  border: 1px solid rgba(200,168,78,0.5);
  color: #C8A84E;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  padding: 7px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  line-height: 1.2;
}
.qr-btn:hover {
  background: #C8A84E;
  color: #0A0A0A;
}

/* Input zone */
.chatbot-input-zone {
  border-top: 1px solid rgba(200,168,78,0.15);
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.chatbot-input {
  flex: 1;
  background: #1E1E1E;
  border: 1px solid #333;
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 13px;
  color: #E0E0E0;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.15s;
}
.chatbot-input:focus { border-color: #C8A84E; }
.chatbot-input::placeholder { color: #555; }
.chatbot-send {
  width: 38px;
  height: 38px;
  background: #C8A84E;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.chatbot-send:hover { opacity: 0.85; }
.chatbot-send svg { width: 16px; height: 16px; fill: #0A0A0A; }

/* Lien dans les messages */
.chat-msg-bubble a {
  color: #C8A84E;
  text-decoration: underline;
}
.chat-msg.user .chat-msg-bubble a { color: #0A0A0A; }

/* Mobile */
@media (max-width: 480px) {
  .chatbot-window {
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    bottom: 88px;
  }
  .chatbot-toggle {
    left: 16px;
    bottom: 16px;
  }
}
