/* Widget VegAI — MOCK para a feira (Equipotel).
   Estilos portados de vegai.widget/src/frame/ui/styles.css, adaptados para rodar
   embutido na página do hotel (o widget real roda dentro de um iframe posicionado
   pelo loader; aqui montamos direto no DOM da página). O accent é o navy do
   Vega Hotel Curitiba — no produto real cada hotel tematiza a própria cor. */

.vegai-widget {
  --vegai-accent: #1f2e52;
  --vegai-bg: #ffffff;
  --vegai-fg: #1a1a1a;
  --vegai-muted: #f2f4f8;
  --vegai-border: #e0e0e0;
  --vegai-on-accent: #ffffff;
  --vegai-radius: 14px;

  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.vegai-panel-wrap {
  width: min(400px, calc(100vw - 40px));
  height: min(620px, calc(100vh - 120px));
  transform-origin: bottom right;
  animation: vegai-panel-in 0.18s ease-out;
}
@keyframes vegai-panel-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .vegai-panel-wrap { animation: none; }
}

/* Launcher (bolha) */
.vegai-launcher {
  position: relative;
  align-self: flex-end;
  width: 56px;
  height: 56px;
  margin: 6px;
  border: 0;
  border-radius: 50%;
  color: var(--vegai-on-accent);
  background: var(--vegai-accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.14), 0 6px 18px -4px rgba(0, 0, 0, 0.28);
  transition: box-shadow 0.2s ease, transform 0.12s ease;
  flex: 0 0 auto;
}
.vegai-launcher:hover {
  box-shadow: 0 3px 7px rgba(0, 0, 0, 0.16), 0 10px 24px -5px rgba(0, 0, 0, 0.32);
  transform: translateY(-1px);
}
.vegai-launcher:focus-visible {
  outline: 3px solid var(--vegai-accent);
  outline-offset: 3px;
}

/* Painel */
.vegai-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  /* Reset defensivo: o widget vive no MESMO documento do site do hotel, e o hotel.css
     tem `section { padding: 76px 0 }` que vazava pra cá (o painel é um <section>). */
  margin: 0;
  padding: 0;
  background: var(--vegai-bg);
  color: var(--vegai-fg);
  border: 1px solid var(--vegai-border);
  border-radius: var(--vegai-radius);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.vegai-panel__header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: var(--vegai-on-accent);
  background: var(--vegai-accent);
}
.vegai-panel__avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.vegai-panel__id { flex: 1 1 auto; line-height: 1.2; }
.vegai-panel__title { font-weight: 600; font-size: 15px; }
.vegai-panel__subtitle {
  font-size: 11px;
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 5px;
}
.vegai-panel__online {
  width: 7px; height: 7px; border-radius: 50%;
  background: #34d058;
  box-shadow: 0 0 0 0 rgba(52, 208, 88, 0.6);
  animation: vegai-online 2.4s infinite;
}
@keyframes vegai-online {
  0% { box-shadow: 0 0 0 0 rgba(52, 208, 88, 0.55); }
  70% { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.vegai-panel__close {
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  padding: 4px;
  display: flex;
  flex: 0 0 auto;
}
.vegai-panel__close:focus-visible { outline: 2px solid var(--vegai-on-accent); }

/* Thread */
.vegai-thread {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.vegai-msg { display: flex; flex-direction: column; gap: 8px; }
.vegai-msg--guest { align-items: flex-end; }
.vegai-msg--agent { align-items: flex-start; }
.vegai-msg__bubble {
  max-width: 80%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.vegai-msg--guest .vegai-msg__bubble {
  background: var(--vegai-accent);
  color: var(--vegai-on-accent);
  border-bottom-right-radius: 3px;
}
.vegai-msg--agent .vegai-msg__bubble {
  background: var(--vegai-muted);
  color: var(--vegai-fg);
  border-bottom-left-radius: 3px;
}
.vegai-msg__link { color: inherit; text-decoration: underline; }
.vegai-msg__author {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #5f6368;
  margin-bottom: -4px;
}
.vegai-msg__author-icon { display: inline-block; vertical-align: middle; opacity: 0.85; }

/* Typing */
.vegai-typing { display: flex; gap: 4px; padding: 6px 4px; }
.vegai-typing__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #9aa0a6;
  animation: vegai-blink 1.2s infinite both;
}
.vegai-typing__dot:nth-child(2) { animation-delay: 0.2s; }
.vegai-typing__dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes vegai-blink {
  0%, 80%, 100% { opacity: 0.3; }
  40% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .vegai-typing__dot { animation: none; } }

/* Composer */
.vegai-composer {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--vegai-border);
}
.vegai-composer__input {
  flex: 1 1 auto;
  resize: none;
  border: 1px solid var(--vegai-border);
  border-radius: 10px;
  padding: 9px 12px;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  max-height: 120px;
  color: var(--vegai-fg);
  background: var(--vegai-bg);
}
.vegai-composer__input:focus-visible {
  outline: 2px solid var(--vegai-accent);
  border-color: var(--vegai-accent);
}
.vegai-composer__send {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  border: 0; border-radius: 10px;
  background: var(--vegai-accent);
  color: var(--vegai-on-accent);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.vegai-composer__send:disabled { opacity: 0.5; cursor: default; }
.vegai-composer__send:focus-visible { outline: 3px solid var(--vegai-accent); outline-offset: 2px; }

/* Cards de opção de quarto */
.vegai-card-list { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 100%; }
.vegai-card {
  width: 100%; max-width: 100%; box-sizing: border-box;
  border: 1px solid var(--vegai-border);
  border-radius: 12px; overflow: hidden;
  background: var(--vegai-bg);
}
.vegai-card__image { display: block; width: 100%; max-width: 100%; height: 140px; object-fit: cover; }
.vegai-card__body { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.vegai-card__title { font-weight: 600; font-size: 14px; color: var(--vegai-fg); }
.vegai-card__rate-name { font-size: 12px; color: var(--vegai-fg); opacity: 0.7; }
.vegai-card__description { font-size: 13px; line-height: 1.4; color: var(--vegai-fg); margin: 0; }
.vegai-card__amenities { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.vegai-card__amenity { font-size: 11px; background: var(--vegai-muted); border-radius: 999px; padding: 2px 8px; color: var(--vegai-fg); }
.vegai-card__occupancy { font-size: 12px; color: var(--vegai-fg); opacity: 0.7; }
.vegai-card__price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.vegai-card__price-value { font-weight: 700; font-size: 15px; color: var(--vegai-fg); }
.vegai-card__price-qualifier { font-size: 12px; color: var(--vegai-fg); opacity: 0.7; }
.vegai-card__cancellation { font-size: 12px; }
.vegai-card__cancellation-headline { font-weight: 600; color: var(--vegai-fg); }
.vegai-card__cancellation-detail { color: var(--vegai-fg); opacity: 0.7; margin-top: 2px; }
.vegai-card__select {
  margin-top: 4px;
  background: var(--vegai-accent);
  color: var(--vegai-on-accent);
  border: 0; border-radius: 8px;
  padding: 9px 12px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.vegai-card__select:focus-visible { outline: 2px solid var(--vegai-fg); outline-offset: 2px; }

/* Quick replies (chips) */
.vegai-chips { display: flex; flex-wrap: wrap; gap: 8px; max-width: 100%; }
.vegai-chip {
  background: var(--vegai-muted);
  color: var(--vegai-fg);
  border: 1px solid var(--vegai-border);
  border-radius: 999px;
  padding: 6px 12px; font-size: 13px; cursor: pointer;
  font-family: inherit;
}
.vegai-chip:hover { background: var(--vegai-border); }
.vegai-chip:focus-visible { outline: 2px solid var(--vegai-accent); outline-offset: 2px; }

/* Card de link de reserva */
.vegai-booking-link {
  width: 100%; max-width: 100%; box-sizing: border-box;
  border: 1px solid var(--vegai-border);
  border-radius: 12px; background: var(--vegai-bg);
  padding: 12px; display: flex; flex-direction: column; gap: 10px;
}
.vegai-booking-link__info { display: flex; flex-direction: column; gap: 2px; }
.vegai-booking-link__title { font-weight: 600; font-size: 14px; color: var(--vegai-fg); }
.vegai-booking-link__subtitle { font-size: 12px; color: var(--vegai-fg); opacity: 0.7; }
.vegai-booking-link__cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--vegai-accent); color: var(--vegai-on-accent);
  text-decoration: none; border-radius: 8px;
  padding: 10px 14px; font-size: 14px; font-weight: 600;
}
.vegai-booking-link__cta:hover { filter: brightness(1.12); }
.vegai-booking-link__cta:focus-visible { outline: 2px solid var(--vegai-fg); outline-offset: 2px; }

@media (max-width: 480px) {
  .vegai-widget { right: 12px; bottom: 12px; }
  .vegai-panel-wrap { height: min(600px, calc(100dvh - 90px)); }
}

/* Trava o scroll do fundo enquanto o chat está aberto no celular (evita rolar a página e o teclado
   deslocar o painel). */
html.vegai-noscroll, html.vegai-noscroll body { overflow: hidden !important; }

/* Celular com o chat aberto (classe posta pelo JS via visualViewport): TELA CHEIA na área visível —
   cabeçalho fixo no topo, thread rola no meio, campo colado acima do teclado; launcher escondido
   (fecha pelo X do cabeçalho). */
.vegai-widget.vegai-kb { align-items: stretch; gap: 0; }
.vegai-widget.vegai-kb .vegai-panel-wrap { width: 100%; height: 100%; animation: none; }
.vegai-widget.vegai-kb .vegai-panel { border-radius: 0; border: 0; box-shadow: none; }
.vegai-widget.vegai-kb .vegai-launcher { display: none; }

/* Card de estadia (minhaestadia) — resumo da reserva ativa, tematizado no navy do hotel. */
.vegai-stay {
  margin-top: 8px;
  border: 1px solid var(--vegai-border);
  border-radius: var(--vegai-radius);
  background: var(--vegai-bg);
  overflow: hidden;
}
.vegai-stay__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--vegai-accent);
  color: var(--vegai-on-accent);
}
.vegai-stay__title { font-weight: 600; font-size: 13px; }
.vegai-stay__badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: var(--vegai-on-accent);
  white-space: nowrap;
}
.vegai-stay__badge--hospedado { background: #1a9152; }
.vegai-stay__badge--pre_checkin { background: #c47d00; }
.vegai-stay__badge--checkout { background: rgba(255, 255, 255, 0.28); }
.vegai-stay__rows { padding: 6px 12px 10px; }
.vegai-stay__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  border-bottom: 1px solid var(--vegai-muted);
  font-size: 13px;
}
.vegai-stay__row:last-child { border-bottom: 0; }
.vegai-stay__label { color: #6a6f78; }
.vegai-stay__value { font-weight: 600; text-align: right; }
