/* demo.css — chrome for the public guided demo (top bar, control bar, overlay).
   Colours follow the Tutorfic app brand (see app/style.css :root). */

:root {
  --d-brand: #3a7bff;
  --d-brand-dark: #2c63d6;
  --d-ink: #20303f;
  --d-muted: #6b7a8d;
  --d-line: #e3eaf4;
}

body.demo-body {
  padding-top: 56px;      /* room for the fixed demo top bar */
  padding-bottom: 230px;  /* room for the fixed control bar + scroll headroom */
  background: #f3f7ff;
}

/* ── Top bar ─────────────────────────────────────────────────────────────── */
.demo-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--d-line);
}
.demo-badge {
  background: linear-gradient(135deg, var(--d-brand), var(--d-brand-dark));
  color: #fff; font-size: 11px; font-weight: 800; letter-spacing: 0.08em;
  padding: 3px 8px; border-radius: 6px; flex-shrink: 0;
}
.demo-title { font-weight: 800; font-size: 16px; color: var(--d-ink); flex-shrink: 0; display: flex; align-items: center; gap: 6px; }
.demo-lang-select {
  margin-left: auto;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid #cfd9ea;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  color: var(--d-ink);
  cursor: pointer;
  max-width: 140px;
}
.demo-lang-select + .demo-lang-select { margin-left: 8px; }
.demo-trial {
  flex-shrink: 0; background: var(--d-brand); color: #fff; text-decoration: none;
  font-size: 12.5px; font-weight: 800; padding: 8px 13px; border-radius: 999px; white-space: nowrap;
}
.demo-trial:hover { background: var(--d-brand-dark); }
.demo-exit {
  flex-shrink: 0; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--d-muted); text-decoration: none; font-size: 24px; line-height: 1;
}
.demo-exit:hover { background: #e8eefb; color: var(--d-ink); }
@media (max-width: 540px) {
  .demo-title .demo-title-name { display: none; }
  .demo-trial { padding: 8px 10px; }
  .demo-lang-select { max-width: 108px; }
}

/* ── Language chooser (first screen) ─────────────────────────────────────── */
.demo-lang-overlay { z-index: 90; }
.demo-lang-card {
  background: #fff; border-radius: 22px; padding: 28px 24px; text-align: center;
  max-width: 400px; width: 100%; box-shadow: 0 24px 64px rgba(20, 40, 90, 0.28);
}
.demo-lang-globe { font-size: 40px; margin-bottom: 6px; }
.demo-lang-head { font-size: 20px; font-weight: 800; color: var(--d-ink); margin-bottom: 6px; }
.demo-lang-note { font-size: 13.5px; color: var(--d-muted); margin: 0 0 18px; }
.demo-lang-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.demo-lang-opt {
  padding: 14px 10px; border-radius: 14px; border: 1.5px solid var(--d-line); background: #fff;
  font-size: 16px; font-weight: 700; color: var(--d-ink); cursor: pointer;
  transition: border-color 0.12s, background 0.12s, transform 0.08s;
}
.demo-lang-opt:hover { border-color: var(--d-brand); background: #eef4ff; }
.demo-lang-opt:active { transform: scale(0.97); }
@media (max-width: 360px) { .demo-lang-grid { grid-template-columns: 1fr; } }

/* ── Highlight ring on the element being narrated ───────────────────────── */
.demo-voice-target {
  outline: 3px solid var(--d-brand);
  outline-offset: 3px;
  border-radius: 12px;
  box-shadow: 0 0 0 6px rgba(58, 123, 255, 0.18);
  scroll-margin-top: 76px;
  scroll-margin-bottom: 200px;
  transition: outline-color 0.15s, box-shadow 0.15s;
}

/* ── Bottom control bar ──────────────────────────────────────────────────── */
.demo-bar {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: 18px; z-index: 70;
  width: min(480px, calc(100vw - 24px));
  background: #fff;
  border: 1px solid var(--d-line);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(20, 40, 90, 0.18), 0 8px 24px rgba(20, 40, 90, 0.08);
  padding: 12px 16px 14px;
}
.demo-bar-top { margin-bottom: 4px; }
.demo-prog { font-size: 11px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--d-brand); }
.demo-bar-text { font-size: 15.5px; line-height: 1.5; color: var(--d-ink); margin-bottom: 10px; min-height: 1.5em; }
.demo-ctrls { display: flex; align-items: center; justify-content: center; gap: 14px; }
.demo-btn {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid #cfd9ea; background: #fff; font-size: 18px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.1s, transform 0.08s;
}
.demo-btn:hover { background: #eef4ff; }
.demo-btn:active { transform: scale(0.92); }
.demo-btn--main {
  width: 54px; height: 54px; background: var(--d-brand); border-color: var(--d-brand); color: #fff; font-size: 20px;
}
.demo-btn--main:hover { background: var(--d-brand-dark); }

/* ── Overlays (language chooser / end card) ──────────────────────────────── */
.demo-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(15, 25, 45, 0.55);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}

/* ── End card ────────────────────────────────────────────────────────────── */
.demo-end-card {
  background: #fff; border-radius: 22px; padding: 32px 28px; text-align: center;
  max-width: 360px; box-shadow: 0 24px 64px rgba(20, 40, 90, 0.24);
}
.demo-end-emoji { font-size: 46px; margin-bottom: 8px; }
.demo-end-title { font-size: 21px; font-weight: 800; color: var(--d-ink); margin-bottom: 18px; }
.demo-end-cta {
  display: block; background: var(--d-brand); color: #fff; text-decoration: none;
  font-size: 16px; font-weight: 800; padding: 14px; border-radius: 12px; margin-bottom: 10px;
}
.demo-end-cta:hover { background: var(--d-brand-dark); }
.demo-end-replay { background: none; border: none; color: var(--d-muted); font-size: 14px; font-weight: 700; cursor: pointer; }

/* ── Shared standalone-mock layout (used by demo/*.html screens) ─────────── */
.demo-main { max-width: 860px; margin: 0 auto; padding: 18px 14px; }

/* A faux app top bar so each mock screen reads like the real app. */
.demo-appbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: linear-gradient(135deg, #4a86ff 0%, #2c63d6 100%);
  color: #fff; padding: 10px 16px; border-radius: 16px; margin-bottom: 16px;
  box-shadow: 0 3px 16px rgba(20, 40, 90, 0.22);
}
.demo-appbar .ab-brand { display: inline-flex; align-items: center; gap: 9px; font-size: 20px; font-weight: 800; }
.demo-appbar .ab-logo {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 11px;
  background: rgba(255, 255, 255, 0.2); font-size: 20px;
}
.demo-appbar .ab-spacer { margin-left: auto; }
.demo-appbar .ab-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px;
  border-radius: 999px; background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 14px; font-weight: 700;
}

@media (prefers-reduced-motion: reduce) { .demo-voice-target { transition: none; } }
