/* ==========================================================================
   AI CHATBOT CONCIERGE WIDGET - HUYNH HOANG THINH
   Style: Luxury Modern Dark & Gold with Glassmorphism
   ========================================================================== */

/* Floating Trigger Button */
.ai-chat-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #111111 0%, #1e1e1e 100%);
  border: 1px solid rgba(201, 169, 110, 0.4);
  padding: 8px 18px 8px 10px;
  border-radius: 40px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 16px rgba(201, 169, 110, 0.2);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  user-select: none;
}

.ai-chat-trigger:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45), 0 0 24px rgba(201, 169, 110, 0.35);
  border-color: #c9a96e;
}

.ai-trigger-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c9a96e, #dfc28c);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111;
  font-size: 1.3rem;
  box-shadow: 0 0 10px rgba(201, 169, 110, 0.5);
}

.ai-trigger-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  background: #2ecc71;
  border: 2px solid #111;
  border-radius: 50%;
}

.ai-trigger-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.ai-trigger-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #c9a96e;
  font-weight: 700;
}

.ai-trigger-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #ffffff;
}

/* Chatbot Popup Window */
.ai-chat-window {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 580px;
  max-height: calc(100vh - 120px);
  background: #141414;
  border: 1px solid rgba(201, 169, 110, 0.3);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(201, 169, 110, 0.15);
  display: flex;
  flex-direction: column;
  z-index: 1001;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(12px);
}

.ai-chat-window.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Chat Header */
.ai-chat-header {
  padding: 14px 18px;
  background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.ai-header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c9a96e, #a37c3f);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111;
  font-size: 1.1rem;
}

.ai-header-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-serif, 'Playfair Display', serif);
}

.ai-header-status {
  font-size: 0.75rem;
  color: #2ecc71;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ai-header-status::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #2ecc71;
  border-radius: 50%;
}

.ai-chat-close {
  background: none;
  border: none;
  color: #888;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.ai-chat-close:hover {
  color: #fff;
}

/* Chat Messages Container */
.ai-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #0f0f0f;
  scroll-behavior: smooth;
}

.ai-chat-body::-webkit-scrollbar {
  width: 5px;
}

.ai-chat-body::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 10px;
}

/* Message Bubbles */
.ai-msg {
  display: flex;
  gap: 10px;
  max-width: 88%;
  animation: fadeInMsg 0.25s ease-out;
}

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

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

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

.ai-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #c9a96e;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.ai-msg-content {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.ai-msg.bot .ai-msg-content {
  background: #1e1e1e;
  color: #e5e5e5;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-top-left-radius: 2px;
}

.ai-msg.user .ai-msg-content {
  background: linear-gradient(135deg, #c9a96e, #b88f4b);
  color: #111;
  font-weight: 500;
  border-top-right-radius: 2px;
}

/* Recommendation Item Cards in Chat */
.ai-item-card {
  margin-top: 8px;
  background: #161616;
  border: 1px solid rgba(201, 169, 110, 0.3);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all 0.2s;
}

.ai-item-card:hover {
  border-color: #c9a96e;
  transform: translateY(-2px);
}

.ai-item-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.ai-item-card-body {
  padding: 10px;
}

.ai-item-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.ai-item-card-desc {
  font-size: 0.75rem;
  color: #aaa;
  line-height: 1.4;
}

.ai-item-card-btn {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.72rem;
  color: #c9a96e;
  font-weight: 600;
}

/* Typing Indicator */
.ai-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: #1e1e1e;
  border-radius: 12px;
  width: fit-content;
}

.ai-typing-dot {
  width: 6px;
  height: 6px;
  background: #c9a96e;
  border-radius: 50%;
  animation: typingBounce 1.2s infinite ease-in-out;
}

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

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-5px); opacity: 1; }
}

/* Quick Suggestion Chips */
.ai-quick-chips {
  padding: 8px 14px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
  background: #111;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.ai-quick-chips::-webkit-scrollbar {
  display: none;
}

.ai-chip {
  background: #1a1a1a;
  border: 1px solid rgba(201, 169, 110, 0.25);
  color: #ddd;
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.ai-chip:hover {
  background: #c9a96e;
  color: #111;
  border-color: #c9a96e;
}

/* Chat Input Bar */
.ai-chat-input-wrap {
  padding: 10px 14px;
  background: #141414;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-chat-input {
  flex: 1;
  background: #1e1e1e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 10px 16px;
  color: #fff;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
}

.ai-chat-input:focus {
  border-color: #c9a96e;
}

.ai-chat-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #c9a96e;
  border: none;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-chat-send-btn:hover {
  background: #dfc28c;
  transform: scale(1.05);
}

/* Adjusted Zalo Floating Position to prevent overlap */
.zalo-floating-btn {
  position: fixed;
  bottom: 24px;
  left: 24px; /* Move Zalo to bottom-left so AI is bottom-right */
  right: auto;
  z-index: 999;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .ai-chat-trigger {
    bottom: 16px;
    right: 16px;
    padding: 6px 12px 6px 8px;
  }
  .ai-trigger-avatar {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }
  .ai-trigger-label {
    font-size: 0.65rem;
  }
  .ai-trigger-title {
    font-size: 0.8rem;
  }
  .ai-chat-window {
    bottom: 80px;
    right: 12px;
    width: calc(100vw - 24px);
    height: 70vh;
  }
  .zalo-floating-btn {
    bottom: 16px;
    left: 16px;
    width: 48px;
    height: 48px;
  }
}
