/* =========================================================
   Avori Website - Chatbot UI
   UI area affected: floating “Ask Avori AI” chatbot preview.
   Purpose: styles the fixed launcher button, chat panel,
   header controls, messages, suggestions, input form, Book Demo
   CTA, minimized state, and mobile chatbot positioning.
   Load order: after animations.css, before responsive.css.
========================================================= */

/* Floating round launcher button in bottom-right corner. */
.avori-chat-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9998;
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  box-shadow: 0 18px 40px rgba(3, 24, 45, .28);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .18s ease, box-shadow .18s ease;
}

/* Launcher hover lift effect. */
.avori-chat-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 48px rgba(3, 24, 45, .34);
}

/* Launcher speech-bubble icon size. */
.avori-chat-launcher svg {
  width: 30px;
  height: 30px;
}

/* Main chat window panel positioned above the launcher. */
.avori-chat-widget {
  position: fixed;
  right: 24px;
  bottom: 100px;
  z-index: 9999;
  width: min(392px, calc(100vw - 32px));
  height: min(610px, calc(100vh - 132px));
  background: #fff;
  color: var(--ink);
  border: 1px solid rgba(216, 224, 235, .95);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 26px 70px rgba(3, 24, 45, .30);
  display: none;
  flex-direction: column;
}

/* Visible state toggled by main.js. */
.avori-chat-widget.is-open {
  display: flex;
}

/* Minimized state: keeps only the topbar visible. */
.avori-chat-widget.is-minimized {
  height: 72px;
}

.avori-chat-widget.is-minimized .avori-chat-messages,
.avori-chat-widget.is-minimized .avori-chat-suggestions,
.avori-chat-widget.is-minimized .avori-chat-input,
.avori-chat-widget.is-minimized /* Bottom Book Demo CTA area inside the chat panel. */
.avori-chat-demo {
  display: none;
}

/* Chat header bar with title, avatar, minimize, and close controls. */
.avori-chat-topbar {
  min-height: 72px;
  background: linear-gradient(135deg, #061f3a, #082a51);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
}

/* Chat title group: AI badge + text. */
.avori-chat-title {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

/* Small “AI” badge in chat header. */
.avori-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 118, 0, .18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--orange);
  font-weight: 900;
}

.avori-chat-title strong {
  display: block;
  font-size: 15px;
  line-height: 1.1;
}

.avori-chat-title small {
  display: block;
  color: rgba(255,255,255,.72);
  margin-top: 3px;
  font-size: 12px;
}

/* Header controls group for minimize and close buttons. */
.avori-chat-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Minimize/close button styling. */
.avori-chat-icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255,255,255,.20);
  background: rgba(255,255,255,.10);
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 900;
  line-height: 1;
}

/* Scrollable chat message area. */
.avori-chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #f7f9fc;
}

/* Shared message bubble styling. */
.avori-msg {
  max-width: 86%;
  margin: 0 0 12px;
  padding: 12px 13px;
  border-radius: 15px;
  font-size: 14px;
  line-height: 1.38;
  white-space: pre-line;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Bot message bubble styling. */
.avori-msg.bot {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  border-top-left-radius: 5px;
}

/* User message bubble styling. */
.avori-msg.user {
  margin-left: auto;
  background: var(--blue);
  color: #fff;
  border-top-right-radius: 5px;
}

/* Suggested question chips above the input. */
.avori-chat-suggestions {
  padding: 12px 14px 2px;
  background: #fff;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Individual suggested question chip. */
.avori-suggest {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 12px;
  cursor: pointer;
}

.avori-suggest:hover {
  border-color: var(--orange);
  color: var(--orange);
}

/* Chat input row containing text field and Send button. */
.avori-chat-input {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  background: #fff;
  border-top: 1px solid var(--line);
}

.avori-chat-input input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 12px;
  font: inherit;
  outline: none;
}

.avori-chat-input input:focus {
  border-color: var(--blue);
}

.avori-chat-input button {
  border: 0;
  border-radius: 12px;
  background: var(--orange);
  color: #fff;
  font-weight: 900;
  padding: 0 15px;
  cursor: pointer;
}

.avori-chat-demo {
  padding: 0 14px 14px;
  background: #fff;
}

.avori-chat-demo a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--navy);
  color: #fff;
  font-weight: 900;
}

/* Mobile chatbot sizing/positioning. */
@media (max-width: 650px) {
  .avori-chat-launcher {
    right: 18px;
    bottom: 18px;
    width: 58px;
    height: 58px;
  }

  .avori-chat-widget {
    right: 12px;
    bottom: 88px;
    width: calc(100vw - 24px);
    height: min(620px, calc(100vh - 108px));
  }
}