/* ================================================================
   STM TRAVEL — AI CONCIERGE STYLES
   Premium chatbot widget with Gold + Dark theme
   ================================================================ */

/* ── Widget Container ── */
#ai-chat-widget {
  position: fixed;
  bottom: 6rem;
  left: 1.5rem;
  z-index: 9999;
  font-family: 'Inter', 'Outfit', sans-serif;
}

/* ── Toggle Button ── */
#ai-chat-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f766e, #0d9488);
  border: 2px solid rgba(212,175,55,0.4);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(13,148,136,0.4), 0 0 0 0 rgba(13,148,136,0.4);
  animation: ai-pulse 3s infinite;
  transition: transform 0.3s ease;
  position: relative;
}
#ai-chat-toggle:hover { transform: scale(1.1); }

@keyframes ai-pulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(13,148,136,0.4), 0 0 0 0 rgba(13,148,136,0.4); }
  50%       { box-shadow: 0 8px 24px rgba(13,148,136,0.4), 0 0 0 12px rgba(13,148,136,0); }
}

.ai-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: #d4af37;
  color: #0a0a0a;
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid #0a0a0a;
}

/* ── Chat Window ── */
.ai-chat-window {
  position: absolute;
  bottom: 70px;
  left: 0;
  width: 340px;
  max-height: 560px;
  background: linear-gradient(160deg, #0f1a14 0%, #0a1410 100%);
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: 1.25rem;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6), 0 0 0 1px rgba(212,175,55,0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.ai-chat-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ── Header ── */
.ai-chat-header {
  background: linear-gradient(135deg, rgba(212,175,55,0.15), rgba(13,148,136,0.15));
  border-bottom: 1px solid rgba(212,175,55,0.15);
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.ai-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #0d9488, #0f766e);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.ai-header-info { flex: 1; }
.ai-name { font-weight: 700; color: #d4af37; font-size: 0.9rem; }
.ai-status { font-size: 0.72rem; color: rgba(255,255,255,0.5); display: flex; align-items: center; gap: 0.4rem; }
.ai-dot { width: 6px; height: 6px; background: #22c55e; border-radius: 50%; animation: blink 1.5s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

.ai-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.2s;
}
.ai-close:hover { color: #d4af37; }

/* ── Quick Prompts ── */
.ai-quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ai-quick-prompts button {
  background: rgba(212,175,55,0.08);
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: 2rem;
  color: rgba(255,255,255,0.8);
  font-size: 0.72rem;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.ai-quick-prompts button:hover {
  background: rgba(212,175,55,0.18);
  border-color: rgba(212,175,55,0.5);
  color: #d4af37;
}

/* ── Messages ── */
.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  scroll-behavior: smooth;
}
.ai-messages::-webkit-scrollbar { width: 4px; }
.ai-messages::-webkit-scrollbar-track { background: transparent; }
.ai-messages::-webkit-scrollbar-thumb { background: rgba(212,175,55,0.2); border-radius: 2px; }

.ai-msg { display: flex; }
.ai-msg-bot { justify-content: flex-start; }
.ai-msg-user { justify-content: flex-end; }

.ai-bubble {
  max-width: 85%;
  padding: 0.6rem 0.9rem;
  border-radius: 1rem;
  font-size: 0.82rem;
  line-height: 1.55;
}
.ai-msg-bot .ai-bubble {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.88);
  border-bottom-left-radius: 0.25rem;
}
.ai-msg-user .ai-bubble {
  background: linear-gradient(135deg, #0d9488, #0f766e);
  color: #fff;
  border-bottom-right-radius: 0.25rem;
}

/* ── WA button inside bubble ── */
.ai-wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.6rem;
  background: #25D366;
  color: #fff;
  padding: 0.4rem 0.9rem;
  border-radius: 2rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}
.ai-wa-btn:hover { background: #128C7E; }

/* ── Typing indicator ── */
.ai-typing-indicator .ai-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.6rem 0.9rem;
}
.ai-typing-indicator .ai-bubble span {
  width: 6px;
  height: 6px;
  background: rgba(255,255,255,0.4);
  border-radius: 50%;
  animation: ai-bounce 1.2s infinite;
}
.ai-typing-indicator .ai-bubble span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing-indicator .ai-bubble span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ai-bounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-6px)} }

/* ── Input row ── */
.ai-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.6rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.ai-input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 2rem;
  color: #fff;
  padding: 0.5rem 1rem;
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.2s;
}
.ai-input:focus { border-color: rgba(212,175,55,0.5); }
.ai-input::placeholder { color: rgba(255,255,255,0.3); }

.ai-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #0d9488;
  border: none;
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.2s;
}
.ai-send:hover { background: #d4af37; transform: scale(1.1); }

/* ── WA Footer CTA ── */
.ai-wa-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem;
  background: linear-gradient(135deg, rgba(37,211,102,0.15), rgba(18,140,126,0.15));
  border-top: 1px solid rgba(37,211,102,0.15);
  color: #25D366;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.2s;
}
.ai-wa-cta:hover { background: rgba(37,211,102,0.2); }

/* ── Mobile adjustments ── */
@media (max-width: 480px) {
  #ai-chat-widget { left: 0.75rem; bottom: 5rem; }
  .ai-chat-window { width: calc(100vw - 1.5rem); left: 0; max-height: 75vh; }
}
