/* ==============================================================================
   VUI JOURNEYS JSC - 3D SPHERICAL AI GEMINI CHATBOX WIDGET (LEFT SIDE)
   Brand: Deep Teal (#004D53 / #008080) & Warm Gold (#D4AF37)
   Position: Bottom-Left (Bên Trái màn hình)
   Feature: 3D Spherical Globe Logo Button, Multi-Language Support
   Typography: Montserrat across all elements
   ============================================================================== */

/* 1. NÚT NỔI HÌNH CẦU 3D BÊN TRÁI MÀN HÌNH (3D SPHERICAL GLOBE TRIGGER ON LEFT) */
.vui-ai-sphere-trigger {
  position: fixed;
  bottom: 28px;
  left: 24px;
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: none;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  outline: none;
  text-decoration: none;
  user-select: none;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: 0;
  margin: 0;
}

/* Quả cầu 3D bóng bẩy mang logo VUI Journeys */
.vui-ai-sphere-ball {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #FFFFFF 0%, #F0FDFD 30%, #CCECEB 65%, #008080 100%);
  box-shadow:
    0 14px 32px rgba(0, 77, 83, 0.45),
    0 4px 10px rgba(0, 0, 0, 0.15),
    inset -5px -8px 16px rgba(0, 37, 40, 0.6),
    inset 5px 8px 14px rgba(255, 255, 255, 0.95),
    0 0 0 2.5px #D4AF37;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: vuiAiSphereFloat 3.2s infinite ease-in-out;
}

/* Hiệu ứng phản quang thủy tinh 3D (Glass Specular Highlight) */
.vui-ai-sphere-ball::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 12px;
  width: 26px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 80%);
  transform: rotate(-28deg);
  pointer-events: none;
  z-index: 2;
}

/* Hiệu ứng viền phát sáng nhẹ quanh quả cầu */
.vui-ai-sphere-ball::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 10px rgba(212, 175, 55, 0.3);
  pointer-events: none;
}

.vui-ai-sphere-img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0, 40, 45, 0.3));
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1;
}

@keyframes vuiAiSphereFloat {
  0%, 100% {
    transform: translateY(0);
    box-shadow:
      0 14px 32px rgba(0, 77, 83, 0.45),
      0 4px 10px rgba(0, 0, 0, 0.15),
      inset -5px -8px 16px rgba(0, 37, 40, 0.6),
      inset 5px 8px 14px rgba(255, 255, 255, 0.95),
      0 0 0 2.5px #D4AF37;
  }
  50% {
    transform: translateY(-9px);
    box-shadow:
      0 22px 42px rgba(0, 77, 83, 0.55),
      0 0 18px rgba(212, 175, 55, 0.65),
      inset -5px -8px 16px rgba(0, 37, 40, 0.6),
      inset 5px 8px 14px rgba(255, 255, 255, 0.95),
      0 0 0 3px #D4AF37;
  }
}

.vui-ai-sphere-trigger:hover .vui-ai-sphere-ball {
  transform: scale(1.12);
  box-shadow:
    0 20px 48px rgba(0, 128, 128, 0.65),
    0 0 24px rgba(212, 175, 55, 0.85),
    0 0 0 3px #D4AF37;
}

.vui-ai-sphere-trigger:hover .vui-ai-sphere-img {
  transform: scale(1.1) rotate(6deg);
}

/* Nhãn chú thích đi kèm quả cầu 3D (Đã ẩn theo yêu cầu: chỉ giữ quả cầu 3D) */
.vui-ai-sphere-pill {
  display: none !important;
}

/* 2. CỬA SỔ CHATBOX CHÍNH NẰM BÊN TRÁI MÀN HÌNH (LEFT SIDE CHAT WINDOW) */
.vui-ai-chat-modal {
  position: fixed;
  bottom: 104px;
  left: 24px;
  width: 390px;
  max-width: calc(100vw - 36px);
  height: 600px;
  max-height: calc(100vh - 130px);
  background: #FFFFFF;
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0, 37, 40, 0.3), 0 4px 16px rgba(0,0,0,0.1);
  border: 1.5px solid rgba(0, 128, 128, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 99999;
  font-family: 'Montserrat', sans-serif !important;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.vui-ai-chat-modal.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Header Chatbox */
.vui-ai-chat-header {
  background: linear-gradient(135deg, #004D53 0%, #002528 100%);
  padding: 16px 18px;
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-bottom: 2px solid #D4AF37;
  flex-shrink: 0;
}

.vui-ai-header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.vui-ai-avatar-3d {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid #D4AF37;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.vui-ai-avatar-3d img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.vui-ai-title-wrap h4 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.25;
}

.vui-ai-status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: #A7F3D0;
  margin-top: 3px;
  font-weight: 500;
}

.vui-ai-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 6px #10B981;
}

.vui-ai-ctrl-btn {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #FFFFFF;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: background 0.2s;
}

.vui-ai-ctrl-btn:hover {
  background: rgba(212, 175, 55, 0.45);
  color: #FFFFFF;
}

/* Thanh chuyển đổi nhanh ngôn ngữ (Multi-language Selector Bar) */
.vui-ai-lang-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-top: 2px;
}
.vui-ai-lang-bar::-webkit-scrollbar { display: none; }

.vui-ai-lang-pill {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.vui-ai-lang-pill:hover,
.vui-ai-lang-pill.active {
  background: #D4AF37;
  color: #00363B;
  border-color: #D4AF37;
  font-weight: 700;
}

/* Vùng nội dung tin nhắn (Messages Log) */
.vui-ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #F8FAFC;
  scroll-behavior: smooth;
}

.vui-ai-msg {
  display: flex;
  gap: 10px;
  max-width: 86%;
  animation: vuiMsgFade 0.25s ease-out;
}

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

.vui-ai-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.vui-ai-msg.bot {
  align-self: flex-start;
}

.vui-ai-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.55;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  word-break: break-word;
}

.vui-ai-msg.user .vui-ai-bubble {
  background: #004D53;
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
  border: 1px solid #00363B;
}

.vui-ai-msg.bot .vui-ai-bubble {
  background: #FFFFFF;
  color: #1E293B;
  border-bottom-left-radius: 4px;
  border: 1px solid #E2E8F0;
}

.vui-ai-bubble strong {
  color: #004D53;
}
.vui-ai-msg.user .vui-ai-bubble strong {
  color: #D4AF37;
}

.vui-ai-bubble ul {
  margin: 6px 0 6px 18px;
  padding: 0;
}
.vui-ai-bubble li {
  margin-bottom: 4px;
}

/* Thẻ thông báo ghi nhận Lead thành công */
.vui-ai-lead-alert {
  background: #FFF9E6;
  border: 1px solid #D4AF37;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.82rem;
  color: #854D0E;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}

/* Gợi ý FAQ nhanh (Quick Suggestions Bar) */
.vui-ai-suggestions-wrap {
  padding: 8px 14px 4px;
  background: #FFFFFF;
  border-top: 1px solid #EDF2F7;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.vui-ai-suggestions-wrap::-webkit-scrollbar { display: none; }

.vui-ai-pill-btn {
  background: #F0F7F7;
  border: 1px solid #D1E5E7;
  color: #006666;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  font-family: 'Montserrat', sans-serif;
}

.vui-ai-pill-btn:hover {
  background: #006666;
  color: #FFFFFF;
  border-color: #006666;
}

/* Hiệu ứng gõ phím đang chờ (Typing Indicator) */
.vui-ai-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  width: fit-content;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.vui-ai-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #008080;
  animation: vuiTypingBounce 1.4s infinite ease-in-out both;
}

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

@keyframes vuiTypingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Footer & Khung nhập liệu (Input Bar) */
.vui-ai-chat-footer {
  padding: 12px 14px;
  background: #FFFFFF;
  border-top: 1px solid #EDF2F7;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.vui-ai-input {
  flex: 1;
  border: 1.5px solid #CBD5E1;
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-family: 'Montserrat', sans-serif;
  color: #0F172A;
  outline: none;
  transition: border-color 0.2s;
}

.vui-ai-input:focus {
  border-color: #008080;
  box-shadow: 0 0 0 3px rgba(0, 128, 128, 0.12);
}

.vui-ai-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #004D53;
  color: #D4AF37;
  border: 1px solid #D4AF37;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.vui-ai-send-btn:hover {
  background: #006666;
  transform: scale(1.08);
}

.vui-ai-send-btn:disabled {
  background: #94A3B8;
  border-color: #CBD5E1;
  color: #FFFFFF;
  cursor: not-allowed;
  transform: none;
}

/* Tinh chỉnh Responsive cho màn hình di động */
@media (max-width: 640px) {
  .vui-ai-sphere-trigger {
    left: 16px;
    bottom: 24px;
  }
  .vui-ai-sphere-ball {
    width: 56px;
    height: 56px;
  }
  .vui-ai-sphere-img {
    width: 38px;
    height: 38px;
  }
  .vui-ai-sphere-pill {
    display: none; /* Ẩn nhãn chữ trên điện thoại để tiết kiệm diện tích */
  }
  .vui-ai-chat-modal {
    left: 10px;
    bottom: 88px;
    width: calc(100vw - 20px);
    height: calc(100vh - 110px);
    border-radius: 18px;
  }
}

/* ==============================================================================
   CHATBOX RECAPTCHA "I'M NOT A ROBOT" VERIFICATION BAR
   ============================================================================== */
.vui-ai-recaptcha-bar {
  background: #F8FAFC;
  border-top: 1px solid #E2E8F0;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Montserrat', sans-serif !important;
}

.vui-ai-recaptcha-widget {
  width: 100%;
  background: #FFFFFF;
  border: 1px solid #D3D3D3;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  box-sizing: border-box;
  user-select: none;
  transition: all 0.2s ease;
}

.vui-ai-recaptcha-widget.is-invalid {
  border-color: #EF4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25) !important;
  animation: vuiCaptchaShake 0.4s ease-in-out;
}

.vui-ai-recaptcha-left {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.vui-ai-recaptcha-checkbox {
  width: 24px;
  height: 24px;
  border: 2px solid #C1C1C1;
  border-radius: 3px;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.vui-ai-recaptcha-checkbox:hover {
  border-color: #A6A6A6;
}

.vui-ai-recaptcha-checkbox.loading {
  border-color: transparent;
  background: transparent;
}

.vui-ai-recaptcha-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid #CBD5E1;
  border-top-color: #1A73E8;
  border-radius: 50%;
  animation: vuiSpin 0.7s linear infinite;
}

.vui-ai-recaptcha-checkbox.checked {
  background: #FFFFFF;
  border-color: transparent;
}

.vui-ai-recaptcha-checkmark {
  width: 20px;
  height: 20px;
  display: none;
  animation: vuiCheckmarkPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.vui-ai-recaptcha-checkbox.checked .vui-ai-recaptcha-checkmark {
  display: block;
}

.vui-ai-recaptcha-label {
  font-size: 13px;
  font-weight: 500;
  color: #282727;
}

.vui-ai-recaptcha-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-left: 6px;
}

.vui-ai-recaptcha-logo-icon {
  width: 22px;
  height: 22px;
}

.vui-ai-recaptcha-brand {
  font-size: 8px;
  color: #555555;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin-top: 1px;
}

.vui-ai-recaptcha-legal {
  font-size: 7.5px;
  color: #555555;
  text-decoration: none;
  line-height: 1;
}

/* ==============================================================================
   7. INTERACTIVE TOUR RECOMMENDATION CARDS & CONCIERGE ACTIONS
   ============================================================================== */
.vui-ai-tour-cards-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
  width: 100%;
}

.vui-ai-tour-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 37, 40, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.vui-ai-tour-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 77, 83, 0.16);
  border-color: #D4AF37;
}

.vui-ai-tour-thumb-wrap {
  position: relative;
  width: 100%;
  height: 125px;
  background: #0F172A;
  overflow: hidden;
}

.vui-ai-tour-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}

.vui-ai-tour-card:hover .vui-ai-tour-thumb {
  transform: scale(1.05);
}

.vui-ai-tour-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 37, 40, 0.88);
  color: #D4AF37;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.vui-ai-tour-duration-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.85);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  z-index: 2;
  backdrop-filter: blur(4px);
}

.vui-ai-tour-card-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #FFFFFF;
}

.vui-ai-tour-code-tag {
  font-size: 10.5px;
  font-weight: 800;
  color: #B89025;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.vui-ai-tour-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #002528;
  line-height: 1.35;
  margin: 0;
}

.vui-ai-tour-card-desc {
  font-size: 11.5px;
  color: #475569;
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vui-ai-tour-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px dashed #E2E8F0;
  gap: 8px;
}

.vui-ai-tour-price-box {
  display: flex;
  flex-direction: column;
}

.vui-ai-tour-price-label {
  font-size: 9.5px;
  text-transform: uppercase;
  color: #64748B;
  font-weight: 600;
}

.vui-ai-tour-price-amount {
  font-size: 14.5px;
  font-weight: 800;
  color: #006666;
  line-height: 1.1;
}

.vui-ai-tour-card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.vui-ai-btn-view-details {
  background: #F1F5F9;
  color: #004D53;
  border: 1px solid #CBD5E1;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: inherit;
}

.vui-ai-btn-view-details:hover {
  background: #004D53;
  color: #FFFFFF;
  border-color: #004D53;
}

.vui-ai-btn-inquire-now {
  background: linear-gradient(135deg, #D4AF37 0%, #B89025 100%);
  color: #002528;
  border: none;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: inherit;
  box-shadow: 0 2px 6px rgba(212, 175, 55, 0.35);
}

.vui-ai-btn-inquire-now:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(212, 175, 55, 0.5);
  background: linear-gradient(135deg, #E5C158 0%, #C49B2C 100%);
}

.vui-ai-concierge-handover-box {
  margin-top: 10px;
  padding: 10px 12px;
  background: #F0FDFD;
  border: 1px dashed #99D5D3;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vui-ai-handover-text {
  font-size: 11.5px;
  color: #004D53;
  font-weight: 600;
}

.vui-ai-handover-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.vui-ai-handover-whatsapp {
  background: #25D366;
  color: #FFFFFF;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.vui-ai-handover-whatsapp:hover {
  background: #1EBE5D;
}

.vui-ai-handover-email {
  background: #004D53;
  color: #FFFFFF;
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.vui-ai-handover-email:hover {
  background: #002528;
}

