/* ==========================================================================
   theAiNexoBot - Modern AI Chatbot Side Drawer & Floating Action Bar
   Design: Cyber Dark Glassmorphism, Crystal Clear Typography & Neon Accents
   ========================================================================== */

:root {
  --ainexo-bot-primary: #6366f1;
  --ainexo-bot-primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --ainexo-bot-surface: #0f172a;
  --ainexo-bot-surface-light: #1e293b;
  --ainexo-bot-border: rgba(255, 255, 255, 0.15);
  --ainexo-bot-glow: rgba(99, 102, 241, 0.4);
  --ainexo-bot-text: #ffffff;
  --ainexo-bot-text-muted: #cbd5e1;
  --ainexo-bot-accent: #38bdf8;
}

/* Reset inside drawer to avoid global theme overrides */
.ainexo-chat-drawer,
.ainexo-chat-drawer * {
  box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Floating Action Bar: Bot, Phone Call & WhatsApp
   -------------------------------------------------------------------------- */
.floating-contact-buttons {
  position: fixed !important;
  bottom: 26px !important;
  right: 24px !important;
  z-index: 99990 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  align-items: center !important;
}

.btn-floating-action {
  position: relative !important;
  width: 50px !important;
  height: 50px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #ffffff !important;
  text-decoration: none !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  box-shadow: 0 8px 25px -4px rgba(0, 0, 0, 0.45) !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  cursor: pointer !important;
  outline: none !important;
  font-size: 20px !important;
}

.btn-floating-action:hover {
  transform: translateY(-4px) scale(1.08) !important;
  color: #ffffff !important;
}

/* 1. AI Bot Floating Button */
.btn-bot-pulse {
  background: var(--ainexo-bot-primary-gradient) !important;
  box-shadow: 0 10px 25px -3px rgba(99, 102, 241, 0.6), 0 0 15px rgba(168, 85, 247, 0.4) !important;
  animation: bot-float-pulse 3s infinite ease-in-out;
}

.btn-bot-pulse:hover {
  box-shadow: 0 14px 30px -2px rgba(99, 102, 241, 0.8), 0 0 25px rgba(236, 72, 153, 0.5) !important;
}

.btn-bot-pulse i {
  color: #ffffff !important;
  font-size: 21px !important;
}

.bot-status-indicator {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background-color: #22c55e;
  border: 2px solid #0f172a;
  border-radius: 50%;
  box-shadow: 0 0 8px #22c55e;
}

@keyframes bot-float-pulse {
  0%, 100% {
    transform: translateY(0);
    box-shadow: 0 10px 25px -3px rgba(99, 102, 241, 0.6), 0 0 15px rgba(168, 85, 247, 0.4);
  }
  50% {
    transform: translateY(-4px);
    box-shadow: 0 15px 30px -3px rgba(168, 85, 247, 0.7), 0 0 22px rgba(236, 72, 153, 0.6);
  }
}

/* 2. Phone Button */
.btn-phone-pulse {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  box-shadow: 0 8px 20px -3px rgba(2, 132, 199, 0.5) !important;
}

.btn-phone-pulse:hover {
  box-shadow: 0 12px 25px -2px rgba(2, 132, 199, 0.7) !important;
}

/* 3. WhatsApp Button */
.btn-whatsapp-pulse {
  background: linear-gradient(135deg, #25d366, #128c7e) !important;
  box-shadow: 0 8px 20px -3px rgba(37, 211, 102, 0.5) !important;
}

.btn-whatsapp-pulse:hover {
  box-shadow: 0 12px 25px -2px rgba(37, 211, 102, 0.7) !important;
}

/* Floating Tooltips */
.floating-tooltip {
  position: absolute;
  right: 62px;
  top: 50%;
  transform: translateY(-50%) translateX(10px);
  background: rgba(15, 23, 42, 0.95);
  color: #ffffff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 8px;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
}

.btn-floating-action:hover .floating-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* --------------------------------------------------------------------------
   Header Trigger Button
   -------------------------------------------------------------------------- */
.ainexo-header-bot-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(168, 85, 247, 0.3));
  border: 1px solid rgba(168, 85, 247, 0.5);
  color: #ffffff !important;
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
}

.ainexo-header-bot-btn i {
  color: #c084fc !important;
  font-size: 14px;
}

.ainexo-header-bot-btn:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(236, 72, 153, 0.4));
  border-color: #ec4899;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.35);
}

/* --------------------------------------------------------------------------
   Side-Drawer Overlay & Container
   -------------------------------------------------------------------------- */
.ainexo-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 29, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ainexo-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.ainexo-chat-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 440px;
  max-width: 100%;
  background: #0b1329 !important;
  border-left: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: -15px 0 40px rgba(0, 0, 0, 0.8), -2px 0 15px var(--ainexo-bot-glow);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
  font-family: 'Plus Jakarta Sans', 'Outfit', sans-serif !important;
  color: #ffffff !important;
}

.ainexo-chat-drawer.open {
  transform: translateX(0) !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Drawer Header */
.ainexo-drawer-header {
  padding: 16px 20px;
  background: #111c38 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ainexo-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ainexo-header-avatar {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #312e81, #4f46e5) !important;
  border: 1px solid rgba(168, 85, 247, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff !important;
  font-size: 20px;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.ainexo-header-meta h4 {
  margin: 0;
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ainexo-bot-badge {
  font-size: 10px !important;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.35) !important;
  border: 1px solid rgba(99, 102, 241, 0.6) !important;
  color: #e0e7ff !important;
  font-weight: 700 !important;
  text-transform: uppercase;
}

.ainexo-header-status {
  font-size: 12px !important;
  color: #94a3b8 !important;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.ainexo-status-dot {
  width: 7px;
  height: 7px;
  background-color: #22c55e;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px #22c55e;
}

.ainexo-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ainexo-action-btn {
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #cbd5e1 !important;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 15px;
}

.ainexo-action-btn:hover {
  background: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
}

/* --------------------------------------------------------------------------
   Message Stream Container
   -------------------------------------------------------------------------- */
.ainexo-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
  background: #0b1329 !important;
}

.ainexo-chat-body::-webkit-scrollbar {
  width: 5px;
}
.ainexo-chat-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

/* Message Bubbles */
.ainexo-message-row {
  display: flex;
  gap: 10px;
  max-width: 92%;
  animation: ainexo-fadeIn 0.25s ease-out;
}

@keyframes ainexo-fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.ainexo-message-row.user {
  margin-left: auto;
  flex-direction: row-reverse;
}

.ainexo-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #1e293b !important;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8 !important;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 2px;
}

.ainexo-message-row.user .ainexo-msg-avatar {
  background: #4338ca !important;
  color: #ffffff !important;
}

.ainexo-message-content {
  padding: 13px 16px;
  border-radius: 16px;
  font-size: 14px !important;
  line-height: 1.6 !important;
  word-break: break-word;
}

/* Bot Message Bubble: High Contrast Light-on-Dark */
.ainexo-message-row.bot .ainexo-message-content {
  background: #18223d !important;
  border: 1px solid rgba(99, 102, 241, 0.3) !important;
  color: #ffffff !important;
  border-top-left-radius: 4px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35) !important;
}

.ainexo-message-row.bot .ainexo-message-content p,
.ainexo-message-row.bot .ainexo-message-content span,
.ainexo-message-row.bot .ainexo-message-content li,
.ainexo-message-row.bot .ainexo-message-content em,
.ainexo-message-row.bot .ainexo-message-content div {
  color: #f1f5f9 !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
}

.ainexo-message-row.bot .ainexo-message-content strong,
.ainexo-message-row.bot .ainexo-message-content b {
  color: #ffffff !important;
  font-weight: 700 !important;
}

.ainexo-message-row.bot .ainexo-message-content h3,
.ainexo-message-row.bot .ainexo-message-content h4 {
  font-size: 15px !important;
  margin: 6px 0 10px 0 !important;
  color: #38bdf8 !important;
  font-weight: 700 !important;
}

.ainexo-message-row.bot .ainexo-message-content ul,
.ainexo-message-row.bot .ainexo-message-content ol {
  padding-left: 20px !important;
  margin: 8px 0 !important;
  color: #f1f5f9 !important;
}

.ainexo-message-row.bot .ainexo-message-content li {
  margin-bottom: 5px !important;
  color: #f1f5f9 !important;
}

.ainexo-message-row.bot .ainexo-message-content a {
  color: #38bdf8 !important;
  text-decoration: underline !important;
  font-weight: 600 !important;
}

.ainexo-message-row.bot .ainexo-message-content a:hover {
  color: #7dd3fc !important;
}

/* User Message Bubble: Crisp Gradient */
.ainexo-message-row.user .ainexo-message-content {
  background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
  color: #ffffff !important;
  border-top-right-radius: 4px;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.4) !important;
}

.ainexo-message-row.user .ainexo-message-content p,
.ainexo-message-row.user .ainexo-message-content span,
.ainexo-message-row.user .ainexo-message-content strong,
.ainexo-message-row.user .ainexo-message-content * {
  color: #ffffff !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
}

.ainexo-message-content p {
  margin-bottom: 8px !important;
}
.ainexo-message-content p:last-child {
  margin-bottom: 0 !important;
}

/* --------------------------------------------------------------------------
   Course Cards Inside Chat
   -------------------------------------------------------------------------- */
.ainexo-course-cards-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  width: 100%;
}

.ainexo-chat-course-card {
  background: #101a33 !important;
  border: 1px solid rgba(99, 102, 241, 0.4) !important;
  border-radius: 12px;
  padding: 12px 14px;
  transition: all 0.2s ease;
}

.ainexo-chat-course-card:hover {
  border-color: #a855f7 !important;
  transform: translateY(-2px);
  background: #14203f !important;
}

.ainexo-course-card-title {
  font-size: 14.5px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  margin-bottom: 6px !important;
}

.ainexo-course-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.ainexo-badge-price {
  background: rgba(34, 197, 94, 0.2) !important;
  border: 1px solid rgba(34, 197, 94, 0.5) !important;
  color: #4ade80 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  padding: 3px 8px;
  border-radius: 6px;
}

.ainexo-badge-duration {
  background: rgba(56, 189, 248, 0.2) !important;
  border: 1px solid rgba(56, 189, 248, 0.5) !important;
  color: #38bdf8 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 3px 8px;
  border-radius: 6px;
}

.ainexo-course-card-actions {
  display: flex;
  gap: 8px;
}

.ainexo-btn-sm-details {
  flex: 1;
  text-align: center;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
  border-radius: 8px;
  font-size: 12px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  transition: all 0.2s;
}

.ainexo-btn-sm-details:hover {
  background: rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
}

.ainexo-btn-sm-enroll {
  flex: 1;
  text-align: center;
  padding: 7px 10px;
  background: linear-gradient(135deg, #4f46e5, #9333ea) !important;
  color: #ffffff !important;
  border-radius: 8px;
  font-size: 12px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  transition: all 0.2s;
}

.ainexo-btn-sm-enroll:hover {
  background: linear-gradient(135deg, #4338ca, #7e22ce) !important;
  box-shadow: 0 0 12px rgba(147, 51, 234, 0.5) !important;
  color: #ffffff !important;
}

/* --------------------------------------------------------------------------
   Quick Reply Chips
   -------------------------------------------------------------------------- */
.ainexo-quick-replies-area {
  padding: 10px 16px 8px 16px;
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 8px;
  background: #111c38 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.ainexo-quick-replies-area::-webkit-scrollbar {
  height: 4px;
}
.ainexo-quick-replies-area::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

.ainexo-chip-btn {
  background: #1e293b !important;
  border: 1px solid rgba(148, 163, 184, 0.4) !important;
  color: #ffffff !important;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.ainexo-chip-btn:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(168, 85, 247, 0.4)) !important;
  border-color: #a855f7 !important;
  color: #ffffff !important;
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   In-Chat Interactive Lead Capture Card
   -------------------------------------------------------------------------- */
.ainexo-lead-form-card {
  margin-top: 12px;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95)) !important;
  border: 1px solid rgba(99, 102, 241, 0.4) !important;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.45);
}

.ainexo-lead-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.ainexo-lead-card-header i {
  color: #38bdf8;
  font-size: 16px;
}

.ainexo-lead-card-title {
  font-size: 13.5px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
}

.ainexo-lead-field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.ainexo-lead-input {
  width: 100%;
  background: #0f172a !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px !important;
  color: #ffffff !important;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

.ainexo-lead-input:focus {
  border-color: #818cf8 !important;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}

.ainexo-lead-input::placeholder {
  color: #94a3b8 !important;
  font-size: 12px;
}

.ainexo-lead-submit-btn {
  width: 100%;
  background: var(--ainexo-bot-primary-gradient) !important;
  border: none !important;
  color: #ffffff !important;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.ainexo-lead-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.5);
}

.ainexo-lead-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}


/* --------------------------------------------------------------------------
   Typing Indicator
   -------------------------------------------------------------------------- */
.ainexo-typing-bubble {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 14px 18px;
  background: #18223d !important;
  border: 1px solid rgba(99, 102, 241, 0.3) !important;
  border-radius: 16px;
  border-top-left-radius: 4px;
  width: fit-content;
}

.ainexo-typing-dot {
  width: 7px;
  height: 7px;
  background-color: #38bdf8 !important;
  border-radius: 50%;
  animation: ainexo-bounce 1.4s infinite ease-in-out both;
}

.ainexo-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.ainexo-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes ainexo-bounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* --------------------------------------------------------------------------
   Drawer Footer
   -------------------------------------------------------------------------- */
.ainexo-drawer-footer {
  padding: 14px 16px;
  background: #111c38 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.ainexo-input-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1e293b !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 28px;
  padding: 4px 6px 4px 16px;
  transition: border-color 0.2s;
}

.ainexo-input-form:focus-within {
  border-color: #818cf8 !important;
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.4) !important;
}

.ainexo-chat-input {
  flex: 1;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: #ffffff !important;
  font-size: 14px !important;
  font-family: inherit;
  padding: 7px 0;
}

.ainexo-chat-input::placeholder {
  color: #94a3b8 !important;
}

.ainexo-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ainexo-bot-primary-gradient) !important;
  border: none !important;
  color: #ffffff !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  flex-shrink: 0;
}

.ainexo-send-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.6);
}

.ainexo-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.ainexo-footer-branding {
  font-size: 11px !important;
  color: #94a3b8 !important;
  text-align: center;
  margin-top: 6px;
}

/* --------------------------------------------------------------------------
   Mobile Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 576px) {
  .floating-contact-buttons {
    bottom: 18px !important;
    right: 16px !important;
    gap: 10px !important;
  }
  .btn-floating-action {
    width: 44px !important;
    height: 44px !important;
    font-size: 17px !important;
  }
  .ainexo-chat-drawer {
    width: 100%;
    max-width: 100%;
    right: 0;
  }
}

