/* ==========================================================================
   ABADAA — AI travel assistant widget
   Small glass box, fixed bottom-right. Loaded after site.css.

   Glass technique: dark forest-tinted translucent surface + backdrop-filter
   blur/saturate, a 1px translucent cream border and a top-edge inset
   highlight (Apple-style frosted glass, per the design system reference).
   CSS only on purpose: the hero already runs a full-screen WebGPU ocean, so a
   second GPU canvas would risk contention with it. blur+blur is near-free.

   Legibility over moving water: the tint is deliberately dark (it darkens the
   brightest foam behind the text) while the copy is near-white, so contrast
   holds over both the bright and the dark parts of the animation.

   z-index is 150 — below the sticky nav (200) so an open mobile nav still
   sits above the widget and never has its taps blocked.
   ========================================================================== */

.abw-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 150;
  font-family: var(--sans, "Inter", system-ui, sans-serif);
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------------- launcher */
.abw-launch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 19px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: .01em;
  color: #FBFAF5;
  background: linear-gradient(155deg, rgba(31, 66, 53, .74), rgba(18, 37, 29, .84));
  -webkit-backdrop-filter: blur(16px) saturate(165%);
  backdrop-filter: blur(16px) saturate(165%);
  border: 1px solid rgba(244, 241, 234, .30);
  box-shadow:
    0 18px 42px -18px rgba(6, 16, 11, .88),
    0 2px 8px -2px rgba(6, 16, 11, .45),
    inset 0 1px 0 rgba(255, 255, 255, .26);
  cursor: pointer;
  transition: transform .22s cubic-bezier(.2, .8, .2, 1), opacity .3s, box-shadow .22s;
}
.abw-launch:hover { transform: translateY(-2px); }
.abw-launch:active { transform: translateY(0); }
.abw-launch svg { width: 17px; height: 17px; flex: none; color: #E7C766; }
.abw-launch.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px) scale(.96);
}

/* ------------------------------------------------------------------- card */
.abw-dock {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(372px, calc(100vw - 30px));
  transform: translateY(16px) scale(.97);
  transform-origin: 100% 100%;
  opacity: 0;
  pointer-events: none;
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), opacity .3s;
}
.abw-dock.is-open {
  transform: none;
  opacity: 1;
  pointer-events: auto;
}

.abw-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: min(552px, 72vh);
  border-radius: 22px;
  color: #F2EFE7;
  background: linear-gradient(158deg, rgba(26, 54, 44, .60), rgba(13, 29, 23, .74));
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  backdrop-filter: blur(20px) saturate(170%);
  border: 1px solid rgba(244, 241, 234, .30);
  box-shadow:
    0 34px 74px -32px rgba(4, 12, 8, .92),
    0 4px 14px -6px rgba(4, 12, 8, .45),
    inset 0 1px 0 rgba(255, 255, 255, .28);
}
/* soft gold top-edge sheen — reads as a glass highlight, not a colour */
.abw-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(231, 199, 102, .55), transparent);
  pointer-events: none;
}

/* ------------------------------------------------------------------- head */
.abw-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border-bottom: 1px solid rgba(244, 241, 234, .18);
  background: linear-gradient(120deg, rgba(27, 58, 47, .46), rgba(20, 41, 31, .24));
}
.abw-ava {
  width: 36px; height: 36px;
  border-radius: 12px;
  flex: none;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #B8912F, #D9B23C);
  color: #1B3A2F;
  font-family: var(--serif, Georgia, serif);
  font-weight: 600;
  font-size: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45);
}
.abw-head__txt { min-width: 0; }
.abw-head__txt b {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  color: #FCFAF4;
  letter-spacing: .01em;
}
.abw-head__txt span {
  display: block;
  font-size: 12px;
  color: rgba(240, 236, 226, .72);
}
.abw-live {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-left: auto;
  flex: none;
  background: #6FD79B;
  box-shadow: 0 0 0 0 rgba(111, 215, 155, .7);
  animation: abwPulse 2.4s infinite;
}
@keyframes abwPulse {
  0%   { box-shadow: 0 0 0 0 rgba(111, 215, 155, .55); }
  70%  { box-shadow: 0 0 0 10px rgba(111, 215, 155, 0); }
  100% { box-shadow: 0 0 0 0 rgba(111, 215, 155, 0); }
}
.abw-close {
  width: 30px; height: 30px;
  margin-left: 8px;
  flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #F2EFE7;
  background: rgba(244, 241, 234, .12);
  border: 1px solid rgba(244, 241, 234, .22);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  transition: background .2s, transform .2s;
}
.abw-close:hover { background: rgba(244, 241, 234, .24); transform: scale(1.06); }

/* -------------------------------------------------------------------- log */
.abw-log {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;   /* never chain-scroll the page */
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 188px;
  scrollbar-width: thin;
  scrollbar-color: rgba(244, 241, 234, .35) transparent;
}
.abw-log::-webkit-scrollbar { width: 8px; }
.abw-log::-webkit-scrollbar-thumb {
  background: rgba(244, 241, 234, .28);
  border-radius: 99px;
}
.abw-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 15px;
  font-size: 14.2px;
  line-height: 1.52;
  white-space: pre-wrap;
  word-break: break-word;
  animation: abwPop .32s cubic-bezier(.2, .9, .3, 1.15) both;
}
@keyframes abwPop {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.abw-msg.bot {
  align-self: flex-start;
  color: #FBF9F4;
  background: rgba(244, 241, 234, .14);
  border: 1px solid rgba(244, 241, 234, .22);
  border-bottom-left-radius: 5px;
}
.abw-msg.me {
  align-self: flex-end;
  color: #1E1708;
  font-weight: 500;
  background: linear-gradient(140deg, rgba(196, 156, 58, .96), rgba(217, 178, 60, .96));
  border-bottom-right-radius: 5px;
}
.abw-msg.err {
  align-self: flex-start;
  color: #FBE6E0;
  background: rgba(157, 47, 33, .34);
  border: 1px solid rgba(226, 146, 126, .5);
  border-bottom-left-radius: 5px;
}
.abw-typing {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 12px 15px;
}
.abw-typing i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(244, 241, 234, .8);
  opacity: .5;
  animation: abwBounce 1.15s infinite;
}
.abw-typing i:nth-child(2) { animation-delay: .16s; }
.abw-typing i:nth-child(3) { animation-delay: .32s; }
@keyframes abwBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .42; }
  30%           { transform: translateY(-5px); opacity: .95; }
}

/* --------------------------------------------------------------- suggests */
.abw-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 14px 11px;
}
.abw-suggest button {
  font-size: 12.4px;
  padding: 6px 11px;
  border-radius: 999px;
  color: rgba(240, 236, 226, .88);
  background: rgba(244, 241, 234, .10);
  border: 1px solid rgba(244, 241, 234, .22);
  cursor: pointer;
  transition: background .18s, border-color .18s, color .18s, transform .18s;
}
.abw-suggest button:hover {
  background: rgba(244, 241, 234, .20);
  border-color: rgba(231, 199, 102, .6);
  color: #FCFAF4;
  transform: translateY(-1px);
}

/* ------------------------------------------------------------------- form */
.abw-form {
  display: flex;
  gap: 8px;
  padding: 11px 12px;
  border-top: 1px solid rgba(244, 241, 234, .18);
  background: rgba(10, 24, 18, .28);
}
.abw-form input {
  flex: 1;
  min-width: 0;
  padding: 11px 15px;
  border-radius: 999px;
  border: 1px solid rgba(244, 241, 234, .26);
  background: rgba(255, 255, 255, .09);
  font: inherit;
  font-size: 14.2px;
  color: #FBF9F4;
  outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.abw-form input::placeholder { color: rgba(244, 241, 234, .58); }
.abw-form input:focus {
  border-color: #D9B23C;
  background: rgba(255, 255, 255, .15);
  box-shadow: 0 0 0 3px rgba(184, 145, 47, .32);
}
.abw-send {
  width: 42px; height: 42px;
  flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #1B3A2F;
  background: linear-gradient(140deg, #C49C3A, #D9B23C);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4);
  cursor: pointer;
  transition: transform .2s, opacity .2s;
}
.abw-send:hover { transform: scale(1.07); }
.abw-send:disabled { opacity: .45; transform: none; cursor: not-allowed; }
.abw-send svg { width: 17px; height: 17px; }

.abw-foot {
  padding: 0 14px 11px;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
  color: rgba(240, 236, 226, .60);
  background: rgba(10, 24, 18, .28);
}

/* accessibility: real focus states */
.abw-launch:focus-visible,
.abw-close:focus-visible,
.abw-send:focus-visible,
.abw-suggest button:focus-visible {
  outline: 2px solid #E7C766;
  outline-offset: 3px;
}

/* ---------------------------------------------------------------- mobile */
@media (max-width: 480px) {
  .abw-root { right: 12px; bottom: 12px; }
  .abw-dock { width: calc(100vw - 24px); }
  .abw-card { max-height: min(62vh, 500px); border-radius: 18px; }
  .abw-launch { padding: 12px 16px; font-size: 14px; }
  .abw-msg { font-size: 14px; }
}
@media (max-width: 360px) {
  .abw-launch span { display: none; }
  .abw-launch { padding: 13px; }
}

/* no glass support (very old engines): fall back to a solid, still-readable box */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .abw-card { background: linear-gradient(158deg, #22463a, #12291f); }
  .abw-launch { background: linear-gradient(155deg, #22463a, #12291f); }
}

@media (prefers-reduced-motion: reduce) {
  .abw-card, .abw-dock, .abw-launch, .abw-msg, .abw-typing i, .abw-live {
    animation: none !important;
    transition-duration: .001s !important;
  }
}
