/* =========================================================================
   CHATBOT — Bénin Business (Luxury Premium)
   ========================================================================= */

/* ── Bulle flottante (icône robot) ─────────────────────────────── */
.bb-chat-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9000;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
  border: 2px solid #FFD700;
  box-shadow: 0 8px 32px rgba(255, 215, 0, 0.25), 0 0 60px rgba(255, 215, 0, 0.08);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: bbPulse 3s ease-in-out infinite;
}
.bb-chat-bubble:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 40px rgba(255, 215, 0, 0.35), 0 0 80px rgba(255, 215, 0, 0.12);
}
.bb-chat-bubble:active {
  transform: scale(0.95);
}
.bb-chat-bubble .bb-robot-icon {
  width: 36px;
  height: 36px;
}
.bb-chat-bubble .bb-robot-icon .eye {
  fill: #FFD700;
  transition: fill 0.3s;
}
.bb-chat-bubble:hover .bb-robot-icon .eye {
  fill: #fff;
}

/* Pulse doré */
@keyframes bbPulse {
  0%, 100% { box-shadow: 0 8px 32px rgba(255, 215, 0, 0.25), 0 0 60px rgba(255, 215, 0, 0.08); }
  50% { box-shadow: 0 8px 40px rgba(255, 215, 0, 0.4), 0 0 80px rgba(255, 215, 0, 0.15); }
}

/* Notification badge */
.bb-chat-bubble .bb-chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: #E31837;
  border-radius: 50%;
  border: 2px solid #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  color: #fff;
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s ease;
}
.bb-chat-bubble .bb-chat-badge.show {
  opacity: 1;
  transform: scale(1);
}

/* ── Fenêtre de chat ───────────────────────────────────────────── */
.bb-chat-window {
  position: fixed;
  bottom: 100px;
  right: 24px;
  z-index: 9001;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: calc(100vh - 140px);
  max-height: 560px;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #0a0a0a;
  border: 1px solid rgba(255, 215, 0, 0.2);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 60px rgba(255, 215, 0, 0.06);
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.bb-chat-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* En-tête */
.bb-chat-header {
  background: linear-gradient(135deg, #1a1a1a, #111);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.15);
  flex-shrink: 0;
}
.bb-chat-header-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFD700, #b8960f);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.2);
}
.bb-chat-header-avatar svg { width: 24px; height: 24px; }
.bb-chat-header-info { flex: 1; min-width: 0; }
.bb-chat-header-name {
  font-family: var(--font-display, 'Playfair Display', serif);
  font-weight: 700;
  font-size: 0.95rem;
  color: #FFD700;
  margin: 0;
}
.bb-chat-header-status {
  font-size: 0.72rem;
  color: #00A651;
  margin: 1px 0 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.bb-chat-header-status::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #00A651;
  border-radius: 50%;
  display: inline-block;
}
.bb-chat-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: #999;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.bb-chat-close:hover { background: rgba(227, 24, 55, 0.15); color: #E31837; }
.bb-chat-close svg { width: 16px; height: 16px; }

/* Zone messages */
.bb-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(180deg, #0f0f0f, #0a0a0a);
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}
.bb-chat-messages::-webkit-scrollbar { width: 4px; }
.bb-chat-messages::-webkit-scrollbar-track { background: transparent; }
.bb-chat-messages::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }

/* Bulles de messages */
.bb-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.5;
  word-wrap: break-word;
  animation: bbMsgIn 0.3s ease;
}
@keyframes bbMsgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.bb-msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #FFD700, #c9a800);
  color: #0a0a0a;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}
.bb-msg-bot {
  align-self: flex-start;
  background: #1a1a1a;
  color: #e8e8e8;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(255, 215, 0, 0.08);
}
.bb-msg-bot strong { color: #FFD700; }
.bb-msg-bot a { color: #FFD700; text-decoration: underline; }

/* Indicateur de frappe */
.bb-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 12px 18px;
  background: #1a1a1a;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(255, 215, 0, 0.08);
}
.bb-typing span {
  width: 8px;
  height: 8px;
  background: #FFD700;
  border-radius: 50%;
  animation: bbTyping 1.2s ease-in-out infinite;
}
.bb-typing span:nth-child(2) { animation-delay: 0.2s; }
.bb-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bbTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* Zone de saisie */
.bb-chat-input {
  padding: 12px 16px;
  background: #111;
  border-top: 1px solid rgba(255, 215, 0, 0.1);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.bb-chat-input input {
  flex: 1;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 12px 16px;
  color: #fff;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.bb-chat-input input::placeholder { color: #666; }
.bb-chat-input input:focus { border-color: #FFD700; }
.bb-chat-send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #FFD700, #c9a800);
  color: #0a0a0a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.bb-chat-send:hover { transform: scale(1.08); box-shadow: 0 4px 16px rgba(255, 215, 0, 0.3); }
.bb-chat-send:active { transform: scale(0.95); }
.bb-chat-send svg { width: 20px; height: 20px; }
.bb-chat-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .bb-chat-bubble {
    bottom: 130px;
    right: 16px;
    width: 56px;
    height: 56px;
  }
  .bb-chat-bubble .bb-robot-icon { width: 30px; height: 30px; }
  .bb-chat-window {
    bottom: 190px;
    right: 16px;
    left: 16px;
    width: auto;
    max-width: calc(100vw - 32px);
    height: 420px;
    max-height: calc(100vh - 260px);
    border-radius: 16px;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .bb-chat-bubble {
    bottom: 130px;
  }
  .bb-chat-window {
    right: 12px;
    width: calc(100vw - 24px);
    bottom: 190px;
    height: 500px;
    max-height: calc(100vh - 140px);
  }
}
