/* Golden Lotus Grand - giao diện trợ lý du lịch.
   Một accent (xanh biển), một hệ bo góc (--r), sáng/tối theo hệ thống. */

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("https://cdn.jsdelivr.net/npm/@fontsource-variable/geist@5/files/geist-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("https://cdn.jsdelivr.net/npm/@fontsource-variable/geist@5/files/geist-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #f2f6f6;
  --surface: #ffffff;
  --ink: #12201f;
  --muted: #566866;
  --line: #d9e3e2;
  --accent: #0f6f6c;
  --accent-ink: #ffffff;
  --accent-soft: #e1f0ef;
  --danger: #b42318;
  --shadow: 0 1px 2px rgba(18, 48, 46, .06), 0 8px 24px -12px rgba(18, 48, 46, .18);
  --r: 14px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --font: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1514;
    --surface: #121f1e;
    --ink: #e8f0ef;
    --muted: #94a9a7;
    --line: #243736;
    --accent: #4fc2bd;
    --accent-ink: #062321;
    --accent-soft: #14312f;
    --danger: #ff8a7a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, textarea { font: inherit; color: inherit; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- layout ---------- */
.app {
  min-height: 100dvh;
  height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}

/* ---------- hero (cột trái) ---------- */
.hero { position: relative; overflow: hidden; isolation: isolate; background: linear-gradient(160deg, #0f4d4b, #0b2f3a); color: #fff; min-height: 0; }
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero__scrim { position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(6, 22, 22, .88) 8%, rgba(6, 22, 22, .35) 55%, rgba(6, 22, 22, .15)); }
.hero__body { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 14px; padding: 40px; max-width: 520px; }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: auto; }
.brand__mark { width: 34px; height: 34px; border-radius: var(--r); background: #fff; color: #0f4d4b; display: grid; place-items: center; font-weight: 700; font-size: 13px; letter-spacing: .02em; }
.brand__name { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.hero__title { margin: 0; font-size: clamp(28px, 3.2vw, 42px); line-height: 1.1; letter-spacing: -.03em; font-weight: 650; text-wrap: balance; }
.hero__text { margin: 0; max-width: 40ch; color: rgba(255, 255, 255, .86); }
.hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 6px; }
.hero__addr { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 13px; color: rgba(255, 255, 255, .78); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: var(--r); border: 0; font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; cursor: pointer; transition: transform .2s var(--ease), background-color .2s; }
.btn--light { background: #fff; color: #0b2f2d; }
.btn--light:hover { background: #e8f3f2; }
.btn--ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); height: 34px; padding: 0 12px; font-size: 13px; }
.btn--ghost:hover { background: var(--accent-soft); }
.btn:active, .send:active, .icon-btn:active { transform: translateY(1px) scale(.98); }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-size: 18px; transition: background-color .2s, transform .2s var(--ease); }
.icon-btn:hover { background: var(--accent-soft); }

/* ---------- chat (cột phải) ---------- */
.chat { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg); }
.chat__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 28px; border-bottom: 1px solid var(--line); }
.chat__title h2 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.chat__title p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }

.chat__scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 28px; scroll-behavior: smooth; }
.chat__scroll > * { max-width: 720px; margin-inline: auto; }

/* welcome */
.welcome { padding-top: 4px; }
.welcome__lead { margin: 0 0 18px; font-size: 20px; line-height: 1.35; letter-spacing: -.02em; font-weight: 550; max-width: 30ch; text-wrap: balance; }

/* messages */
.log { display: flex; flex-direction: column; gap: 18px; }
.msg { display: flex; flex-direction: column; gap: 10px; max-width: 86%; animation: rise .35s var(--ease) both; }
.msg--user { align-self: flex-end; align-items: flex-end; }
.msg--bot { align-self: flex-start; align-items: flex-start; width: 100%; max-width: 100%; }
.bubble { padding: 11px 15px; border-radius: var(--r); overflow-wrap: anywhere; }
.msg--user .bubble { background: var(--accent); color: var(--accent-ink); white-space: pre-wrap; border-bottom-right-radius: 4px; }
.msg--bot .bubble { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-top-left-radius: 4px; max-width: min(620px, 100%); }
.msg--error .bubble { border-color: var(--danger); }
.bubble:empty { display: none; }

.bubble p { margin: 0; }
.bubble p + p, .bubble p + ul, .bubble p + ol, .bubble ul + p, .bubble ol + p { margin-top: 9px; }
.bubble ul, .bubble ol { margin: 0; padding-left: 20px; display: grid; gap: 5px; }
.bubble li::marker { color: var(--accent); }
.bubble strong { font-weight: 650; }

.retry { margin-top: 2px; }

/* skeleton khi chờ phản hồi */
.skeleton { width: min(420px, 100%); padding: 14px 15px; display: grid; gap: 9px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); border-top-left-radius: 4px; }
.skeleton i { display: block; height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--line) 25%, var(--accent-soft) 50%, var(--line) 75%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
.skeleton i:nth-child(1) { width: 92%; } .skeleton i:nth-child(2) { width: 76%; } .skeleton i:nth-child(3) { width: 54%; }

/* khối giá */
.price { width: min(620px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.price__head { display: grid; gap: 2px; padding: 14px 16px 10px; }
.price__head strong { font-weight: 650; letter-spacing: -.01em; }
.price__head span { font-size: 13px; color: var(--muted); }
.price__table { width: 100%; border-collapse: separate; border-spacing: 0 4px; padding: 0 8px; font-variant-numeric: tabular-nums; }
.price__table th, .price__table td { padding: 9px 8px; text-align: right; font-weight: 500; vertical-align: top; }
.price__table thead th { font-size: 12px; color: var(--muted); font-weight: 500; padding-bottom: 2px; }
.price__table th:first-child { text-align: left; }
.price__table tbody th { font-weight: 600; }
.price__table small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.price__table tr.is-lowest > * { background: var(--accent-soft); }
.price__table tr.is-lowest > :first-child { border-radius: var(--r) 0 0 var(--r); }
.price__table tr.is-lowest > :last-child { border-radius: 0 var(--r) var(--r) 0; }
.price__table tr.is-lowest small { color: var(--accent); }
.price__table tr.is-lowest td:last-child { font-weight: 650; }
.price__foot { padding: 8px 16px 14px; display: grid; gap: 6px; }
.price__foot p { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.price__foot .price__time { font-size: 12px; }

/* thư viện ảnh */
.gallery { display: flex; gap: 10px; width: 100%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.shot { flex: 0 0 min(220px, 64%); scroll-snap-align: start; margin: 0; }
.shot button { display: block; width: 100%; padding: 0; border: 0; background: var(--accent-soft); border-radius: var(--r); overflow: hidden; aspect-ratio: 4 / 3; cursor: zoom-in; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease); }
.shot button:hover img { transform: scale(1.05); }
.shot figcaption { margin-top: 6px; font-size: 12.5px; color: var(--muted); }

/* composer */
.composer { display: flex; align-items: flex-end; gap: 10px; padding: 14px 28px calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
.composer textarea { flex: 1; min-width: 0; resize: none; max-height: 140px; padding: 11px 15px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); outline: none; line-height: 1.45; transition: border-color .2s, box-shadow .2s; }
.composer textarea::placeholder { color: var(--muted); opacity: .9; }
.composer textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.send { flex: none; width: 46px; height: 46px; border: 0; border-radius: var(--r); background: var(--accent); color: var(--accent-ink); font-size: 20px; display: grid; place-items: center; cursor: pointer; transition: transform .2s var(--ease), opacity .2s; }
.send:disabled { opacity: .45; cursor: not-allowed; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 20; display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; gap: 8px; padding: 20px; background: rgba(5, 14, 14, .92); animation: fade .2s ease both; }
.lightbox__fig { margin: 0; display: grid; justify-items: center; gap: 10px; min-width: 0; }
.lightbox__fig img { max-width: 100%; max-height: 80dvh; border-radius: var(--r); object-fit: contain; }
.lightbox__fig figcaption { color: #fff; font-size: 14px; }
.lightbox__close { position: absolute; top: 16px; right: 16px; }
.lightbox .icon-btn { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .25); color: #fff; }
.lightbox .icon-btn:hover { background: rgba(255, 255, 255, .24); }
.lightbox__nav--prev { justify-self: start; } .lightbox__nav--next { justify-self: end; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes shimmer { to { background-position: -300% 0; } }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .hero { min-height: 0; }
  .hero__body { padding: 16px 18px; gap: 8px; max-width: none; justify-content: flex-start; }
  .brand { margin-bottom: 0; }
  .hero__title { font-size: 20px; }
  .hero__text, .hero__meta { display: none; }
  .hero { height: 132px; }
  .chat__head { padding: 12px 18px; }
  .chat__scroll { padding: 18px; }
  .composer { padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); }
  .welcome__lead { font-size: 18px; }
  .msg { max-width: 92%; }
  .lightbox { grid-template-columns: 1fr; padding: 12px; }
  .lightbox__nav { position: absolute; bottom: 20px; }
  .lightbox__nav--prev { left: 20px; } .lightbox__nav--next { right: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
