/* ====================================================
   AQUAWAY AI CONCIERGE — Premium Chat UI
   ==================================================== */

/* ---- Launcher Button ---- */
#ai-concierge-launcher {
  position: fixed;
  bottom: 2.15rem;
  left: 2.15rem;
  z-index: 9998;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #D4AF37, #FFD700);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(212,175,55,0.5), 0 0 40px rgba(212,175,55,0.15);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  animation: pulse-ai 3s infinite;
}

#ai-concierge-launcher:hover {
  transform: scale(1.12);
  box-shadow: 0 8px 30px rgba(212,175,55,0.7), 0 0 60px rgba(212,175,55,0.25);
}

#ai-concierge-launcher svg {
  width: 28px;
  height: 28px;
  fill: #0a0a0a;
}

[dir="rtl"] #ai-concierge-launcher {
  left: auto;
  right: 2.15rem;
}

@keyframes pulse-ai {
  0%, 100% { box-shadow: 0 4px 20px rgba(212,175,55,0.5); }
  50% { box-shadow: 0 4px 40px rgba(212,175,55,0.8), 0 0 0 12px rgba(212,175,55,0.1); }
}

/* ---- Chat Window ---- */
#ai-chat-window {
  position: fixed;
  bottom: 9rem;
  left: 2rem;
  z-index: 9999;
  width: 380px;
  max-height: 540px;
  background: rgba(12, 12, 12, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(212,175,55,0.3);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7), 0 0 30px rgba(212,175,55,0.15);
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

[dir="rtl"] #ai-chat-window {
  left: auto;
  right: 2rem;
}

/* ---- Header ---- */
.ai-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(212,175,55,0.12), rgba(212,175,55,0.04));
  border-bottom: 1px solid rgba(212,175,55,0.2);
  flex-shrink: 0;
}

.ai-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.ai-header-info h4 {
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  color: #D4AF37;
  margin: 0;
  line-height: 1.2;
}

.ai-name {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  color: #D4AF37; /* Gold */
  font-weight: 800; /* Bold */
  display: block;
  line-height: 1.2;
}

.ai-status {
  font-size: 0.72rem;
  color: #25D366; /* Green */
  display: block;
  margin-top: 2px;
  font-weight: 400;
}

/* ---- Messages Area ---- */
.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 300px;
  scrollbar-width: thin;
  scrollbar-color: rgba(212,175,55,0.3) transparent;
}

.ai-messages::-webkit-scrollbar { width: 4px; }
.ai-messages::-webkit-scrollbar-thumb { background: rgba(212,175,55,0.3); border-radius: 2px; }

.message {
  padding: 0.85rem 1rem;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.6;
  animation: fadeInUp 0.3s ease;
  max-width: 88%;
  word-wrap: break-word;
}

.msg-ai {
  background: rgba(212,175,55,0.08);
  border: 1px solid rgba(212,175,55,0.15);
  color: #E8E8E8;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.msg-user {
  background: linear-gradient(135deg, #D4AF37, #a07c20);
  color: #0a0a0a;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}

/* ---- Typing Indicator ---- */
.ai-typing {
  padding: 0.6rem 1rem;
}

.typing-dots {
  display: inline-flex;
  gap: 3px;
}

.typing-dots span {
  font-size: 1.5rem;
  line-height: 1;
  color: #D4AF37;
  animation: dotBounce 1.4s infinite;
}

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

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

/* ---- Booking Button inside chat ---- */
.message .btn-gold {
  display: block !important;
  text-align: center !important;
  background: linear-gradient(135deg, #a07c20, #D4AF37, #FFD700) !important;
  color: #0a0a0a !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  padding: 12px 20px !important;
  text-decoration: none !important;
  margin-top: 10px !important;
  transition: all 0.3s ease !important;
  font-size: 0.85rem !important;
}

.message .btn-gold:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 20px rgba(212,175,55,0.5) !important;
}

/* ---- Quick Suggestion Chips ---- */
.ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 1rem 0.75rem;
  flex-shrink: 0;
}

.suggestion-chip {
  padding: 0.4rem 0.85rem;
  background: rgba(212,175,55,0.1);
  border: 1px solid rgba(212,175,55,0.25);
  border-radius: 50px;
  color: #D4AF37;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.suggestion-chip:hover {
  background: #D4AF37;
  color: #0a0a0a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212,175,55,0.3);
}

/* ---- Input Area ---- */
.ai-input-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(212,175,55,0.15);
  background: rgba(20, 20, 20, 0.5);
  flex-shrink: 0;
}

.ai-input-area input {
  flex: 1;
  background: rgba(30, 30, 30, 0.8);
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: 50px;
  padding: 0.6rem 1rem;
  color: #E8E8E8;
  font-size: 0.85rem;
  outline: none;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
}

.ai-input-area input:focus {
  border-color: #D4AF37;
  box-shadow: 0 0 0 2px rgba(212,175,55,0.15);
}

.ai-input-area input::placeholder {
  color: #888;
}

.ai-mic-btn,
.ai-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.ai-mic-btn {
  background: rgba(212,175,55,0.15);
  border: 1px solid rgba(212,175,55,0.3);
}

.ai-mic-btn:hover {
  background: rgba(212,175,55,0.3);
}

.ai-mic-btn.listening {
  background: #D4AF37;
  animation: pulse-mic 1s infinite;
}

.ai-mic-btn.listening svg { fill: #0a0a0a; }

@keyframes pulse-mic {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212,175,55,0.5); }
  50% { box-shadow: 0 0 0 8px rgba(212,175,55,0); }
}

.ai-send-btn {
  background: linear-gradient(135deg, #D4AF37, #FFD700);
}

.ai-send-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(212,175,55,0.4);
}

.ai-send-btn svg { fill: #0a0a0a; }

/* ---- Proactive Tooltip ---- */
.ai-proactive-tooltip {
  position: fixed;
  bottom: 10rem;
  left: 5rem;
  z-index: 9998;
  background: rgba(12, 12, 12, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid #D4AF37;
  border-radius: 16px;
  padding: 0.85rem 1.25rem;
  color: #E8E8E8;
  font-size: 0.88rem;
  max-width: 260px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 20px rgba(212,175,55,0.15);
  transform: translateY(10px);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.ai-proactive-tooltip.show {
  transform: translateY(0);
  opacity: 1;
}

[dir="rtl"] .ai-proactive-tooltip {
  left: auto;
  right: 5rem;
}

/* ---- Mobile Responsive ---- */
@media (max-width: 480px) {
  #ai-chat-window {
    left: 0.5rem;
    right: 0.5rem;
    bottom: 5rem;
    width: auto;
    max-height: 70vh;
  }

  #ai-concierge-launcher {
    bottom: 5rem;
    left: 1rem;
    width: 48px;
    height: 48px;
  }

  .ai-proactive-tooltip {
    left: 1rem;
    right: 1rem;
    bottom: 9rem;
    max-width: none;
  }
}

/* ---- Animations ---- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- TTS Button States ---- */
#ai-tts-toggle.active {
  opacity: 1 !important;
  color: #D4AF37 !important;
  text-shadow: 0 0 10px rgba(212,175,55,0.5);
}

/* ---- Listening Overlay ---- */
.ai-listening-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  border-radius: 20px;
}

.ai-listening-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.listening-waves {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 60px;
}

.wave {
  width: 4px;
  height: 20px;
  background: #D4AF37;
  border-radius: 2px;
  animation: wave-anim 1s ease-in-out infinite;
}

.wave:nth-child(2) { animation-delay: 0.1s; }
.wave:nth-child(3) { animation-delay: 0.2s; }
.wave:nth-child(4) { animation-delay: 0.3s; }
.wave:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave-anim {
  0%, 100% { height: 10px; opacity: 0.3; }
  50% { height: 50px; opacity: 1; }
}

.listening-text {
  color: #D4AF37;
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: 1rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  animation: pulse-text 1.5s infinite;
}

@keyframes pulse-text {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
