/* Heaven Tours — floating chat assistant (premium UI) */

/* Lock page scroll while chat is open (esp. mobile) */
body.chatbot-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  left: 0;
  right: 0;
  overscroll-behavior: none;
}

.chatbot-toggle {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  right: calc(24px + env(safe-area-inset-right, 0px));
  width: 64px;
  height: 64px;
  min-width: 64px;
  min-height: 64px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--oxford-blue);
  box-shadow: none;
  cursor: pointer;
  z-index: 50;
  display: grid;
  place-items: center;
  transition: transform 0.22s ease;
  -webkit-tap-highlight-color: transparent;
}

.chatbot-tooltip,
.chatbot-nudge {
  position: absolute;
  top: 50%;
  right: calc(100% + 12px);
  left: auto;
  bottom: auto;
  transform: translateY(-50%) translateX(8px);
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--oxford-blue);
  color: var(--white);
  font-family: var(--ff-poppins, 'Poppins', sans-serif);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  box-shadow: 0 6px 16px hsla(209, 55%, 20%, 0.22);
  z-index: 1;
}

.chatbot-nudge {
  font-size: 0.8rem;
  padding: 8px 12px;
}

.chatbot-tooltip::after,
.chatbot-nudge::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 100%;
  right: auto;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: var(--oxford-blue);
  border-top-color: transparent;
}

.chatbot-toggle:hover .chatbot-tooltip,
.chatbot-toggle:focus-visible .chatbot-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

.chatbot-nudge.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
  animation: chatbot-nudge-pop 0.45s ease;
}

.chatbot-toggle:hover .chatbot-nudge,
.chatbot-toggle.is-open .chatbot-nudge,
.chatbot-toggle.is-open .chatbot-tooltip {
  opacity: 0;
  visibility: hidden;
  animation: none;
}

@keyframes chatbot-nudge-pop {
  0% { opacity: 0; transform: translateY(-50%) translateX(10px) scale(0.92); }
  70% { transform: translateY(-50%) translateX(-2px) scale(1.03); }
  100% { opacity: 1; transform: translateY(-50%) translateX(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .chatbot-nudge.is-visible { animation: none; }
}

.chatbot-toggle:hover,
.chatbot-toggle:focus-visible {
  background: transparent;
  transform: translateY(-4px);
  box-shadow: none;
  outline: none;
}

.chatbot-toggle-icon {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: contain;
  pointer-events: none;
  transition: transform 0.22s ease, filter 0.22s ease;
  filter: drop-shadow(0 4px 10px hsla(209, 55%, 20%, 0.22));
  animation: chatbot-float 2.8s ease-in-out infinite;
  transform-origin: center bottom;
}

.chatbot-toggle:hover .chatbot-toggle-icon,
.chatbot-toggle:focus-visible .chatbot-toggle-icon {
  animation: none;
  transform: scale(1.12);
  filter: drop-shadow(0 8px 16px hsla(209, 55%, 20%, 0.35)) brightness(1.06);
}

.chatbot-toggle.is-open .chatbot-toggle-icon { animation: none; }

@keyframes chatbot-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  40% { transform: translateY(-6px) rotate(-2deg); }
  70% { transform: translateY(-3px) rotate(2deg); }
}

@media (prefers-reduced-motion: reduce) {
  .chatbot-toggle-icon { animation: none; }
}

.chatbot-toggle.is-open {
  background: transparent;
  opacity: 0.92;
}

/* —— Panel —— */
.chatbot-panel {
  position: fixed;
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  right: calc(24px + env(safe-area-inset-right, 0px));
  width: min(360px, calc(100vw - 28px));
  height: min(560px, calc(100dvh - 108px));
  max-height: min(560px, calc(100dvh - 108px));
  background:
    linear-gradient(180deg, hsla(0, 0%, 100%, 0.96) 0%, hsla(210, 40%, 98%, 0.98) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 20px;
  box-shadow:
    0 1px 0 hsla(0, 0%, 100%, 0.7) inset,
    0 18px 48px hsla(209, 55%, 16%, 0.22);
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid hsla(214, 24%, 86%, 0.9);
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px) scale(0.96);
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.28s;
}

.chatbot-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 12px;
  background: linear-gradient(135deg, hsl(209, 61%, 16%) 0%, hsl(209, 58%, 28%) 55%, hsl(199, 55%, 34%) 100%);
  color: var(--white);
  flex-shrink: 0;
}

.chatbot-header-info { min-width: 0; }

.chatbot-header-info strong {
  display: block;
  font-family: var(--ff-montserrat);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.chatbot-header-info span {
  display: block;
  margin-top: 2px;
  font-size: 0.68rem;
  opacity: 0.82;
  line-height: 1.3;
}

.chatbot-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.chatbot-icon-btn,
.chatbot-close {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  border: none;
  border-radius: 50%;
  background: hsla(0, 0%, 100%, 0.14);
  color: var(--white);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.chatbot-icon-btn:hover,
.chatbot-close:hover {
  background: hsla(0, 0%, 100%, 0.26);
  transform: translateY(-1px);
}

.chatbot-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 12px 0;
  background: transparent;
  flex-shrink: 0;
}

.chatbot-tab {
  flex: 1;
  border: none;
  border-radius: 999px;
  padding: 8px 10px;
  font-family: var(--ff-montserrat);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--gray-web);
  background: hsla(210, 30%, 94%, 0.9);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.chatbot-tab:hover { color: var(--oxford-blue); }

.chatbot-tab.is-active {
  background: var(--white);
  color: var(--oxford-blue);
  box-shadow: 0 2px 10px hsla(209, 40%, 20%, 0.1);
}

/* —— Message / history panes —— */
.chatbot-messages,
.chatbot-history {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: transparent;
  min-height: 0;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.chatbot-messages[hidden],
.chatbot-history[hidden] { display: none !important; }

.chatbot-msg-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-width: 88%;
  animation: chatbot-msg-in 0.28s ease;
}

.chatbot-msg-wrap--bot { align-self: flex-start; }
.chatbot-msg-wrap--user { align-self: flex-end; align-items: flex-end; }

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

@media (prefers-reduced-motion: reduce) {
  .chatbot-msg-wrap { animation: none; }
  .chatbot-messages { scroll-behavior: auto; }
}

.chatbot-msg {
  max-width: 100%;
  padding: 11px 13px;
  border-radius: 16px;
  font-size: 0.8rem;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  box-shadow: 0 4px 14px hsla(209, 40%, 20%, 0.06);
}

.chatbot-msg--bot {
  background: hsla(0, 0%, 100%, 0.92);
  color: var(--gunmetal);
  border: 1px solid hsla(214, 22%, 88%, 0.95);
  border-bottom-left-radius: 6px;
}

.chatbot-msg--user {
  background: linear-gradient(135deg, var(--bright-navy-blue), hsl(199, 70%, 38%));
  color: var(--white);
  border: none;
  border-bottom-right-radius: 6px;
  box-shadow: 0 8px 18px hsla(209, 70%, 35%, 0.28);
}

.chatbot-msg--typing {
  background: hsla(0, 0%, 100%, 0.92);
  border: 1px solid hsla(214, 22%, 88%, 0.95);
  color: var(--gray-web);
  font-style: italic;
  font-size: 0.76rem;
  box-shadow: none;
}

.chatbot-link {
  color: var(--bright-navy-blue);
  font-weight: 650;
  text-decoration: none;
  border-bottom: 1px solid hsla(209, 70%, 45%, 0.45);
  word-break: normal;
  font-size: inherit;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.chatbot-link:hover {
  color: var(--oxford-blue);
  border-bottom-color: var(--oxford-blue);
}
.chatbot-msg--user .chatbot-link { color: #d7ecff; }

.chatbot-msg-actions {
  display: flex;
  gap: 2px;
  padding-left: 2px;
}

.chatbot-msg-action {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--gray-web);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.chatbot-msg-action:hover {
  background: hsla(209, 55%, 40%, 0.1);
  color: var(--bright-navy-blue);
  transform: translateY(-1px);
}

.chatbot-msg-action.is-selected,
.chatbot-msg-action.is-done {
  background: hsla(209, 55%, 40%, 0.12);
  color: var(--bright-navy-blue);
}

/* —— Suggestions: chips above input, never overlay messages —— */
.chatbot-suggestions {
  flex: 0 0 auto;
  padding: 0 12px 10px;
  background: transparent;
  border: none;
  max-height: none;
  overflow: visible;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.chatbot-suggestions.is-hiding,
.chatbot-suggestions[hidden] {
  display: none !important;
}

.chatbot-suggestions-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0 2px 8px;
  font-family: var(--ff-montserrat);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--oxford-blue);
}

.chatbot-suggestion-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 6px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.chatbot-suggestion-list::-webkit-scrollbar {
  height: 4px;
}
.chatbot-suggestion-list::-webkit-scrollbar-thumb {
  background: hsla(214, 20%, 75%, 0.9);
  border-radius: 999px;
}

.chatbot-suggestion {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  width: auto;
  max-width: 220px;
  text-align: left;
  border: 1px solid hsla(214, 22%, 86%, 0.95);
  border-radius: 999px;
  background: hsla(0, 0%, 100%, 0.92);
  color: var(--gunmetal);
  padding: 8px 12px;
  font-family: var(--ff-poppins);
  font-size: 0.72rem;
  line-height: 1.3;
  cursor: pointer;
  white-space: nowrap;
  scroll-snap-align: start;
  box-shadow: 0 2px 8px hsla(209, 40%, 20%, 0.05);
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.chatbot-suggestion:hover {
  border-color: hsla(209, 70%, 45%, 0.45);
  background: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px hsla(209, 40%, 20%, 0.1);
}

.chatbot-suggestion:active {
  transform: translateY(0) scale(0.98);
}

.chatbot-suggestion-ico {
  flex-shrink: 0;
  color: var(--bright-navy-blue);
  font-size: 0.72rem;
  line-height: 1;
}

/* —— History —— */
.chatbot-history-empty {
  margin: 8px 4px;
  font-size: 0.76rem;
  color: var(--gray-web);
  line-height: 1.45;
}

.chatbot-history-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  text-align: left;
  border: 1px solid hsla(214, 22%, 88%, 0.95);
  border-radius: 14px;
  background: hsla(0, 0%, 100%, 0.92);
  padding: 11px 12px;
  cursor: pointer;
  box-shadow: 0 2px 10px hsla(209, 40%, 20%, 0.04);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.chatbot-history-item:hover {
  border-color: hsla(209, 70%, 45%, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px hsla(209, 40%, 20%, 0.08);
}

.chatbot-history-item strong {
  font-size: 0.76rem;
  color: var(--oxford-blue);
  font-weight: 650;
  line-height: 1.35;
}

.chatbot-history-item span {
  font-size: 0.68rem;
  color: var(--gray-web);
  line-height: 1.4;
}

/* —— Input —— */
.chatbot-form {
  display: flex;
  gap: 10px;
  padding: 12px 12px 14px;
  border-top: 1px solid hsla(214, 22%, 88%, 0.85);
  background: hsla(0, 0%, 100%, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  align-items: center;
  flex-shrink: 0;
}

.chatbot-form[hidden] { display: none !important; }

.chatbot-input {
  flex: 1;
  min-width: 0;
  border: 1px solid hsla(214, 22%, 86%, 0.95);
  border-radius: 999px;
  padding: 12px 16px;
  font-family: var(--ff-poppins);
  font-size: 16px;
  color: var(--gunmetal);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 46px;
  box-shadow: 0 1px 2px hsla(209, 40%, 20%, 0.04);
}

.chatbot-input::placeholder { color: transparent; }

.chatbot-input:focus {
  border-color: hsla(209, 70%, 45%, 0.65);
  box-shadow: 0 0 0 3px hsla(209, 70%, 45%, 0.14);
}

.chatbot-send {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  min-width: 46px;
  min-height: 46px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bright-navy-blue), hsl(199, 70%, 38%));
  color: var(--white);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px hsla(209, 70%, 35%, 0.28);
  transition: background 0.2s ease, opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.chatbot-send:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px hsla(209, 70%, 35%, 0.34);
}

.chatbot-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.chatbot-send svg {
  width: 17px;
  height: 17px;
}

@media (max-width: 767px) {
  .chatbot-toggle {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    right: calc(12px + env(safe-area-inset-right, 0px));
    width: 60px;
    height: 60px;
    min-width: 60px;
    min-height: 60px;
  }

  .chatbot-toggle-icon {
    width: 60px;
    height: 60px;
  }

  .chatbot-panel {
    bottom: calc(82px + env(safe-area-inset-bottom, 0px));
    right: calc(12px + env(safe-area-inset-right, 0px));
    left: calc(12px + env(safe-area-inset-left, 0px));
    width: auto;
    height: min(62dvh, 560px);
    max-height: min(62dvh, 560px);
    border-radius: 18px;
  }
}

@media (max-width: 580px) {
  .chatbot-toggle {
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    right: calc(16px + env(safe-area-inset-right, 0px));
  }
}
