/* Product-tour player on the About page (see demo_player.js). Everything is scoped to
   #fp-demo because Dash loads assets/*.css on every page. */
#fp-demo {
    --fpd-bg: var(--bs-body-bg, #222);
    --fpd-panel: #2b3035;
    --fpd-line: #444c55;
    --fpd-fg: #e6e9ec;
    --fpd-muted: #9aa4ae;
    --fpd-accent: #2fc4e6;
    --fpd-accent-soft: rgba(47, 196, 230, 0.16);
    --fpd-dim: rgba(8, 10, 12, 0.36);          /* spotlight surround: readable, clearly secondary */
    --fpd-spot-edge: rgba(47, 196, 230, 0.9);
    --fpd-chip: #0f1215;
    --fpd-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    display: grid;
    gap: 10px;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    color: var(--fpd-fg);
    text-align: left;
}
#fp-demo button { font: inherit; color: var(--fpd-fg); background: transparent; cursor: pointer; }
#fp-demo button:focus-visible { outline: 2px solid var(--fpd-accent); outline-offset: 2px; }

/* chapter chips: one scrollable row on phones, wrapping on wide screens */
#fp-demo .fpd-chapters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
#fp-demo .fpd-chapters::-webkit-scrollbar { display: none; }
#fp-demo .fpd-chapters button { flex: none; font-size: 13px; line-height: 1; color: var(--fpd-muted);
    border: 1px solid var(--fpd-line); border-radius: 999px; padding: 7px 12px; }
#fp-demo .fpd-chapters button:hover { color: var(--fpd-fg); }
#fp-demo .fpd-chapters button.on { color: var(--fpd-fg); border-color: var(--fpd-accent); background: var(--fpd-accent-soft); }

/* Back / progress / Next: pinned to the top on phones while reading the caption */
#fp-demo .fpd-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: sticky; top: env(safe-area-inset-top, 0px); z-index: 2; background: var(--fpd-bg); padding-block: 6px; }
#fp-demo .fpd-nav button { font-size: 15px; font-weight: 500; border: 1px solid var(--fpd-line); border-radius: 8px; padding: 8px 18px; }
#fp-demo .fpd-nav .fpd-next { border-color: var(--fpd-accent); }
#fp-demo .fpd-nav button:hover:not(:disabled) { border-color: var(--fpd-accent); }
#fp-demo .fpd-nav button:disabled { opacity: .35; cursor: default; }
#fp-demo .fpd-progress { flex: 1; display: grid; gap: 5px; justify-items: center; font: 11px/1 var(--fpd-mono);
    color: var(--fpd-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
#fp-demo .fpd-bar { width: 100%; max-width: 160px; height: 3px; border-radius: 2px; background: var(--fpd-line); overflow: hidden; }
#fp-demo .fpd-bar i { display: block; height: 100%; width: 0; background: var(--fpd-accent); transition: width .3s; }

#fp-demo .fpd-cap { background: var(--fpd-panel); border-radius: 12px; padding: 10px 14px 12px; }
#fp-demo .fpd-step { font: 11px/1 var(--fpd-mono); color: var(--fpd-muted); letter-spacing: 0.08em; text-transform: uppercase; }
#fp-demo .fpd-title { margin: 5px 0 3px; font-size: 17px; font-weight: 600; color: var(--fpd-accent); text-wrap: balance; }
#fp-demo .fpd-text { margin: 0; font-size: 15px; line-height: 1.55; }

/* The stage keeps the screenshot's exact aspect ratio, so spotlight coordinates (stored as %
   of the capture viewport) land 1:1. On phones the frame is a window that the stage slides in. */
#fp-demo .fpd-frame { --ar: 390 / 844; position: relative; width: 100%; aspect-ratio: var(--ar); overflow: hidden;
    touch-action: pan-y; border: 1px solid var(--fpd-line); border-radius: 14px; background: var(--fpd-chip); }
#fp-demo .fpd-stage { position: absolute; left: 0; top: 0; width: 100%; aspect-ratio: var(--ar); transition: transform .4s ease; }
#fp-demo .fpd-stage img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; max-width: none; }
#fp-demo .fpd-spot { position: absolute; border-radius: 8px; pointer-events: none; outline: 2px solid var(--fpd-spot-edge);
    box-shadow: 0 0 0 200vmax var(--fpd-dim);
    transition: left .35s ease, top .35s ease, width .35s ease, height .35s ease; }
#fp-demo .fpd-spot[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
    #fp-demo .fpd-spot, #fp-demo .fpd-stage, #fp-demo .fpd-bar i { transition: none; }
}

/* wide screens: whole screenshot beside the Back/Next + caption panel */
@media (min-width: 992px) {
    #fp-demo { max-width: none; grid-template-columns: auto minmax(0, 1fr); column-gap: 24px; align-items: start;
        grid-template-areas: "chapters chapters" "frame nav" "frame cap"; grid-template-rows: auto auto 1fr; }
    #fp-demo .fpd-chapters { grid-area: chapters; flex-wrap: wrap; overflow: visible; }
    #fp-demo .fpd-frame { grid-area: frame; width: min(380px, calc((100vh - 170px) * 390 / 844)); border-radius: 22px; }
    #fp-demo .fpd-nav { grid-area: nav; position: static; }
    #fp-demo .fpd-cap { grid-area: cap; }
}
