/* =========================================================
   THE HILLS LUX CLUB — AI Concierge chat widget
   Reuses design tokens from hologram.css (--gold, --serif, …).
   ========================================================= */

.thlc-chat {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: calc(clamp(1rem, 3vw, 2rem) + 4.6rem); /* clears the Concierge FAB */
  z-index: 90;
  width: min(380px, calc(100vw - 2rem));
  height: min(560px, calc(100vh - 8rem));
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(17,20,24,0.98), rgba(10,11,13,0.99));
  border: 1px solid var(--edge-hot);
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 40px rgba(231,207,148,0.10);
  -webkit-backdrop-filter: blur(12px);
          backdrop-filter: blur(12px);
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.thlc-chat.is-open { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- header ---------- */
.thlc-chat__head {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.95rem 1rem; border-bottom: 1px solid var(--edge);
}
.thlc-chat__dot { width: 7px; height: 7px; border-radius: 50%; background: #6fe39a; box-shadow: 0 0 10px #6fe39a; flex: 0 0 auto; }
.thlc-chat__id { display: flex; flex-direction: column; gap: 1px; margin-right: auto; }
.thlc-chat__name { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; letter-spacing: 0.06em; color: var(--ink); line-height: 1; }
.thlc-chat__sub { font-family: var(--mono); font-size: 0.5rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); }
.thlc-chat__close { all: unset; cursor: pointer; color: var(--muted); font-size: 1.3rem; line-height: 1; padding: 0.2rem 0.4rem; transition: color 0.3s var(--ease); }
.thlc-chat__close:hover, .thlc-chat__close:focus-visible { color: var(--gold-2); }

/* ---------- messages ---------- */
.thlc-chat__log {
  flex: 1; overflow-y: auto; padding: 1rem;
  display: flex; flex-direction: column; gap: 0.7rem;
  scrollbar-width: thin; scrollbar-color: var(--edge) transparent;
}
.thlc-chat__log::-webkit-scrollbar { width: 5px; }
.thlc-chat__log::-webkit-scrollbar-thumb { background: var(--edge); border-radius: 3px; }

.thlc-msg {
  max-width: 85%; padding: 0.6rem 0.85rem; font-size: 0.92rem; line-height: 1.5;
  white-space: pre-wrap; word-wrap: break-word; border: 1px solid transparent;
}
.thlc-msg--bot {
  align-self: flex-start; color: var(--ink);
  background: var(--glass); border-color: var(--edge);
  border-radius: 2px 14px 14px 14px;
}
.thlc-msg--user {
  align-self: flex-end; color: #1a1206;
  background: linear-gradient(105deg, var(--gold), var(--gold-2));
  border-radius: 14px 2px 14px 14px;
}
.thlc-msg--note {
  align-self: center; text-align: center; max-width: 100%;
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.04em;
  color: var(--faint); background: none;
}

/* typing indicator */
.thlc-typing { display: inline-flex; gap: 4px; align-items: center; }
.thlc-typing span { width: 5px; height: 5px; border-radius: 50%; background: var(--gold-2); opacity: 0.5; animation: thlcBlink 1.2s infinite ease-in-out; }
.thlc-typing span:nth-child(2) { animation-delay: 0.2s; }
.thlc-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes thlcBlink { 0%,80%,100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* ---------- footer / input ---------- */
.thlc-chat__foot { border-top: 1px solid var(--edge); padding: 0.7rem; }
.thlc-chat__row { display: flex; gap: 0.5rem; align-items: flex-end; }
.thlc-chat__input {
  flex: 1; resize: none; max-height: 96px; min-height: 22px;
  background: transparent; border: none; outline: none; color: var(--ink);
  font-family: var(--sans); font-weight: 300; font-size: 0.95rem; line-height: 1.4;
  padding: 0.5rem 0.2rem;
}
.thlc-chat__input::placeholder { color: var(--faint); }
.thlc-chat__send {
  all: unset; cursor: pointer; flex: 0 0 auto;
  width: 38px; height: 38px; display: grid; place-items: center;
  background: linear-gradient(105deg, var(--gold), var(--gold-2));
  color: #000; border-radius: 50%; transition: transform 0.25s var(--ease), box-shadow 0.3s var(--ease); }
.thlc-chat__send:hover, .thlc-chat__send:focus-visible { transform: scale(1.06); box-shadow: 0 0 18px rgba(231,207,148,0.5); }
.thlc-chat__send:disabled { opacity: 0.4; cursor: default; transform: none; box-shadow: none; }
.thlc-chat__send svg { width: 17px; height: 17px; display: block; }

.thlc-chat__cta {
  display: block; width: 100%; text-align: center; margin-top: 0.55rem;
  font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold-2); cursor: pointer; background: none; border: none; padding: 0.3rem;
  transition: color 0.3s var(--ease); }
.thlc-chat__cta:hover, .thlc-chat__cta:focus-visible { color: var(--ink); }

/* ---------- phones: full-height sheet ---------- */
@media (max-width: 560px) {
  .thlc-chat {
    right: 0; left: 0; bottom: 0;
    width: 100%; height: 88vh; height: 88dvh;
    border-left: none; border-right: none; border-bottom: none;
    border-radius: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .thlc-chat { transition: opacity 0.2s linear; transform: none; }
  .thlc-typing span { animation: none; opacity: 0.6; }
}
