/* =========================================================================
   CYRKIL EUROPE — LISA character-first AI experience (Section 9, 20.4, 23)
   ========================================================================= */

/* ---- Floating launcher: docked character, persists across navigation ---- */
.lisa-launcher {
  position: fixed; inset-block-end: var(--space-5); inset-inline-end: var(--space-5); z-index: 700;
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--color-brand-navy); border: 2px solid var(--color-brand-gold);
  box-shadow: var(--shadow-lg); display: flex; align-items: center; justify-content: center;
  transition: transform var(--motion-base) var(--ease-standard);
}
.lisa-launcher:hover { transform: scale(1.05); }
.lisa-launcher:focus-visible { transform: scale(1.05); }
.lisa-launcher .lisa-figure-mini { width: 42px; height: 42px; }
.lisa-launcher .pulse { position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--color-brand-gold); opacity: 0.6; animation: lisaPulse 2.6s ease-out infinite; }
@keyframes lisaPulse { 0% { transform: scale(1); opacity: 0.5; } 100% { transform: scale(1.35); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .lisa-launcher .pulse { animation: none; display: none; } }
@media (max-width: 767px) { .lisa-launcher { inset-block-end: calc(var(--space-5) + env(safe-area-inset-bottom, 0px)); width: 56px; height: 56px; } }

/* ---- LISA panel (sitewide floating stage, opens over content) ---- */
.lisa-panel-overlay { position: fixed; inset: 0; background: rgba(11,27,51,0.45); z-index: 800; display: none; }
.lisa-panel-overlay.is-open { display: block; }
.lisa-panel {
  position: fixed; inset-block: var(--space-5); inset-inline-end: var(--space-5); z-index: 810;
  width: min(420px, calc(100vw - 2 * var(--space-5))); background: var(--color-brand-navy); color: #fff;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  overflow-x: hidden; overflow-y: auto;
  /* The panel's own fixed height doesn't grow with the conversation (more
     suggested buttons, a longer answer) — it needs to scroll as a whole
     rather than clip whatever doesn't fit, since no single child inside is
     set up as an independent scroll region for the full stage. */
}
@media (max-width: 767px) {
  .lisa-panel { inset: 0; width: 100%; border-radius: 0; }
}

/* ---- Full stage (dedicated LISA page + expanded panel): character-first ---- */
.lisa-stage { background: var(--color-brand-navy); color: #fff; border-radius: var(--radius-lg); overflow: hidden; }
.lisa-stage-head { display: flex; align-items: center; justify-content: space-between; padding: var(--space-4) var(--space-5); border-block-end: 1px solid rgba(255,255,255,0.08); }
/* One centered column — avatar, then the full-width conversation, then any
   contextual card below it. (Previously a two-column grid with the card
   beside the conversation; on the bigger avatar that column combination
   didn't fit some viewports and pushed the card off-screen, so this is a
   single flow that can't overflow sideways, and gives the transcript the
   full available width instead of squeezing it into a narrow side column.) */
.lisa-stage-body { display: flex; flex-direction: column; align-items: center; gap: var(--space-5); padding: var(--space-6); max-width: 760px; margin-inline: auto; }
.lisa-stage-body > * { width: 100%; }

.lisa-figure-wrap { text-align: center; }
.lisa-figure {
  width: 220px; height: 244px; margin-inline: auto; position: relative;
}
.lisa-figure svg { width: 100%; height: 100%; }
.lisa-figure-mini svg { width: 100%; height: 100%; }
/* Big presentation: the dedicated LISA page and the launcher's full stage. */
.lisa-figure-lg { width: 300px; height: 332px; }
@media (min-width: 1280px) { .lisa-figure-lg { width: 340px; height: 377px; } }
/* Small teaser: the homepage "Meet LISA" intro card. */
.lisa-figure-sm { width: 150px; height: 166px; }
.lisa-name-tag { margin-block-start: var(--space-3); font-weight: 700; }

/* ---- LISA's photo avatar: one portrait crop reused at every scale, framed
   in a soft rounded card rather than the launcher's plain circle so the
   embroidered "LISA" name tag on the jacket stays visible at the bigger
   sizes. State (idle/listening/thinking/speaking) is shown as a ring/glow
   around the frame, driven by [data-lisa-state] set from main.js — a still
   photo can't lip-sync, so the state badge text carries the rest. ---- */
.lisa-photo {
  position: relative; width: 100%; height: 100%; border-radius: var(--radius-lg);
  overflow: hidden; background: radial-gradient(circle at 50% 30%, var(--color-brand-navy-2), var(--color-brand-navy) 75%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.lisa-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 14%; display: block; }
.lisa-photo-ring {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 2px rgba(201,162,39,0.5); transition: box-shadow var(--motion-base) var(--ease-standard);
}
.lisa-photo[data-lisa-state="listening"] .lisa-photo-ring { box-shadow: inset 0 0 0 2px var(--color-brand-blue-light), 0 0 22px 1px rgba(91,155,255,0.45); }
.lisa-photo[data-lisa-state="thinking"] .lisa-photo-ring { box-shadow: inset 0 0 0 2px var(--color-brand-gold); animation: lisaRingPulse 1.1s ease-in-out infinite; }
.lisa-photo[data-lisa-state="speaking"] .lisa-photo-ring { box-shadow: inset 0 0 0 2px var(--color-brand-blue-light), 0 0 26px 3px rgba(91,155,255,0.55); animation: lisaRingPulse 0.65s ease-in-out infinite; }
@keyframes lisaRingPulse { 0%, 100% { opacity: 0.75; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .lisa-photo[data-lisa-state] .lisa-photo-ring { animation: none; } }

/* Launcher's small round bust: same photo, circular crop, tight on the face. */
.lisa-figure-mini { display: block; }
.lisa-figure-mini .lisa-photo { border-radius: 50%; }
.lisa-figure-mini .lisa-photo img { object-position: center 8%; }
.lisa-figure-mini .lisa-photo-ring { box-shadow: inset 0 0 0 1px rgba(201,162,39,0.6); }
.lisa-disclosure-pill {
  display: inline-flex; align-items: center; gap: 6px; margin-block-start: 6px;
  padding: 4px 12px; border-radius: var(--radius-pill); background: rgba(255,255,255,0.1);
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-brand-gold-light);
}

.lisa-state-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; background: rgba(255,255,255,0.1); }
.lisa-state-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-state-success); }
.lisa-state-badge.thinking .dot { background: var(--color-brand-gold); animation: dotPulse 1s ease-in-out infinite; }
.lisa-state-badge.speaking .dot { background: var(--color-brand-gold); }
@keyframes dotPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

.lisa-bubble { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-lg); padding: var(--space-3) var(--space-4); font-size: 14px; max-width: min(480px, 100%); margin-inline: 0 auto; }
.lisa-bubble.user { background: rgba(30,111,235,0.18); margin-inline: auto 0; text-align: end; }

[data-lisa-card-slot] { display: flex; justify-content: center; }
.lisa-contextual-card { width: 100%; max-width: 420px; margin-inline: auto; }

.lisa-captions { background: rgba(255,255,255,0.04); border-block-start: 1px solid rgba(255,255,255,0.08); padding: var(--space-4) var(--space-5); }
.lisa-captions-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-brand-gold-light); font-weight: 700; margin-block-end: 4px; }
.lisa-captions-text { font-size: 14px; color: rgba(255,255,255,0.9); min-height: 1.5em; }

.lisa-controls { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: var(--space-4) var(--space-5); border-block-start: 1px solid rgba(255,255,255,0.08); }

.lisa-suggested { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: 0 var(--space-5) var(--space-4); }
.lisa-suggested button { border: 1px solid rgba(255,255,255,0.25); border-radius: var(--radius-pill); padding: 8px 14px; font-size: 13px; color: #fff; }
.lisa-suggested button:hover { border-color: var(--color-brand-gold); color: var(--color-brand-gold-light); }

.lisa-input-bar { display: flex; gap: var(--space-2); padding: var(--space-4) var(--space-5); border-block-start: 1px solid rgba(255,255,255,0.08); }
.lisa-input-bar input { flex: 1; min-height: 44px; border-radius: var(--radius-pill); border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.06); color: #fff; padding-inline: var(--space-4); font-size: 15px; }
.lisa-input-bar input::placeholder { color: rgba(255,255,255,0.4); }
.lisa-input-bar input:focus { outline: none; box-shadow: var(--shadow-focus-dark); }
.lisa-send { width: 44px; height: 44px; border-radius: 50%; background: var(--color-brand-gold); color: var(--color-brand-navy); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
[dir="rtl"] .lisa-send svg { transform: scaleX(-1); }

.lisa-transcript { min-height: 96px; max-height: min(55vh, 460px); overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4) var(--space-5); }

.lisa-not-legal-advice { margin: 0 var(--space-5) var(--space-4); }

.lisa-mini-preview {
  display: grid; grid-template-columns: 1fr auto; gap: var(--space-5); align-items: center;
  background: var(--color-brand-navy-2); border-radius: var(--radius-lg); padding: var(--space-6);
}
@media (max-width: 1023px) { .lisa-mini-preview { grid-template-columns: 1fr; text-align: center; } }

/* Character construction — shared across launcher / mini / contextual / full stage, one rigged illustration scaled (Section 23.1/Figure 22) */
.lisa-svg-hood { fill: var(--color-brand-navy); }
.lisa-svg-face { fill: var(--color-brand-gold); }
.lisa-svg-collar { fill: var(--color-brand-gold-light); }
.lisa-svg-outline { stroke: var(--color-brand-gold); fill: none; }
.lisa-mouth { transition: all var(--motion-fast) var(--ease-standard); }
.lisa-eye { transition: all var(--motion-fast) var(--ease-standard); }

.lisa-idle-pulse { animation: lisaBreathe 3.6s ease-in-out infinite; transform-origin: center bottom; }
@keyframes lisaBreathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.015); } }
@media (prefers-reduced-motion: reduce) { .lisa-idle-pulse { animation: none; } }

/* Kill-switch state */
.lisa-offline { text-align: center; padding: var(--space-6); }

/* Mobile full-screen takeover */
@media (max-width: 767px) {
  .lisa-stage-body { padding: var(--space-4); gap: var(--space-4); }
  .lisa-figure { width: 140px; height: 150px; }
  .lisa-figure-lg { width: 220px; height: 244px; }
}
