/* Postoteka demo-only styles.

Scoped additions for the static demo shell. Does NOT modify production
app.css; only the minimal presentation needed for the demo banner, placeholder
notes, the ECharts activity container, the demo message-detail modal and the
demo tooltip shown on the chart.

Theme: demo.css ships a small set of demo-specific CSS custom properties
(light defaults in :root, dark overrides under html[data-theme="dark"]) that
MIRROR the dark contract baked into app.css. The server bakes data-theme into
production; the demo (static, no server) sets it via an inline theme-init
injected by demo/build.py (postoteka_theme cookie). When no explicit attr is
present, the prefers-color-scheme media query below follows the OS — no FOUC
because CSS is render-blocking and the inline init runs during parse.
*/
:root {
  --demo-banner-bg: #fff3cd;
  --demo-banner-border: #ffe69c;
  --demo-banner-fg: #664d03;
  --demo-progress-track: #e4e6e9;
  --demo-btn-secondary-bg: #f3f4f6;
  --demo-btn-secondary-fg: #24292f;
  --demo-btn-secondary-border: #b0b3b8;
}
html[data-theme="dark"] {
  --demo-banner-bg: #3a2f0e;
  --demo-banner-border: #5a4b14;
  --demo-banner-fg: #e8dc9a;
  --demo-progress-track: #2a3a33;
  --demo-btn-secondary-bg: #24292f;
  --demo-btn-secondary-fg: #e8f0ee;
  --demo-btn-secondary-border: #4a525a;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --demo-banner-bg: #3a2f0e;
    --demo-banner-border: #5a4b14;
    --demo-banner-fg: #e8dc9a;
    --demo-progress-track: #2a3a33;
    --demo-btn-secondary-bg: #24292f;
    --demo-btn-secondary-fg: #e8f0ee;
    --demo-btn-secondary-border: #4a525a;
  }
}

.demo-banner {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--demo-banner-bg);
  border-bottom: 1px solid var(--demo-banner-border);
  color: var(--demo-banner-fg);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 6px 12px;
}
.demo-banner .demo-banner-text { color: var(--demo-banner-fg); }
.demo-back-link {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--demo-banner-fg);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.demo-back-link:hover,
.demo-back-link:focus-visible { color: #a78bfa; }
.demo-placeholder {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-style: italic;
}

/* Demo-only help page. */
.demo-help-notice {
  margin: 0 0 20px;
  padding: 12px 16px;
  border-left: 3px solid #4f90d6;
  background: var(--surface);
  color: var(--text);
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.guide-section h2 { margin-top: 0; font-size: 1.05rem; }
.guide-section p { margin-bottom: 0; line-height: 1.55; }
@media (max-width: 720px) {
  .guide-grid { grid-template-columns: 1fr; }
}

/* demo-only chart placeholder state */
.activity-echarts { min-height: 260px; }
.chart-empty[hidden] { display: none; }

/* demo message detail modal (mirrors production .modal styles) */
#modal-root .modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45);
  display: flex; align-items: flex-start; padding: 40px 12px; z-index: 2000;
}
#modal-root .modal {
  background: var(--surface); border-radius: 10px; max-width: 640px; width: 100%;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.25); padding: 16px 20px;
}
#modal-root .modal-head { display: flex; justify-content: space-between; align-items: center; }
#modal-root .modal-body { margin: 12px 0; line-height: 1.5; }
#modal-root .demo-card-link { margin: 8px 0; }
#modal-root .modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* demo tooltip (inline, no production tooltip deps) */
.demo-tooltip { font-size: 12px; line-height: 1.4; }

/* ---- D-04: demo-only sync collection simulation -----------------------
   Honest, UI-only state machine on the sync page. No production styles are
   modified; these classes are consumed only by demo runtime on sync.html. */
.info-box.warning-box#demo-sync-notice { margin-bottom: 16px; }
.sync-error { color: #842727; font-weight: 600; padding: 8px 0; }
.sync-run-title, .sync-done-title { font-weight: 600; margin: 8px 0; }
.sync-progress-track {
  width: 100%; height: 10px; background: var(--demo-progress-track); border-radius: 6px;
  overflow: hidden; margin: 10px 0;
}
.sync-progress-bar { height: 100%; background: #4f90d6; transition: width 80ms linear; }
.sync-done-actions { display: flex; gap: 8px; margin-top: 12px; }
.sync-done-actions .button { cursor: pointer; }
.btn-secondary {
  background: var(--demo-btn-secondary-bg); color: var(--demo-btn-secondary-fg); border: 1px solid var(--demo-btn-secondary-border);
  border-radius: 6px; padding: 6px 12px; cursor: pointer;
}
.btn-secondary:hover { background: var(--surface-hover); }
