/* =====================================================================
   Liora Diamond — chat widget
   Kept in its own file so nothing here can collide with style.css.
   Uses the existing design tokens (--navy, --gold, --cream ...) so it
   inherits the site's palette automatically if those ever change.
   ===================================================================== */

.liora-chat { position: fixed; right: 1.75rem; bottom: 1.75rem; z-index: 9999; font-family: var(--font-body, Inter, system-ui, sans-serif); }

/* ---------- Launcher ---------- */
.lc-launcher {
  position: relative; width: 58px; height: 58px; border: 0; cursor: pointer;
  border-radius: 50%; background: #25D366; color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 24px rgba(37,211,102,0.42);
  transition: transform .22s ease, box-shadow .22s ease, background .22s ease;
}
.lc-launcher:hover { transform: scale(1.07); box-shadow: 0 8px 30px rgba(37,211,102,0.58); }
.lc-launcher-icon { display: flex; position: absolute; transition: opacity .18s ease, transform .18s ease; }
.lc-icon-close { opacity: 0; transform: rotate(-45deg) scale(.7); }
.liora-chat.is-open .lc-launcher { background: var(--navy, #0D1B2A); box-shadow: 0 6px 24px rgba(13,27,42,.4); }
.liora-chat.is-open .lc-icon-chat { opacity: 0; transform: scale(.7); }
.liora-chat.is-open .lc-icon-close { opacity: 1; transform: rotate(0) scale(1); }

/* Soft attention pulse — stops permanently once the widget has been opened. */
.lc-launcher::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid #25D366; animation: lc-pulse 2.4s ease-out infinite;
}
.liora-chat.is-open .lc-launcher::after,
.liora-chat.is-seen .lc-launcher::after { display: none; }
@keyframes lc-pulse { 0% { transform: scale(1); opacity: .7 } 70% { transform: scale(1.5); opacity: 0 } 100% { opacity: 0 } }

.lc-badge {
  position: absolute; top: -3px; right: -3px; min-width: 19px; height: 19px;
  border-radius: 10px; background: var(--gold, #C9973A); color: #fff;
  font-size: .68rem; font-weight: 700; line-height: 19px; text-align: center;
  border: 2px solid #fff; padding: 0 3px;
}
.liora-chat.is-open .lc-badge, .liora-chat.is-seen .lc-badge { display: none; }

/* ---------- Proactive nudge ---------- */
.lc-nudge {
  position: absolute; right: 72px; bottom: 6px; width: 236px;
  background: #fff; border: 1px solid var(--border, #E5E0D8);
  border-radius: 12px 12px 2px 12px; padding: .8rem .9rem;
  box-shadow: 0 8px 32px rgba(13,27,42,.16);
  animation: lc-rise .32s ease both;
}
.lc-nudge-text { margin: 0; font-size: .82rem; line-height: 1.5; color: var(--charcoal, #2C3E50); }
.lc-nudge-close {
  position: absolute; top: 2px; right: 6px; border: 0; background: none;
  font-size: 1.05rem; line-height: 1; color: var(--muted, #6B7280); cursor: pointer; padding: 2px;
}
@keyframes lc-rise { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }

/* ---------- Panel ---------- */
.lc-panel {
  position: absolute; right: 0; bottom: 74px; width: 348px;
  max-height: min(560px, calc(100vh - 120px));
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border-radius: 14px;
  border: 1px solid var(--border, #E5E0D8);
  box-shadow: 0 18px 56px rgba(13,27,42,.24);
  animation: lc-rise .26s ease both;
}
.lc-panel[hidden] { display: none; }

.lc-head {
  display: flex; align-items: center; gap: .7rem; padding: .85rem 1rem;
  background: var(--navy, #0D1B2A); color: #fff; flex-shrink: 0;
}
.lc-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: var(--gold, #C9973A); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display, Georgia, serif); font-size: 1.15rem; font-weight: 700;
}
.lc-head-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.lc-head-text strong { font-size: .875rem; font-weight: 600; }
.lc-status { font-size: .72rem; color: rgba(255,255,255,.66); display: flex; align-items: center; gap: .35rem; }
.lc-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; display: inline-block; }
.lc-min { margin-left: auto; background: none; border: 0; color: rgba(255,255,255,.6); cursor: pointer; padding: 4px; display: flex; }
.lc-min:hover { color: #fff; }

/* ---------- Message area ---------- */
.lc-body {
  flex: 1; overflow-y: auto; padding: 1rem; background: var(--cream, #FAF8F4);
  display: flex; flex-direction: column; gap: .6rem;
}
.lc-msg { max-width: 84%; padding: .6rem .8rem; font-size: .84rem; line-height: 1.55; border-radius: 12px; animation: lc-rise .24s ease both; }
.lc-msg-bot  { align-self: flex-start; background: #fff; color: var(--charcoal, #2C3E50); border: 1px solid var(--border, #E5E0D8); border-bottom-left-radius: 3px; }
.lc-msg-user { align-self: flex-end;  background: var(--navy, #0D1B2A); color: #fff; border-bottom-right-radius: 3px; }
.lc-typing { display: flex; gap: 4px; align-items: center; padding: .7rem .85rem; }
.lc-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted, #6B7280); opacity: .45; animation: lc-blink 1.2s infinite; }
.lc-typing i:nth-child(2) { animation-delay: .18s }
.lc-typing i:nth-child(3) { animation-delay: .36s }
@keyframes lc-blink { 0%,60%,100% { opacity: .25 } 30% { opacity: .9 } }

/* ---------- Footer / steps ---------- */
.lc-foot { flex-shrink: 0; padding: .85rem 1rem 1rem; background: #fff; border-top: 1px solid var(--border, #E5E0D8); }
.lc-step[hidden] { display: none; }

.lc-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.lc-chip {
  border: 1px solid var(--gold, #C9973A); background: #fff; color: var(--navy, #0D1B2A);
  border-radius: 100px; padding: .42rem .8rem; font-size: .78rem; font-weight: 500;
  cursor: pointer; transition: background .18s ease, color .18s ease;
  font-family: inherit;
}
.lc-chip:hover { background: var(--gold, #C9973A); color: #fff; }

.lc-label { display: block; font-size: .72rem; font-weight: 600; color: var(--navy, #0D1B2A); margin: .55rem 0 .25rem; }
.lc-opt { font-weight: 400; color: var(--muted, #6B7280); }
.lc-input {
  width: 100%; border: 1px solid var(--border, #E5E0D8); border-radius: 6px;
  padding: .55rem .65rem; font-size: .84rem; font-family: inherit; color: var(--charcoal, #2C3E50);
  background: #fff; resize: vertical;
}
.lc-input:focus { outline: 2px solid var(--gold, #C9973A); outline-offset: 1px; border-color: var(--gold, #C9973A); }

.lc-send {
  display: block; width: 100%; margin-top: .7rem; border: 0; cursor: pointer;
  background: #25D366; color: #fff; border-radius: 6px; padding: .65rem;
  font-size: .85rem; font-weight: 600; font-family: inherit; text-align: center;
  transition: filter .18s ease;
}
.lc-send:hover { filter: brightness(1.06); }
.lc-send:disabled { opacity: .6; cursor: default; }

.lc-err { margin: .5rem 0 0; font-size: .78rem; color: var(--red, #C0392B); }
.lc-fine { margin: .55rem 0 0; font-size: .68rem; line-height: 1.5; color: var(--muted, #6B7280); }
.lc-fine a { color: var(--gold, #C9973A); text-decoration: underline; }

.lc-skip {
  display: block; width: 100%; margin-top: .6rem; border: 0; background: none;
  color: var(--muted, #6B7280); font-size: .72rem; font-family: inherit;
  cursor: pointer; text-decoration: underline; padding: .2rem;
}
.lc-skip:hover { color: var(--navy, #0D1B2A); }

/* ---------- Mobile ---------- */
@media (max-width: 460px) {
  .liora-chat { right: 1rem; bottom: 1rem; }
  .lc-panel {
    position: fixed; left: 0; right: 0; bottom: 0; width: 100%;
    max-height: 86vh; border-radius: 14px 14px 0 0; border-left: 0; border-right: 0; border-bottom: 0;
  }
  .lc-nudge { right: 70px; width: min(220px, calc(100vw - 110px)); }
}

/* Respect reduced-motion preferences. */
@media (prefers-reduced-motion: reduce) {
  .lc-launcher::after, .lc-typing i { animation: none; }
  .lc-panel, .lc-msg, .lc-nudge { animation: none; }
}
