/* ==========================================================================
   MOZ ACADEMY — PREMIUM AI CHATBOT SYSTEM (css/chatbot.css)
   Theme: Elite Vanilla & Orange Light Theme (Glassmorphic Pane)
   ========================================================================== */

/* ---- Floating Action Button (FAB) ---- */
.chatbot-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.chatbot-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--text-primary); /* Royal Midnight Blue */
  color: var(--accent-gold); /* Prestige Gold */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  cursor: pointer;
  border: none;
  box-shadow: 0 8px 24px rgba(14, 22, 48, 0.2);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.chatbot-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 30px rgba(14, 22, 48, 0.3);
  color: #ffffff;
}

/* Pulsing Ripple Rings */
.chatbot-btn::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(197, 168, 128, 0.2); /* Gold ripple */
  animation: chatRipple 2s ease-out infinite;
  pointer-events: none;
}

.chatbot-btn.open::before {
  display: none;
}

@keyframes chatRipple {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* Notification Badge Dot */
.chatbot-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 12px;
  height: 12px;
  background-color: var(--accent-gold); /* Gold indicator */
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: var(--shadow-card);
  animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
  0% { transform: scale(0.95); }
  50% { transform: scale(1.15); }
  100% { transform: scale(0.95); }
}

/* ---- Glassmorphic Chat Pane Window ---- */
.chatbot-window {
  position: fixed;
  bottom: 110px;
  right: 28px;
  z-index: 1999;
  width: 380px;
  height: 600px;
  background: rgba(255, 255, 255, 0.88); /* Elite translucent background */
  backdrop-filter: blur(24px) saturate(120%);
  -webkit-backdrop-filter: blur(24px) saturate(120%);
  border-radius: 18px; /* Elegant rounded frame */
  border: 1px solid var(--border-medium);
  border-top: 4px solid var(--accent-gold); /* Prestige gold baseline highlight */
  box-shadow: 0 20px 50px rgba(14, 22, 48, 0.12), 0 0 20px rgba(197, 168, 104, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.92) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: bottom right;
}

.chatbot-window.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* Header */
.chatbot-header {
  background: rgba(197, 168, 104, 0.05); /* Warm gold shimmer tint */
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(197, 168, 104, 0.15);
  flex-shrink: 0;
}

.chatbot-avatar {
  width: 38px;
  height: 38px;
  background: var(--bg-dark);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.chatbot-header-info {
  flex: 1;
  min-width: 0;
}

.chatbot-name {
  font-family: var(--font-heading);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.2;
}

.chatbot-status {
  color: var(--text-secondary);
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}

.chatbot-status-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-green);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px var(--accent-green);
}

.chatbot-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: rgba(26, 25, 22, 0.04);
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all var(--t-fast);
}

.chatbot-close:hover {
  background-color: rgba(26, 25, 22, 0.08);
  color: var(--text-primary);
}

/* Chat Messages Bubble Stream */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

.chatbot-messages::-webkit-scrollbar {
  width: 3px;
}
.chatbot-messages::-webkit-scrollbar-thumb {
  background-color: var(--border-medium);
  border-radius: 4px;
}
.chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

.msg {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  animation: messageSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.msg.bot { flex-direction: row; }
.msg.user { flex-direction: row-reverse; }

@keyframes messageSlide {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg-avatar {
  width: 26px;
  height: 26px;
  background-color: rgba(10, 25, 47, 0.05);
  border: 1px solid var(--border-medium);
  color: var(--accent-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.msg-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px; /* Soft bubble corners */
  font-size: 0.85rem;
  line-height: 1.5;
  font-family: var(--font-heading), system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.msg.bot .msg-bubble {
  background-color: rgba(255, 255, 255, 0.9);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  border-bottom-left-radius: 3px;
}

.msg.user .msg-bubble {
  background: linear-gradient(135deg, var(--text-primary) 0%, #1a2c5a 100%); /* Premium dark navy gradient */
  color: #ffffff;
  font-weight: 500;
  border-bottom-right-radius: 3px;
  box-shadow: 0 4px 12px rgba(14, 22, 48, 0.08);
}

.msg-time {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 4px;
  padding: 0 4px;
}

.msg.user .msg-time {
  text-align: right;
}

/* Quick Replies Accordion Options */
.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.quick-reply-btn {
  padding: 6px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-medium);
  background-color: var(--bg-alt);
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  transition: all var(--t-fast);
}

.quick-reply-btn:hover {
  background-color: var(--bg-deep);
  border-color: var(--accent-gold);
  color: var(--text-primary);
  transform: translateY(-1px);
}

/* Typing Bubble */
.typing-dots {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  background-color: #ffffff;
  border: 1px solid var(--border-medium);
  border-radius: var(--r-sm);
  border-bottom-left-radius: 2px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  background-color: var(--text-muted);
  border-radius: 50%;
  animation: typingBounce 1.4s ease infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* Footer / Input panel */
.chatbot-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-medium);
  background-color: rgba(255, 255, 255, 0.6); /* Translucent input background */
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}

.chatbot-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.chatbot-input {
  flex: 1;
  padding: 10px 18px;
  border: 1px solid var(--border-medium);
  border-radius: 24px; /* Pill input design */
  font-size: 0.85rem;
  outline: none;
  background-color: #ffffff;
  color: var(--text-primary);
  font-family: var(--font-heading), system-ui, sans-serif;
  transition: all var(--t-fast);
}

.chatbot-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 12px rgba(197, 168, 104, 0.15);
}

.chatbot-send {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent-gold) 0%, #bca265 100%); /* Gold gradient button */
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: all var(--t-fast);
  border: none;
  cursor: pointer;
}

.chatbot-send:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 12px rgba(197, 168, 104, 0.25);
}

.chatbot-whatsapp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  background: linear-gradient(135deg, #075e54, #25d366);
  color: white;
  border-radius: 6px;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  transition: all var(--t-fast);
}

.chatbot-whatsapp-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.2);
}

.chatbot-powered {
  text-align: center;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 8px;
  font-weight: 500;
}

/* Floating Action Button (FAB) for WhatsApp */
.whatsapp-floating-btn {
  position: fixed;
  bottom: 28px;
  right: 104px; /* Stacked horizontally left of the chatbot button (64px + 12px + 28px = 104px) */
  z-index: 2000;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #25D366;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.25);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  border: none;
}

.whatsapp-floating-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 30px rgba(37, 211, 102, 0.4);
}

.whatsapp-floating-btn::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(37, 211, 102, 0.3);
  animation: waRipple 2s ease-out infinite;
  pointer-events: none;
}

@keyframes waRipple {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}

@media (max-width: 420px) {
  .chatbot-window {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 90px;
    height: 480px;
  }
  .chatbot-fab { right: 16px; bottom: 20px; }
  .whatsapp-floating-btn {
    right: 88px;
    bottom: 20px;
    width: 56px;
    height: 56px;
  }
}
