/**
 * eYatra FAQ assistant.
 *
 * Mobile first: the base rules are the phone bottom sheet; from 601px up the
 * panel anchors to the bottom-right corner above the launcher. Colours come
 * from the Modern UI tokens with literal fallbacks so the widget still looks
 * right if that sheet is not loaded.
 */

.ey-faq-bot {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 99990;
  font-family: inherit;
}

.ey-faq-bot-launcher {
  align-items: center;
  background: #fff;
  border: 0;
  border-radius: 50%;
  box-shadow: 0 10px 24px rgba(7, 42, 94, 0.28);
  cursor: pointer;
  display: flex;
  height: 60px;
  justify-content: center;
  padding: 0;
  transition: box-shadow 0.18s ease;
  width: 60px;
}

/* The theme styles every button:hover/focus green and adds 30px side padding.
   Override those here so the white circle stays put and the icon wobbles. */
.ey-faq-bot-launcher:hover,
.ey-faq-bot-launcher:focus {
  background: #fff;
  border-color: transparent;
  box-shadow: 0 14px 30px rgba(7, 42, 94, 0.34);
  padding: 0;
  animation: ey-faq-bot-wobble 0.6s ease-in-out;
}

.ey-faq-bot-launcher:active {
  background: #fff;
  padding: 0;
}

@keyframes ey-faq-bot-wobble {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(-6px); }
  50% { transform: translateY(0); }
  75% { transform: translateY(-3px); }
}

.ey-faq-bot-launcher:focus-visible {
  outline: 3px solid var(--ey-orange, #ff7a00);
  outline-offset: 3px;
}

.ey-faq-bot-launcher svg {
  display: block;
  height: 100%;
  width: 100%;
}

/* Remove theme button arrow (->) from all bot buttons */
.ey-faq-bot button,
.ey-faq-bot .button,
.ey-faq-bot-close,
.ey-faq-bot-send,
.ey-faq-bot-chip,
.ey-faq-bot-form button {
  text-transform: inherit;
}

.ey-faq-bot button::after,
.ey-faq-bot .button::after,
.ey-faq-bot-close::after,
.ey-faq-bot-send::after,
.ey-faq-bot-chip::after {
  content: none !important;
  display: none !important;
  font-family: none !important;
  padding-left: 0 !important;
}

.ey-faq-bot.is-open .ey-faq-bot-launcher {
  display: none;
}

.ey-faq-bot-panel {
  background: #fff;
  border-radius: 18px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 24px 60px rgba(7, 42, 94, 0.3);
  display: flex;
  flex-direction: column;
  height: 560px;
  left: 12px;
  max-height: calc(100vh - 24px);
  max-height: calc(100svh - 24px);
  max-height: calc(100dvh - 24px);
  overflow: hidden;
  position: fixed;
  right: 12px;
}

.ey-faq-bot-panel[hidden] {
  display: none;
}

.ey-faq-bot-head {
  align-items: center;
  background: linear-gradient(120deg, #072a5e 0%, #0b3a82 55%, #1246a0 100%);
  color: #fff;
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
}

.ey-faq-bot-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.ey-faq-bot-close {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  padding: 0 4px;
}

/* No scale/expand on hover; the × only turns red. */
.ey-faq-bot-close:hover,
.ey-faq-bot-close:focus {
  background: transparent;
  border-color: transparent;
  color: #d63638;
  padding: 0 4px;
}

.ey-faq-bot-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.ey-faq-bot-log {
  background: #f6f8fc;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 14px;
}

.ey-faq-bot-msg {
  border-radius: 14px;
  font-size: 0.94rem;
  line-height: 1.45;
  max-width: 85%;
  overflow-wrap: break-word;
  padding: 10px 12px;
  white-space: pre-wrap;
}

.ey-faq-bot-msg--bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e2e6ee;
  border-bottom-left-radius: 4px;
  color: #1f2430;
}

.ey-faq-bot-msg--user {
  align-self: flex-end;
  background: #072a5e;
  border-bottom-right-radius: 4px;
  color: #fff;
}

.ey-faq-bot-typing {
  font-style: italic;
  opacity: 0.7;
}

.ey-faq-bot-contact {
  align-self: flex-start;
  color: #6b7280;
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  gap: 4px;
  padding: 0 4px;
}

.ey-faq-bot-contact a {
  color: #b35300;
  font-weight: 700;
  text-decoration: none;
}

.ey-faq-bot-contact a:hover,
.ey-faq-bot-contact a:focus-visible {
  text-decoration: underline;
}

.ey-faq-bot-chips {
  background: #fff;
  border-top: 1px solid #e2e6ee;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px;
}

.ey-faq-bot-chip {
  background: #f6f8fc;
  border: 1px solid #e2e6ee;
  border-radius: 999px;
  color: #072a5e;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  line-height: 1.3;
  padding: 6px 11px;
  white-space: normal;
  flex: 0 0 auto;
  max-width: 100%;
}

.ey-faq-bot-chip:hover,
.ey-faq-bot-chip:focus {
  border-color: #072a5e;
  padding: 6px 11px;
}

.ey-faq-bot-chip:focus-visible,
.ey-faq-bot-send:focus-visible,
.ey-faq-bot-input:focus-visible {
  outline: 2px solid #ff7a00;
  outline-offset: 1px;
}

.ey-faq-bot-form {
  align-items: center;
  background: #fff;
  border-top: 1px solid #e2e6ee;
  display: flex;
  gap: 8px;
  padding: 12px 14px;
}

.ey-faq-bot-input {
  border: 1px solid #e2e6ee;
  border-radius: 999px;
  color: #1f2430;
  flex: 1 1 auto;
  font-family: inherit;
  font-size: 0.95rem;
  min-width: 0;
  padding: 10px 14px;
}

.ey-faq-bot-input:focus {
  border-color: transparent;
}

.ey-faq-bot-send {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: #ff7a00;
  cursor: pointer;
  display: flex;
  flex: 0 0 40px;
  height: 40px;
  justify-content: center;
  padding: 0;
  transition: background-color 0.18s ease, color 0.18s ease;
  width: 40px;
}

/* Theme buttons grow 30px on hover; keep this one the same size and fill it
   orange instead. */
.ey-faq-bot-send:hover:not(:disabled),
.ey-faq-bot-send:focus:not(:disabled) {
  background: #ff7a00;
  border-color: transparent;
  color: #fff;
  padding: 0;
}

.ey-faq-bot-send:disabled {
  cursor: default;
  opacity: 0.6;
}

.ey-faq-bot-send svg {
  height: 20px;
  width: 20px;
}

.ey-faq-bot-sr {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

@media (min-width: 601px) {
  .ey-faq-bot {
    bottom: calc(24px + env(safe-area-inset-bottom));
    right: 24px;
  }

  .ey-faq-bot-panel {
    bottom: calc(96px + env(safe-area-inset-bottom));
    height: 560px;
    left: auto;
    max-height: calc(100vh - 120px);
    max-height: calc(100svh - 120px);
    max-height: calc(100dvh - 120px);
    right: 24px;
    width: 380px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ey-faq-bot-launcher {
    transition: none;
  }

  .ey-faq-bot-launcher:hover {
    animation: none;
  }
}
