/* GPC New Wave Miskolc — Lead-capture chat widget (F2, 2026-10-06 — valódi AI)
   Brand: piros #c02425 | arany #dbab32 | beige #f0e8d8 | sötét #1b1b1b (lásd brand.css)
   MEGJEGYZÉS: ez a _vercel_demo/ (Iván-demó) másolat — az élő iroda/ production
   NEM tartalmazza ezt a fájlt (Barni re-target döntése, 2026-07-23).
   2026-10-06: a .ai-* osztályok (chipek, input-sor, nagy CTA, mode-tag) az
   iroda/assets/ai-widget.css-ből átemelve ide is — a chat-widget.js F2 verziója
   ugyanezt a markupot használja a VALÓDI /api/chat-beszélgetéshez. */

.chat-bubble-btn {
  position: fixed;
  right: 1.5rem;
  /* 2026-10-05 — a `--chat-consent-offset`-et a chat-widget.js írja (consent-sáv
     magassága + rés), hogy a gomb a sütisáv FÖLÉ emelkedjen, ne alá/mögé takarva
     legyen (korábban a sáv z-indexe miatt teljesen kattinthatatlan volt). */
  bottom: calc(1.5rem + var(--chat-consent-offset, 0px) + var(--nw-bar-offset, 0px));
  z-index: 900;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
  box-shadow: 0 8px 24px rgba(192,36,37,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.chat-bubble-btn:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 12px 28px rgba(192,36,37,0.45); }
.chat-bubble-btn svg { width: 26px; height: 26px; stroke: #fff; }
.chat-bubble-btn .chat-bubble-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid #fff;
}
.chat-bubble-btn.chat-hidden { display: none; }

.chat-panel {
  position: fixed;
  right: 1.5rem;
  bottom: calc(1.5rem + var(--chat-consent-offset, 0px) + var(--nw-bar-offset, 0px));
  z-index: 901;
  width: 380px;
  max-width: calc(100vw - 2rem);
  height: 600px;
  max-height: calc(100vh - 3rem);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.28);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.chat-panel.open { display: flex; }

.chat-panel-header {
  background: var(--dark);
  color: #fff;
  padding: 1rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.chat-panel-header-title {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.chat-panel-header-title img { height: 30px; width: auto; background: #fff; padding: 3px 6px; border-radius: 4px; box-sizing: content-box; }
.chat-panel-header-title div strong {
  display: block;
  font-family: 'Poppins', sans-serif;
  font-size: .85rem;
  font-weight: 600;
}
.chat-panel-header-title div span {
  display: block;
  font-size: .7rem;
  color: var(--gold-light);
}
.chat-panel-close, .chat-panel-restart {
  background: rgba(255,255,255,0.08);
  border: none;
  color: #fff;
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-panel-close:hover, .chat-panel-restart:hover { background: rgba(255,255,255,0.18); }
.chat-panel-header-actions { display: flex; gap: .4rem; }

.chat-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: var(--beige);
  display: flex;
  flex-direction: column;
  gap: .65rem;
}

.chat-msg {
  max-width: 84%;
  padding: .65rem .85rem;
  border-radius: 12px;
  font-family: 'Poppins', sans-serif;
  font-size: .85rem;
  line-height: 1.55;
  animation: chatFadeUp .25s ease forwards;
  overflow-wrap: anywhere; /* 2026-10-05 — hosszú, szóköz nélküli token (pl. URL) ne törje szét a buborékot */
}

/* Betöltés-indikátor (pl. GET /api/booking közben) — 2026-10-05 */
.chat-typing {
  align-self: flex-start;
  display: flex;
  gap: .25rem;
  padding: .6rem .8rem;
}
.chat-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold, #dbab32);
  opacity: .5;
  animation: chatTypingBlink 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: .2s; }
.chat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes chatTypingBlink { 0%,60%,100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@keyframes chatFadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.chat-msg.bot {
  align-self: flex-start;
  background: #fff;
  color: var(--text-body);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.chat-msg.user {
  align-self: flex-end;
  background: var(--red);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-choices {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  margin-top: .2rem;
}
.chat-choice-btn {
  background: #fff;
  border: 1.5px solid var(--red);
  color: var(--red);
  font-family: 'Poppins', sans-serif;
  font-size: .82rem;
  font-weight: 600;
  padding: .6rem .85rem;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.chat-choice-btn:hover { background: var(--red); color: #fff; }
.chat-choice-btn.chat-choice-gold { border-color: var(--gold-dark); color: var(--gold-dark); }
.chat-choice-btn.chat-choice-gold:hover { background: var(--gold); color: #fff; border-color: var(--gold); }

.chat-choice-sub { display: block; margin-top: .15rem; font-weight: 400; font-size: .76rem; line-height: 1.4; opacity: .9; }
.chat-choices-stack .chat-choice-btn { width: 100%; }

.chat-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.chat-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: .4rem; }

.chat-form-box {
  background: #fff;
  border-radius: 10px;
  padding: .9rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.chat-form-box .form-group { margin-bottom: .65rem; }
.chat-form-box label { font-size: .75rem; }
.chat-form-box input, .chat-form-box textarea {
  font-size: .82rem;
  padding: .55rem .7rem;
}
.chat-form-box .custom-checkbox span { font-size: .72rem; }
.chat-form-submit {
  width: 100%;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: .7rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
  margin-top: .3rem;
}
.chat-form-submit:hover { background: var(--red-dark); }
.chat-form-error {
  color: var(--red-dark);
  font-size: .75rem;
  margin-bottom: .5rem;
  display: none;
}

.chat-panel-footer {
  flex-shrink: 0;
  padding: .55rem .9rem;
  text-align: center;
  font-size: .68rem;
  color: var(--text-muted);
  background: #fff;
  border-top: 1px solid rgba(0,0,0,0.06);
}

@media (max-width: 480px) {
  .chat-panel {
    right: .5rem;
    left: .5rem;
    bottom: calc(.5rem + var(--chat-consent-offset, 0px) + var(--nw-bar-offset, 0px));
    width: auto;
    height: calc(100vh - 5.5rem - var(--chat-consent-offset, 0px) - var(--nw-bar-offset, 0px));
  }
  /* 7. kör javítás (Karmester screenshot-review, 375px): a 62px-es FAB a sarokba húzva,
     kisebb méretben kevesebb form-mezőt/gombot takar el. A `.chat-hidden` osztályt a
     chat-widget.js kapcsolja be, amíg a látogató egy (chat-panelen KÍVÜLI) input/
     textarea/select mezőt fókuszál — ez a második védelmi vonal: amíg valaki gépel egy
     formba, a FAB átmenetileg teljesen eltűnik, utána visszajön. */
  .chat-bubble-btn {
    width: 48px;
    height: 48px;
    right: .6rem;
    bottom: calc(.6rem + var(--chat-consent-offset, 0px) + var(--nw-bar-offset, 0px));
  }
  .chat-bubble-btn svg { width: 22px; height: 22px; }
  .chat-bubble-btn .chat-bubble-dot { width: 10px; height: 10px; top: 4px; right: 4px; }

  /* 2026-10-05 — iOS Safari a 16px-nél kisebb input/textarea font-size-ra automatikusan
     rázoomol fókuszkor; a form 0.82rem (~13px) alapértéke ezt kiváltotta. Csak mobilon
     emelve 16px-re, a vizuális méret desktopon változatlan marad. */
  .chat-form-box input, .chat-form-box textarea { font-size: 16px; }
}

/* Figyelemfelhívó buborék + pulzálás (2026-10-05, Barni döntése: vizuális + halk hang) */
.chat-attention-tip {
  position: fixed;
  right: calc(1.5rem + 62px + .65rem);
  bottom: calc(1.5rem + var(--chat-consent-offset, 0px) + var(--nw-bar-offset, 0px) + 10px);
  z-index: 899;
  max-width: 230px;
  background: #fff;
  color: var(--dark, #1b1b1b);
  font-family: 'Poppins', sans-serif;
  font-size: .82rem;
  line-height: 1.4;
  padding: .65rem 1.9rem .65rem .85rem;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.18);
  animation: chatAttentionIn .3s ease forwards;
  cursor: pointer;
}
.chat-attention-tip::after {
  content: '';
  position: absolute;
  right: -7px;
  bottom: 22px;
  width: 0; height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 7px solid #fff;
}
.chat-attention-close {
  position: absolute;
  top: .3rem; right: .4rem;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: var(--text-muted, #8a8a8a);
  padding: .15rem .35rem;
}
.chat-attention-close:hover { color: var(--dark, #1b1b1b); }
@keyframes chatAttentionIn {
  from { opacity: 0; transform: translateY(6px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes chatBubblePulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(192,36,37,0.35), 0 0 0 0 rgba(192,36,37,0.45); }
  50% { box-shadow: 0 8px 24px rgba(192,36,37,0.35), 0 0 0 10px rgba(192,36,37,0); }
}
.chat-bubble-btn.chat-pulse { animation: chatBubblePulse 1.8s ease-out 4; }

@media (prefers-reduced-motion: reduce) {
  .chat-bubble-btn.chat-pulse { animation: none; }
  .chat-attention-tip { animation: none; }
  .chat-msg { animation: none; }
}

@media (max-width: 480px) {
  .chat-attention-tip {
    right: .6rem;
    left: .6rem;
    bottom: calc(.6rem + 48px + var(--chat-consent-offset, 0px) + var(--nw-bar-offset, 0px) + 10px);
    max-width: none;
  }
  .chat-attention-tip::after { display: none; }
}

/* ── AI-chat kiegészítők (2026-10-06) — javasolt-kérdés chipek, szabad-szöveg input-sor,
   nagy visszahívás-CTA, mode-tag. A .chat-panel-body/.chat-msg/.chat-form-box/.chat-typing
   alap-osztályokat a fenti szabályok adják — ez csak a plusz elemeket. */
.ai-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .2rem; }
.ai-chip {
  background: #fff; border: 1.5px solid var(--gold-dark, #b8860b); color: var(--gold-dark, #b8860b);
  font-family: 'Poppins', sans-serif; font-size: .78rem; font-weight: 600;
  padding: .45rem .7rem; border-radius: 999px; cursor: pointer; transition: background .15s, color .15s;
}
.ai-chip:hover { background: var(--gold, #dbab32); color: #fff; border-color: var(--gold, #dbab32); }

.ai-callback-cta {
  width: 100%; margin-top: .5rem;
  background: linear-gradient(135deg, var(--red, #c02425) 0%, var(--red-dark, #991d1e) 100%);
  color: #fff; border: none; border-radius: 10px; padding: .8rem;
  font-family: 'Poppins', sans-serif; font-weight: 700; font-size: .9rem; cursor: pointer;
  box-shadow: 0 4px 14px rgba(192,36,37,0.28); transition: transform .15s, box-shadow .15s;
}
.ai-callback-cta:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(192,36,37,0.38); }

.ai-input-row {
  flex-shrink: 0; display: flex; gap: .4rem; padding: .6rem .7rem;
  border-top: 1px solid rgba(0,0,0,0.06); background: #fff;
}
.ai-input-row input[type="text"] {
  flex: 1; font-family: 'Poppins', sans-serif; font-size: .84rem;
  padding: .55rem .7rem; border: 1.5px solid rgba(0,0,0,0.14); border-radius: 8px; outline: none;
}
.ai-input-row input[type="text"]:focus { border-color: var(--red, #c02425); }
/* iOS Safari 16px alatt rázoomol fókuszkor (lásd a .chat-form-box azonos javítását fent) */
@media (max-width: 480px) {
  .ai-input-row input[type="text"] { font-size: 16px; }
}
.ai-send-btn {
  background: var(--dark, #1b1b1b); color: #fff; border: none; border-radius: 8px;
  width: 40px; cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center;
}
.ai-send-btn:hover { background: #000; }
.ai-input-row.disabled { opacity: .5; pointer-events: none; }
.ai-charcount { font-size: .62rem; color: var(--text-muted, #8a8a8a); text-align: right; padding: 0 .8rem .2rem; background: #fff; }
.ai-disclaimer-note { font-size: .68rem; color: var(--text-muted, #8a8a8a); font-style: italic; }
.chat-panel-footer .ai-mode { color: var(--gold-dark, #b8860b); }

/* 2026-10-06 (2. kör): kattintható site-link az asszisztens válaszában + csendes "tanácsadóval beszélnék" link */
.chat-msg.bot a.ai-link { color: var(--red, #c02425); text-decoration: underline; word-break: break-word; }
.ai-human-row { padding: 0 1rem .25rem; text-align: left; }
.ai-human-link { background: none; border: 0; padding: .25rem 0; font: inherit; font-size: .78rem; color: var(--text-muted, #6b6b6b); text-decoration: underline; cursor: pointer; }
.ai-human-link:hover { color: var(--red, #c02425); }
