/* From Components/Shared/HomeChartDemo.razor.css (plain CSS since 2026-10-23, see
   Components/MarketingPage.cs). Every class is tqd- prefixed. */
/* The homepage demo ("See it in action"). Reads the --tq-* tokens from Home.razor's .tq wrapper.
   Fixed heights everywhere the script changes content, so nothing below it moves (no layout shift). */

.tqd {
    /* Fits the window (toolbar, stage, controls) on most screens; fixed once the page has laid out. */
    --tqd-stage-h: clamp(400px, calc(100vh - 400px), 560px);
    --tqd-chart-bg: #0a0e17;
    --tqd-line: rgba(0, 205, 237, 0.14);
    --tqd-accent: #00cded;
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 84px 24px 0;
    scroll-margin-top: 0;
}

.tqd[hidden] { display: none; }

.tqd-head { max-width: 760px; margin: 0 auto 26px; text-align: center; }
.tqd-kicker { color: var(--tq-accent); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.tqd h2 { margin: 12px 0 14px; font-family: var(--tq-display); font-size: clamp(2rem, 3.6vw, 3rem); font-weight: 700; line-height: 1.08; letter-spacing: -0.03em; color: #fff; }
.tqd-grad { background: var(--tq-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tqd-head p { margin: 0; color: var(--tq-muted); font-size: 1.08rem; }

.tqd-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 18px 0 20px; }
.tqd-badge { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border: 1px solid var(--tq-border); border-radius: 999px; background: var(--tq-panel); color: var(--tq-muted); font-size: 0.8rem; }
.tqd-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--tq-accent-2); }
.tqd-badge-warn { color: #fbbf24; border-color: rgba(251, 191, 36, 0.3); }

.tqd-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.tqd-btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 12px 22px; border: none; border-radius: 12px;
    background: linear-gradient(135deg, #13dfff, #22d3ee); color: #04121a; font: 700 0.95rem var(--tq-sans); text-decoration: none; cursor: pointer;
    box-shadow: 0 8px 28px rgba(19, 223, 255, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35); transition: transform 0.2s, box-shadow 0.2s; }
.tqd-btn:hover { transform: translateY(-2px); }
.tqd-btn-ghost { background: rgba(255, 255, 255, 0.04); color: var(--tq-text); border: 1px solid var(--tq-border); box-shadow: none; }
.tqd-btn-lg { padding: 16px 28px; font-size: 1.02rem; }

/* Chapter tabs, each with its own progress fill (--p, set by the script) */
.tqd-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 1152px; margin: 0 auto 12px; }
.tqd-tab { position: relative; display: flex; align-items: center; gap: 9px; padding: 11px 14px 13px; overflow: hidden; border: 1px solid var(--tq-border);
    border-radius: 12px; background: var(--tq-panel); color: var(--tq-muted); font: 600 0.9rem var(--tq-sans); text-align: left; cursor: pointer; }
.tqd-tab[aria-selected="true"] { color: #fff; border-color: rgba(19, 223, 255, 0.35); background: rgba(19, 223, 255, 0.06); }
.tqd-tab-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, 0.06); font-size: 0.75rem; }
.tqd-tab[aria-selected="true"] .tqd-tab-n { background: var(--tq-accent); color: #04121a; }
.tqd-tab-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255, 255, 255, 0.04); }
.tqd-tab-bar i { display: block; height: 100%; width: 100%; transform-origin: left; transform: scaleX(var(--p, 0)); background: var(--tq-grad); }

/* The window: replica toolbar, stage, controls */
.tqd-window { max-width: 1152px; margin: 0 auto; overflow: hidden; border: 1px solid var(--tq-border); border-radius: 18px; background: var(--tqd-chart-bg);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(19, 223, 255, 0.05); }

.tqd-toolbar { position: relative; z-index: 30; display: flex; align-items: center; gap: 6px; height: 42px; padding: 0 12px;
    background: linear-gradient(180deg, rgba(18, 22, 32, 0.98), rgba(13, 17, 28, 0.98)); border-bottom: 1px solid var(--tqd-line); font-family: var(--tq-sans); }
.tqd-sym { margin-right: 4px; color: #e6f1ff; font: 700 0.85rem var(--tq-mono); }
.tqd-tfs { display: flex; gap: 2px; }
.tqd-tf, .tqd-pill, .tqd-tool, .tqd-save { display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 26px; padding: 0 8px;
    border: 1px solid transparent; border-radius: 6px; background: transparent; color: rgba(136, 146, 176, 0.8); font: 600 11px var(--tq-sans); cursor: pointer; text-decoration: none; }
.tqd-tf:hover, .tqd-pill:hover, .tqd-tool:hover { color: #e6f1ff; background: rgba(50, 65, 85, 0.45); }
.tqd-tf[aria-pressed="true"], .tqd-pill[aria-expanded="true"], .tqd-tool.is-on, .tqd-tool[aria-expanded="true"] {
    color: var(--tqd-accent); background: rgba(0, 205, 237, 0.15); border-color: rgba(0, 205, 237, 0.38); }
.tqd-pill, .tqd-tool { background: rgba(30, 40, 55, 0.5); border-color: rgba(100, 120, 150, 0.2); }
/* Like the chart page: a pill with something switched on in it is lit. */
.tqd-pill:has(.tqd-count:not([hidden])) { color: var(--tqd-accent); background: rgba(0, 205, 237, 0.12); border-color: rgba(0, 205, 237, 0.35); }
.tqd-tool { width: 30px; padding: 0; }
.tqd-tool svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tqd-save { color: var(--tqd-accent); border-color: rgba(0, 205, 237, 0.3); }
.tqd-count { min-width: 15px; padding: 0 4px; border-radius: 8px; background: rgba(0, 205, 237, 0.2); color: var(--tqd-accent); font-size: 10px; }
.tqd-sep { width: 1px; height: 18px; margin: 0 4px; background: rgba(255, 255, 255, 0.08); }
.tqd-spacer { flex: 1; }
.tqd-explore-only { display: none; }
.tqd[data-phase="explore"] .tqd-explore-only { display: inline-flex; }

.tqd-pillwrap { position: relative; }
.tqd-dd { position: absolute; top: calc(100% + 4px); left: 0; display: grid; min-width: 172px; padding: 4px; border: 1px solid rgba(0, 205, 237, 0.3);
    border-radius: 8px; background: rgba(18, 22, 32, 0.98); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5); animation: tqd-drop 0.14s ease-out; }
.tqd-dd[hidden] { display: none; }
.tqd-pillwrap-end .tqd-dd { left: auto; right: 0; min-width: 120px; }
.tqd-opt { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 0; border-radius: 6px; background: transparent; color: #cbd5e1;
    font: 500 12px var(--tq-sans); text-align: left; cursor: pointer; }
.tqd-opt:hover { background: rgba(0, 205, 237, 0.1); }
.tqd-check { width: 13px; height: 13px; border: 1.5px solid rgba(136, 146, 176, 0.6); border-radius: 3px; }
.tqd-opt[aria-pressed="true"] { color: #fff; }
.tqd-opt[aria-pressed="true"] .tqd-check { border-color: var(--tqd-accent); background: var(--tqd-accent); box-shadow: inset 0 0 0 2px #121620; }
.tqd-intra { margin-left: auto; color: var(--tq-dim); font: 600 9px var(--tq-sans); font-style: normal; }

/* Stage: 1, 2 (stacked) or 4 (2x2) cells; the cells fade in one after another */
.tqd-stage { position: relative; display: grid; gap: 1px; height: var(--tqd-stage-h); background: var(--tqd-line); }
.tqd-stage[data-layout="2"] { grid-template-columns: 1fr 1fr; }
.tqd-stage[data-layout="4"] { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.tqd-cell { position: relative; min-width: 0; min-height: 0; background: var(--tqd-chart-bg); animation: tqd-cell-in 0.35s ease-out backwards; animation-delay: calc(var(--i, 0) * 80ms); }
.tqd-cell[hidden] { display: none; }
/* !important: the chart bridge puts an inline position: relative on its container (for its overlay canvases); the chart
   would then keep the size it was created at when the grid splits the stage, its lower part hidden under the next cell */
.tqd-chart { position: absolute !important; inset: 0; }
.tqd-cell-label, .tqd-legend { position: absolute; z-index: 12; left: 10px; pointer-events: none; font: 600 11px var(--tq-mono); }
.tqd-cell-label { top: 8px; color: #e6f1ff; }
.tqd-legend { top: 26px; color: var(--tq-muted); font-weight: 500; white-space: nowrap; }

/* The homepage shows the reversal overlay, never a confidence figure: no diamond tooltips. */
.tqd-cell .lwc-reversal-marker { pointer-events: none !important; cursor: default !important; }

.tqd-skeleton { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; background: var(--tqd-chart-bg); }
.tqd-skeleton span { width: 46%; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--tq-accent), transparent); animation: tqd-scan 1.4s ease-in-out infinite; }
.tqd.is-ready .tqd-skeleton { display: none; }

.tqd-shield { position: absolute; inset: 0; z-index: 25; display: none; cursor: pointer; touch-action: pan-y; }
.tqd[data-phase="playing"] .tqd-shield, .tqd[data-phase="paused"] .tqd-shield { display: block; }

.tqd-cursor { position: absolute; top: 0; left: 0; z-index: 26; width: 0; height: 0; opacity: 0; pointer-events: none; transition: opacity 0.25s; will-change: transform; }
.tqd-cursor.is-visible { opacity: 1; }
.tqd-cursor svg { display: block; fill: #fff; stroke: #0a0e17; stroke-width: 1.4; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)); }
.tqd-ripple { position: absolute; top: -14px; left: -14px; width: 28px; height: 28px; border: 2px solid var(--tq-accent); border-radius: 50%; opacity: 0; }
.tqd-ripple.is-right { border-color: #fbbf24; }
.tqd-ripple.is-on { animation: tqd-ripple 0.5s ease-out; }

/* Explore's actions sit at the right end of the caption row (figcaption), under the stage: never over the plot.
   The chip lets the pointer through, only its buttons take it; after the first touch on the chart it is just the
   sign-up pill (is-collapsed; the play button replays too). */
.tqd-chip { display: flex; flex: none; align-items: center; gap: 8px; margin-left: auto; pointer-events: none; animation: tqd-fade 0.3s ease-out; }
.tqd-chip[hidden] { display: none; }
.tqd-chip-btn { padding: 6px 12px; border: 1px solid var(--tq-border); border-radius: 999px; background: rgba(255, 255, 255, 0.05); color: var(--tq-text);
    font: 600 0.8rem var(--tq-sans); white-space: nowrap; text-decoration: none; cursor: pointer; pointer-events: auto; }
.tqd-chip-cta { border-color: transparent; background: var(--tq-accent); color: #04121a; }
.tqd-chip.is-collapsed .tqd-chip-watch, .tqd-cta-short { display: none; }
.tqd[data-phase="explore"] .tqd-progress { display: none; }

.tqd-savedata, .tqd-failed { position: absolute; inset: 0; z-index: 28; display: none; place-content: center; gap: 12px; padding: 24px;
    background: var(--tqd-chart-bg); color: var(--tq-muted); text-align: center; }
.tqd-savedata p, .tqd-failed p { margin: 0; }
.tqd-failed a { color: var(--tq-accent); }
.tqd.is-savedata .tqd-savedata, .tqd.is-failed .tqd-failed { display: grid; }
.tqd-noscript { position: absolute; inset: auto 0 45%; z-index: 3; margin: 0; color: var(--tq-muted); text-align: center; }

.tqd-controls { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; border-top: 1px solid var(--tqd-line);
    background: rgba(13, 17, 28, 0.98); }
.tqd-play { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border: 1px solid var(--tq-border); border-radius: 50%;
    background: rgba(255, 255, 255, 0.05); color: #fff; cursor: pointer; }
.tqd-play svg { width: 14px; height: 14px; fill: currentColor; }
.tqd-icon-pause { display: none; }
.tqd[data-phase="playing"] .tqd-icon-pause { display: block; }
.tqd[data-phase="playing"] .tqd-icon-play { display: none; }
.tqd-progress { position: relative; flex: none; width: 120px; height: 4px; overflow: hidden; border-radius: 2px; background: rgba(255, 255, 255, 0.08); }
.tqd-progress i { position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--p, 0)); background: var(--tq-grad); }
.tqd-caption { flex: 1; min-height: 2.6em; margin: 0; display: flex; align-items: center; color: var(--tq-text); font-size: 0.9rem; line-height: 1.3; }

.tqd-data { max-width: 1152px; margin: 12px auto 0; color: var(--tq-dim); font-size: 0.78rem; text-align: center; }
.tqd-data a { color: var(--tq-muted); }
.tqd-cta { margin: 28px auto 0; text-align: center; }
.tqd-cta p { margin: 12px 0 0; color: var(--tq-dim); font-size: 0.85rem; }

@keyframes tqd-drop { from { opacity: 0; transform: translateY(-4px); } }
@keyframes tqd-cell-in { from { opacity: 0; transform: scale(0.985); } }
@keyframes tqd-fade { from { opacity: 0; } }
@keyframes tqd-scan { 0%, 100% { transform: translateX(-40%); opacity: 0.3; } 50% { transform: translateX(40%); opacity: 1; } }
@keyframes tqd-ripple { from { opacity: 0.9; transform: scale(0.3); } to { opacity: 0; transform: scale(1.4); } }

@media (prefers-reduced-motion: reduce) {
    .tqd-cell, .tqd-dd, .tqd-chip { animation: none; }
    .tqd-skeleton span { animation: none; opacity: 0.6; }
    .tqd-btn { transition: none; }
}

@media (max-width: 960px) {
    .tqd { --tqd-stage-h: 480px; padding-top: 80px; }
    .tqd-intra { display: none; }
    .tqd-chip-watch { display: none; }
}

@media (max-width: 640px) {
    .tqd { --tqd-stage-h: 420px; padding: 64px 16px 0; }
    .tqd-tabs { gap: 6px; }
    .tqd-tab { gap: 6px; padding: 8px 8px 10px; font-size: 0.74rem; line-height: 1.2; }
    .tqd-tab-n { display: none; }
    .tqd-toolbar { flex-wrap: wrap; height: auto; min-height: 42px; gap: 4px; row-gap: 6px; padding: 6px 8px; }
    .tqd-sym, .tqd-sep, .tqd-save { display: none; }
    .tqd-tf, .tqd-pill { padding: 0 6px; }
    .tqd-stage[data-layout="2"] { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
    .tqd-stage[data-layout="4"] { grid-template-columns: 1fr; grid-template-rows: repeat(4, 1fr); }
    .tqd-progress { display: none; }
    .tqd-caption { font-size: 0.85rem; }
    .tqd-cta-long { display: none; }
    .tqd-cta-short { display: inline; }
}
