/* =========================================
   TRAVOUGE AI CHATBOT
========================================= */

:root {
  --chat-primary: #1f4e79;
  --chat-secondary: #477aa8;
  --chat-bg: #ffffff;
  --chat-light: #f5f8fb;
  --chat-text: #222;
  --chat-muted: #777;
}


/* =========================================
   FLOATING CHAT BUTTON
========================================= */

.chatbot-launcher {
  position: fixed;
  right: 25px;
  bottom: 25px;

  width: 62px;
  height: 62px;

  border: none;
  border-radius: 50%;

  background: var(--chat-primary);
  color: white;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 26px;

  cursor: pointer;

  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);

  z-index: 99999;

  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.chatbot-launcher:hover {
  transform: scale(1.08);

  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.3);
}


/* Pulse animation */

.chatbot-launcher::before {
  content: "";

  position: absolute;

  width: 100%;
  height: 100%;

  border-radius: 50%;

  border: 2px solid var(--chat-primary);

  animation: chatbotPulse 2s infinite;
}

@keyframes chatbotPulse {

  0% {
    transform: scale(1);
    opacity: 0.8;
  }

  70% {
    transform: scale(1.35);
    opacity: 0;
  }

  100% {
    transform: scale(1.35);
    opacity: 0;
  }

}


/* =========================================
   CHAT WINDOW
========================================= */

.chatbot-window {

  position: fixed;

  right: 25px;
  bottom: 100px;

  width: 380px;
  height: 480px;

  background: #fff;

  border-radius: 18px;

  box-shadow:
    0 15px 50px rgba(0, 0, 0, 0.25);

  overflow: hidden;

  display: flex;
  flex-direction: column;

  z-index: 99998;

  /* Initially hidden */

  opacity: 0;

  visibility: hidden;

  transform:
    translateY(30px)
    scale(0.95);

  transform-origin: bottom right;

  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    visibility 0.3s ease;
}


/* Open */

.chatbot-window.active {

  opacity: 1;

  visibility: visible;

  transform:
    translateY(0)
    scale(1);
}


/* =========================================
   CHAT HEADER
========================================= */

.chatbot-header {

  height: 70px;

  background:
    linear-gradient(
      135deg,
      var(--chat-primary),
      var(--chat-secondary)
    );

  color: white;

  display: flex;

  align-items: center;

  justify-content: space-between;

  padding: 12px 16px;
}


/* Header left */

.chatbot-header-info {

  display: flex;

  align-items: center;

  gap: 10px;
}


/* Bot avatar */

.chatbot-avatar {

  width: 42px;
  height: 42px;

  border-radius: 50%;

  background: white;

  color: var(--chat-primary);

  display: flex;

  align-items: center;

  justify-content: center;

  font-size: 20px;

  flex-shrink: 0;
}


/* Header text */

.chatbot-header-title {

  font-size: 16px;

  font-weight: 600;

  margin: 0;

  color: white;
}


.chatbot-status {

  font-size: 11px;

  margin: 2px 0 0;

  color: rgba(255,255,255,0.85);
}


/* Close */

.chatbot-close {
  width: 36px;
  height: 36px;

  border: none;
  background: transparent;

  color: white;

  font-size: 22px;

  cursor: pointer;

  border-radius: 50%;

  display: flex;
  align-items: center;
  justify-content: center;

  transition: background 0.2s ease;
}

.chatbot-close:hover {
  background: rgba(255, 255, 255, 0.2);
}


/* =========================================
   CHAT BODY
========================================= */

.chatbot-body {

  flex: 1;

  overflow-y: auto;

  padding: 16px;

  background:
    var(--chat-light);

  scroll-behavior: smooth;
}


/* Scrollbar */

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

.chatbot-body::-webkit-scrollbar-thumb {

  background: #c8d0d8;

  border-radius: 10px;
}


/* =========================================
   MESSAGE
========================================= */

.chat-message {

  display: flex;

  margin-bottom: 12px;

  animation: messageAppear 0.25s ease;
}


@keyframes messageAppear {

  from {

    opacity: 0;

    transform:
      translateY(8px);
  }

  to {

    opacity: 1;

    transform:
      translateY(0);
  }

}


/* Bot message */

.chat-message.bot {

  justify-content: flex-start;
}


/* User message */

.chat-message.user {

  justify-content: flex-end;
}


/* Message bubble */

.chat-bubble {

  max-width: 82%;

  padding: 10px 13px;

  border-radius: 14px;

  font-size: 13px;

  line-height: 1.5;

  word-wrap: break-word;
}


/* Bot */

.chat-message.bot .chat-bubble {

  background: white;

  color: var(--chat-text);

  border-bottom-left-radius: 4px;

  box-shadow:
    0 2px 8px rgba(0,0,0,0.05);
}


/* User */

.chat-message.user .chat-bubble {

  background:
    var(--chat-primary);

  color: white;

  border-bottom-right-radius: 4px;
}


/* =========================================
   QUICK ACTIONS
========================================= */

.chatbot-quick-actions {

  display: flex;

  flex-wrap: wrap;

  gap: 7px;

  margin-top: 10px;
}


.chatbot-quick-btn {

  border: 1px solid #d4dce4;

  background: white;

  color: var(--chat-primary);

  padding: 7px 10px;

  border-radius: 20px;

  font-size: 11px;

  cursor: pointer;

  transition: all 0.2s ease;
}


.chatbot-quick-btn:hover {

  background:
    var(--chat-primary);

  color: white;

  border-color:
    var(--chat-primary);

  transform:
    translateY(-1px);
}


/* =========================================
   TYPING INDICATOR
========================================= */

.typing-indicator {

  display: flex;

  align-items: center;

  gap: 4px;

  padding: 12px 15px;

  background: white;

  border-radius: 14px;

  border-bottom-left-radius: 4px;

  width: fit-content;
}


.typing-dot {

  width: 6px;

  height: 6px;

  background: #999;

  border-radius: 50%;

  animation:
    typingAnimation 1.2s infinite;
}


.typing-dot:nth-child(2) {

  animation-delay:
    0.2s;
}


.typing-dot:nth-child(3) {

  animation-delay:
    0.4s;
}


@keyframes typingAnimation {

  0%,
  60%,
  100% {

    transform:
      translateY(0);

    opacity: 0.4;
  }

  30% {

    transform:
      translateY(-5px);

    opacity: 1;
  }
}


/* =========================================
   CHAT INPUT
========================================= */

.chatbot-input-area {

  padding: 10px;

  background: white;

  border-top:
    1px solid #e8e8e8;

  display: flex;

  align-items: center;

  gap: 8px;
}


.chatbot-input {

  flex: 1;

  height: 42px;

  border:
    1px solid #ddd;

  border-radius: 22px;

  padding:
    0 15px;

  outline: none;

  font-size: 13px;

  color: #333;
}


.chatbot-input:focus {

  border-color:
    var(--chat-primary);

  box-shadow:
    0 0 0 2px
    rgba(31,78,121,0.08);
}


/* Send button */

.chatbot-send {

  width: 42px;
  height: 42px;

  border: none;

  border-radius: 50%;

  background:
    var(--chat-primary);

  color: white;

  cursor: pointer;

  display: flex;

  align-items: center;

  justify-content: center;

  transition:
    transform 0.2s ease;
}


.chatbot-send:hover {

  transform:
    scale(1.08);
}


/* =========================================
   MOBILE
========================================= */

@media (max-width: 576px) {

  .chatbot-window {

    right: 10px;
    left: 10px;

    bottom: 85px;

    width: auto;

    height: 70vh;

    max-height: 600px;

    border-radius: 16px;
  }

  .chatbot-launcher {

    right: 15px;

    bottom: 15px;

    width: 56px;
    height: 56px;
  }

}