/* ═══════════════════════════════════════
   KUTTRALAM TOURISM — CHATBOT WIDGET STYLES
   ═══════════════════════════════════════ */

/* ── Launcher Button ── */
.chatbot-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--brand-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(204, 0, 0, 0.35);
  cursor: pointer;
  color: var(--white);
  font-size: 1.6rem;
  z-index: 1500;
  transition: transform var(--transition), box-shadow var(--transition);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.chatbot-launcher:hover {
  transform: scale(1.08) rotate(6deg);
  box-shadow: 0 12px 40px rgba(204, 0, 0, 0.5);
}

.chatbot-launcher::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
  animation: launcher-pulse 2.2s infinite;
}

@keyframes launcher-pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  100% { transform: scale(1.25); opacity: 0; }
}

/* ── Chat Window ── */
.chatbot-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 380px;
  height: 520px;
  max-height: calc(100vh - 130px);
  max-width: calc(100vw - 48px);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1500;
  opacity: 0;
  pointer-events: none;
  transform: translateY(24px) scale(0.95);
  transition: opacity 0.32s cubic-bezier(0.4, 0, 0.2, 1), transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-window.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0) scale(1);
}

/* ── Chat Header ── */
.chatbot-header {
  padding: 1.1rem 1.4rem;
  background: var(--brand-dark);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chatbot-header-info h4 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chatbot-header-info p {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 2px 0 0 0;
}

.chatbot-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  cursor: pointer;
}

.chatbot-close:hover {
  background: var(--accent);
}

/* ── Chat Body ── */
.chatbot-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  background: #fdfdfd;
  scroll-behavior: smooth;
}

.chatbot-body::-webkit-scrollbar {
  width: 4px;
}
.chatbot-body::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 2px;
}

/* ── Message Bubbles ── */
.chatbot-msg {
  max-width: 82%;
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  line-height: 1.45;
  word-wrap: break-word;
  animation: msg-in 0.28s ease-out forwards;
}

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

.chatbot-msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: var(--white);
  border-radius: 14px 14px 0 14px;
  box-shadow: 0 4px 12px rgba(204, 0, 0, 0.12);
}

.chatbot-msg.bot {
  align-self: flex-start;
  background: var(--white);
  color: var(--text-dark);
  border-radius: 14px 14px 14px 0;
  border: 1px solid var(--gray-200);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.chatbot-msg p {
  margin: 0;
}
.chatbot-msg p + p {
  margin-top: 0.5rem;
}

.chatbot-msg a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  transition: color var(--transition);
}
.chatbot-msg.user a {
  color: var(--white);
}

/* ── Suggestion Chips ── */
.chatbot-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.chatbot-chip {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  color: var(--gray-700);
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition);
}

.chatbot-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-1px);
}

/* ── Typing Indicator ── */
.chatbot-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.6rem 1rem;
}
.chatbot-typing span {
  width: 6px;
  height: 6px;
  background: var(--gray-500);
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite ease-in-out both;
}
.chatbot-typing span:nth-child(1) { animation-delay: -0.32s; }
.chatbot-typing span:nth-child(2) { animation-delay: -0.16s; }

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

/* ── Chat Footer & Input ── */
.chatbot-footer {
  padding: 0.9rem 1.2rem;
  border-top: 1px solid var(--gray-200);
  background: var(--white);
  display: flex;
  gap: 10px;
  align-items: center;
}

.chatbot-input {
  flex-grow: 1;
  padding: 0.65rem 1.1rem;
  border-radius: 24px;
  border: 1px solid var(--gray-300);
  outline: none;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.chatbot-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.08);
}

.chatbot-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(204, 0, 0, 0.15);
}

.chatbot-send-btn:hover {
  background: var(--accent-hover);
  transform: scale(1.05);
}

.chatbot-send-btn svg {
  transform: translateX(1px);
}

/* ── Mobile Optimization ── */
@media (max-width: 480px) {
  .chatbot-launcher {
    bottom: 16px;
    right: 16px;
    width: 54px;
    height: 54px;
  }
  .chatbot-window {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100%;
    max-height: 100vh;
    max-width: 100vw;
    border-radius: 0;
    border: none;
  }
  .chatbot-window.open {
    transform: translateY(0);
  }
  .chatbot-header {
    border-radius: 0;
    padding: 1.2rem 1.4rem;
  }
}
