/* =========================================================
   ReelOmni v1.3 — components.css (FINAL)
   Depends on tokens.css → foundation.css → base.css
   Purpose: all component-level styles used by investor-demo
   ========================================================= */

/* ---------- Utilities ---------- */
.inline { display:flex; align-items:center; gap:.6rem; }
.stack > * + * { margin-top: .75rem; }
.sr-only {
  position:absolute !important; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0;
}
.icon-btn {
  display:grid; place-items:center; width:36px; height:36px;
  border:1px solid var(--line); border-radius:8px; background:transparent; color:var(--text);
  cursor:pointer; transition:background .2s, transform .15s;
}
.icon-btn:hover { background: var(--surface-2); transform: translateY(-1px); }

/* ---------- Ambient background ---------- */
.ambient-bg {
  position:fixed; inset:-10vh -10vw; z-index:-1;
  background:
    radial-gradient(60vw 60vw at 10% 10%, rgba(255,215,120,.08), transparent 60%),
    radial-gradient(60vw 60vw at 90% 20%, rgba(255,0,80,.06), transparent 60%),
    radial-gradient(70vw 60vw at 50% 120%, rgba(220,220,255,.06), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  filter:saturate(105%);
}

/* ---------- Header / Navigation ---------- */
.demo-header {
  position:sticky; top:0; z-index:50; backdrop-filter:saturate(140%) blur(8px);
  background: color-mix(in oklab, var(--bg), transparent 12%);
  border-bottom:1px solid var(--line);
}
.demo-header .container { display:flex; align-items:center; justify-content:space-between; padding:.8rem 0; }
.nav-row .brand { display:flex; align-items:center; gap:.75rem; text-decoration:none; }
#nav { display:flex; gap:1rem; }
#nav a { color:var(--muted); padding:.4rem .6rem; border-radius:8px; text-decoration:none; }
#nav a[aria-current="page"] { color:var(--text); background:var(--surface-2); }
.nav-actions .pill { border:1px solid var(--line); border-radius:999px; padding:.4rem .8rem; background:transparent; }
.nav-toggle { display:none; }

@media (max-width: 960px){
  .nav-toggle { display:inline-grid; }
  body.nav--open #nav { display:block; }
  #nav { position:absolute; left:0; right:0; top:60px; background:var(--bg); border-bottom:1px solid var(--line); display:none; padding:.6rem .8rem; }
  #nav li { display:inline-block; margin:.25rem; }
}

/* ---------- Sections, Grid, Cards ---------- */
.section { padding:64px 0; border-top:1px solid var(--line); }
.section--alt { background: var(--surface-1); }
.container { width:min(1100px, 92vw); margin:0 auto; }
.head { display:flex; align-items:baseline; justify-content:space-between; gap:1rem; margin-bottom:1rem; }
.grid { display:grid; gap:1rem; }
.grid.cols-2 { grid-template-columns: repeat(2,minmax(0,1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3,minmax(0,1fr)); }
@media (max-width: 960px){ .grid.cols-3 { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 640px){ .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border:1px solid var(--line); border-radius:14px;
  padding: .9rem; box-shadow: 0 1px 0 rgba(0,0,0,.06);
}
.card--loose { padding:1.1rem 1.1rem; }
.card--tight { padding:.7rem .8rem; }
.card--glass {
  background: color-mix(in oklab, var(--surface), transparent 30%);
  backdrop-filter: blur(6px) saturate(130%);
}

/* ---------- Buttons, Pills, Badges ---------- */
.btn {
  --_pad-y:.5rem; --_pad-x:.9rem;
  display:inline-flex; align-items:center; gap:.45rem; cursor:pointer;
  border:1px solid var(--line); border-radius:10px; padding:var(--_pad-y) var(--_pad-x);
  background:var(--surface); color:var(--text); text-decoration:none; font-weight:600;
  transition:background .2s, transform .12s, border-color .2s, box-shadow .2s;
}
.btn:hover { background:var(--surface-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--lg { --_pad-y:.65rem; --_pad-x:1.1rem; font-size:1.05rem; border-radius:12px; }
.btn--sm { --_pad-y:.3rem; --_pad-x:.6rem; font-size:.9rem; }
.btn--ghost { background:transparent; }
.btn--outline { background:transparent; border-style:dashed; }
.btn--shine {
  background:linear-gradient(90deg, var(--gold) 0%, #f2d997 50%, var(--gold) 100%);
  color:#1b1406; border-color: color-mix(in oklab, var(--gold), #000 35%);
  box-shadow: 0 6px 18px rgba(255,215,120,.22);
}
.pill { @apply .btn; /* semantic: .pill behaves like btn */ }
.badge {
  display:inline-flex; align-items:center; gap:.35rem; font-size:.78rem;
  border:1px solid var(--line); padding:.15rem .5rem; border-radius:999px; background:var(--surface);
}
.badge--gold { background: color-mix(in oklab, var(--gold), white 85%); color:#573f06; border-color: color-mix(in oklab, var(--gold), #000 35%); }
.badge--red  { background: color-mix(in oklab, var(--red), white 85%); color:#4f0b0b; border-color: color-mix(in oklab, var(--red), #000 35%); }

/* ---------- Hero / Slides ---------- */
.hero-wrap { position:relative; min-height:68vh; isolation:isolate; }
.slides { position:absolute; inset:0; overflow:hidden; border-bottom:1px solid var(--line); }
.slide { position:absolute; inset:0; opacity:0; transition:opacity .6s ease; }
.slide.active { opacity:1; }
.slide img { width:100%; height:100%; object-fit:cover; filter:contrast(1.02) saturate(1.05); }
.hero-overlay {
  position:relative; z-index:1; min-height:68vh; display:grid; place-items:center;
  background:linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.35));
}
.hero-text { text-align:center; }
.hero-title { font-size: clamp(1.8rem, 1.3rem + 2.2vw, 3rem); letter-spacing:.3px; }
.hero-sub { max-width:62ch; margin-inline:auto; }
.hero-cta { margin-top: .9rem; display:flex; gap:.6rem; justify-content:center; flex-wrap:wrap; }

.dots {
  position:absolute; left:50%; transform:translateX(-50%); bottom:14px; display:flex; gap:.45rem; z-index:2;
}
.dot { width:9px; height:9px; border-radius:50%; border:1px solid var(--line); background:var(--surface); opacity:.7; }
.dot.active { background: var(--gold); border-color: color-mix(in oklab, var(--gold), #000 35%); opacity:1; }

/* ---------- Marquee ---------- */
.marquee { overflow:hidden; border-top:1px dashed var(--line); border-bottom:1px dashed var(--line); }
.marquee__track {
  display:flex; gap:2.2rem; padding:.7rem 0; white-space:nowrap; will-change: transform;
  animation: marquee 28s linear infinite;
}
.marquee__item { opacity:.8; }
@keyframes marquee {
  from { transform: translateX(0); } to { transform: translateX(-50%); }
}

/* ---------- Timeline ---------- */
.timeline { padding-left:1.25rem; border-left:2px solid var(--line); display:grid; gap:.5rem; }
.timeline li { list-style:none; }

/* ---------- Progress ---------- */
.progress {
  position:relative; height:10px; border:1px solid var(--line); border-radius:999px; background:var(--surface);
}
.progress__bar {
  height:100%; border-radius:999px;
  background:linear-gradient(90deg, var(--gold), #f2d997 60%, var(--gold));
  box-shadow: inset 0 0 6px rgba(0,0,0,.15);
}

/* ---------- Tabs ---------- */
.tabs { margin-top:.6rem; }
.tablist { display:flex; gap:.5rem; flex-wrap:wrap; margin-bottom:.6rem; }
.tab {
  border:1px solid var(--line); background:var(--surface); border-radius:8px; padding:.4rem .7rem; cursor:pointer;
}
.tab[aria-selected="true"] { background: var(--surface-2); color: var(--text-strong); }

/* ---------- Tables ---------- */
.table-wrap { overflow:auto; }
.table { width:100%; border-collapse:separate; border-spacing:0; }
.table th, .table td { padding:.6rem .7rem; border-bottom:1px solid var(--line); text-align:left; }
.table thead th { background:var(--surface-2); position:sticky; top:0; }

/* ---------- Cards with media ---------- */
.card-media { display:grid; grid-template-columns: 120px 1fr; gap:1rem; align-items:center; }
.card-media .thumb {
  width:120px; height:120px; border-radius:12px; background-size:cover; background-position:center;
  box-shadow: inset 0 0 0 1px var(--line);
}
@media (max-width: 520px){
  .card-media { grid-template-columns: 1fr; }
  .card-media .thumb { width:100%; height:180px; }
}

/* ---------- Forms ---------- */
.field label { display:block; font-weight:600; margin-bottom:.35rem; }
.field input, .field textarea, .field select {
  width:100%; padding:.6rem .7rem; border:1px solid var(--line); border-radius:10px; background:var(--surface);
}
.switch { display:inline-flex; align-items:center; gap:.45rem; cursor:pointer; }
.switch input { accent-color: var(--gold); }

/* ---------- Modals ---------- */
.modal { border:none; border-radius:14px; padding:0; background:var(--surface); color:var(--text); width:min(720px, 92vw); box-shadow: 0 20px 70px rgba(0,0,0,.45); }
.modal::backdrop { background: rgba(0,0,0,.55); backdrop-filter: blur(2px); }
.modal-head { display:flex; align-items:center; justify-content:space-between; gap:.8rem; padding: .9rem 1rem; border-bottom:1px solid var(--line); background:var(--surface-1); }
.modal-body { padding: 1rem; display:block; }
.modal-actions { padding: .9rem 1rem; border-top:1px dashed var(--line); display:flex; gap:.6rem; justify-content:flex-end; }

/* ---------- Valet Trash modal enhancements ---------- */
.valet-trash .omnibot-avatar {
  width:28px; height:28px; border-radius:50%; background:linear-gradient(135deg, var(--gold), #f2d997);
  display:grid; place-items:center; color:#1b1406; font-weight:800; box-shadow:0 0 0 1px color-mix(in oklab, var(--gold), #000 35%);
}
.plan-cards { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:.6rem; margin-top:.4rem; }
.plan {
  display:block; cursor:pointer; border-radius:12px; border:1px solid var(--line); overflow:hidden; background:var(--surface);
}
.plan input { display:none; }
.plan-body { display:block; padding:.7rem .8rem; }
.plan input:checked + .plan-body {
  background: color-mix(in oklab, var(--gold), var(--surface) 90%);
  border-left:4px solid color-mix(in oklab, var(--gold), #000 35%);
}
.neon-divider {
  height:1px; border:0; background:
    linear-gradient(90deg, transparent, color-mix(in oklab, var(--gold), #fff 30%), transparent);
  opacity:.65; margin: 12px 0;
}

/* ---------- Chat (OmniBot) ---------- */
.chat-fab { position:fixed; right:18px; bottom:18px; z-index:55; }
.chat-window {
  position:fixed; right:18px; bottom:86px; width:min(380px, 94vw); height:420px;
  border:1px solid var(--line); border-radius:14px; background:var(--surface); display:none; flex-direction:column; overflow:hidden; z-index:56;
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
}
.chat-header { display:flex; align-items:center; justify-content:space-between; padding:.7rem .8rem; border-bottom:1px solid var(--line); background:var(--surface-1); }
.chat-log { flex:1; padding:.8rem; overflow:auto; display:grid; gap:.5rem; }
.msg { padding:.5rem .7rem; border:1px solid var(--line); border-radius:12px; background:var(--surface-1); width:max-content; max-width:82%; }
.msg.me { justify-self:end; background: var(--surface); }
.typing { display:inline-flex; gap:.25rem; }
.typing i { width:6px; height:6px; background:var(--muted); border-radius:999px; display:inline-block; animation: dot 1s infinite ease-in-out; }
.typing i:nth-child(2){ animation-delay:.15s } .typing i:nth-child(3){ animation-delay:.3s }
@keyframes dot { 0%,80%,100%{ transform:translateY(0); opacity:.6 } 40%{ transform:translateY(-4px); opacity:1 } }
.chat-input { display:flex; gap:.5rem; padding:.7rem .8rem; border-top:1px dashed var(--line); }
.chat-input input { flex:1; border:1px solid var(--line); border-radius:10px; padding:.55rem .65rem; }

/* ---------- Admin chips/panels ---------- */
.admin-chip {
  position:fixed; left:18px; bottom:18px; z-index:55;
  background: color-mix(in oklab, var(--surface), transparent 10%); border:1px solid var(--line); border-radius:999px; padding:.45rem .8rem; cursor:pointer;
}
.admin-panel {
  position:fixed; left:18px; bottom:66px; background:var(--surface); color:var(--text);
  border:1px solid var(--line); border-radius:14px; padding:.8rem; z-index:56; display:none; box-shadow: 0 16px 50px rgba(0,0,0,.38);
}
.admin-panel label { display:flex; align-items:center; justify-content:space-between; gap:1rem; border-bottom:1px dashed var(--line); padding:.45rem 0; }
.admin-panel label:last-of-type { border-bottom:0; }

/* ---------- Toasts ---------- */
.toast-wrap { position:fixed; left:50%; transform:translateX(-50%); bottom:18px; display:grid; gap:.45rem; z-index:70; }
.toast {
  background: color-mix(in oklab, var(--surface), black 4%); color: var(--text);
  border:1px solid var(--line); border-radius:12px; padding:.55rem .8rem; box-shadow: 0 10px 40px rgba(0,0,0,.35);
  transition: opacity .18s ease, transform .18s ease;
}

/* ---------- Media helpers ---------- */
.poster { background-size:cover; background-position:center; border-radius:12px; border:1px solid var(--line); }
.skeleton {
  position:relative; overflow:hidden;
  background-image: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.12), rgba(255,255,255,.05));
  background-size: 300% 100%; animation: shimmer 1.2s infinite;
}
@keyframes shimmer { from{ background-position: 200% 0 } to { background-position: -100% 0 } }

/* ---------- Sticky CTA & Back to Top ---------- */
#toTop { background:var(--surface); }
#stickyCta { box-shadow: 0 12px 36px rgba(0,0,0,.45); }

/* ---------- Dotted focus for a11y ---------- */
:focus-visible { outline: 2px dotted var(--gold); outline-offset: 2px; }

/* ---------- Theme light override ---------- */
.theme-light .demo-header { background: color-mix(in oklab, #ffffff, transparent 10%); }
.theme-light .modal { background:#fff; }
.theme-light .card--glass { background: color-mix(in oklab, #ffffff, transparent 20%); }

/* ---------- Small tweaks ---------- */
.muted { color: var(--muted); }
.head .muted { font-size:.95rem; }
.chips { display:flex; gap:.35rem; flex-wrap:wrap; }
.pill { border-radius:999px; border:1px solid var(--line); padding:.28rem .6rem; background:var(--surface); }

/* ---------- Network dot ---------- */
#netDot { box-shadow: 0 0 0 2px color-mix(in oklab, var(--bg), #000 25%) inset; }
