/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 * Copyright © 2026 Marcel Rymenhout and IniqDash contributors */
/* THE HOSTED PUBLIC DEMO — the demo controls (assets/js/demo-session.js). Only on the public demo; uses the application's tokens so it
   follows the dashboard's theme, and stays small: one control in a corner, dialogs only when they are needed. */
.iq-demo { position: fixed; left: max(14px, env(safe-area-inset-left)); bottom: max(14px, env(safe-area-inset-bottom)); z-index: 2147483000;
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; font-family: var(--font, system-ui, sans-serif); }
.iq-demo[popover] { inset: auto; left: max(14px, env(safe-area-inset-left)); bottom: max(14px, env(safe-area-inset-bottom)); margin: 0; padding: 0; border: 0;
  background: transparent; overflow: visible; color: inherit; }
/* the public demo has no account: "Sign out" means nothing here (logout.php sends the visitor back to the demo anyway) */
form[action="logout.php"] { display: none !important; }
.iq-demo__pill { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 12px 0 10px; border: 0; border-radius: 999px; cursor: pointer;
  font: 600 12px/1 var(--font, system-ui, sans-serif); letter-spacing: .02em; color: var(--text-primary, #f1f1f3);
  background: color-mix(in srgb, var(--surface-primary, #17171a) 88%, transparent); box-shadow: 0 0 0 1px var(--border-primary, rgba(255, 255, 255, .1)), 0 6px 18px rgba(0, 0, 0, .28);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.iq-demo__pill:hover { background: var(--surface-primary, #17171a); }
.iq-demo__pill:focus-visible, .iq-demo__item:focus-visible, .iq-demo__btn:focus-visible { outline: 2px solid var(--accent, #ff7a1a); outline-offset: 2px; }
.iq-demo__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--info, #4aa8ff); }
.iq-demo__label { text-transform: uppercase; letter-spacing: .1em; font-size: 10.5px; color: var(--text-muted, #a1a3ab); }
.iq-demo__time { font-variant-numeric: tabular-nums; }
.iq-demo__pill.is-low .iq-demo__dot { background: var(--warning, #ffb547); }
.iq-demo__pill.is-low .iq-demo__time { color: var(--warning, #ffb547); }

.iq-demo__menu { box-sizing: border-box; width: min(300px, calc(100vw - 28px)); padding: 14px; border-radius: 18px; display: flex; flex-direction: column; gap: 6px;
  color: var(--text-primary, #f1f1f3); background: var(--surface-primary, #17171a); box-shadow: 0 0 0 1px var(--border-primary, rgba(255, 255, 255, .1)), 0 18px 48px rgba(0, 0, 0, .45); }
.iq-demo__menu[hidden] { display: none; }
.iq-demo__head { margin: 0 0 2px; display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--text-muted, #a1a3ab); }
.iq-demo__head strong { font-size: 20px; font-variant-numeric: tabular-nums; color: var(--text-primary, #f1f1f3); }
.iq-demo__note { margin: 0 0 6px; font-size: 12px; line-height: 1.45; color: var(--text-muted, #a1a3ab); }
.iq-demo__note[hidden] { display: none; }
.iq-demo__item { display: flex; align-items: center; min-height: 40px; padding: 0 12px; border: 0; border-radius: 12px; cursor: pointer; text-align: left; text-decoration: none;
  font: 600 13px var(--font, system-ui, sans-serif); color: var(--text-primary, #f1f1f3); background: var(--surface-secondary, rgba(255, 255, 255, .06)); }
.iq-demo__item:hover { background: color-mix(in srgb, var(--text-primary, #fff) 12%, transparent); }
.iq-demo__item--primary { color: var(--on-accent, #1b1407); background: var(--accent, #ff7a1a); }
.iq-demo__item--primary:hover { background: color-mix(in srgb, var(--accent, #ff7a1a) 88%, #fff); }
.iq-demo__item:disabled { opacity: .45; cursor: not-allowed; }
.iq-demo__sep { width: 100%; margin: 4px 0; border: 0; border-top: 1px solid var(--border-primary, rgba(255, 255, 255, .1)); }

.iq-demo__toast { position: fixed; left: 50%; bottom: max(64px, calc(env(safe-area-inset-bottom) + 64px)); transform: translateX(-50%); z-index: 2147483001;
  box-sizing: border-box; max-width: min(520px, calc(100vw - 28px)); margin: 0; padding: 10px 16px; border-radius: 14px;
  font: 500 13px/1.45 var(--font, system-ui, sans-serif); color: var(--text-primary, #f1f1f3); background: var(--surface-primary, #17171a);
  box-shadow: 0 0 0 1px var(--border-primary, rgba(255, 255, 255, .1)), 0 12px 32px rgba(0, 0, 0, .4); }
.iq-demo__toast[hidden] { display: none; }

.iq-demo__dlg { box-sizing: border-box; width: min(460px, calc(100vw - 28px)); padding: 24px; border: 0; border-radius: 22px;
  font: 400 14px/1.55 var(--font, system-ui, sans-serif); color: var(--text-primary, #f1f1f3); background: var(--surface-primary, #17171a);
  box-shadow: 0 0 0 1px var(--border-primary, rgba(255, 255, 255, .1)), 0 24px 64px rgba(0, 0, 0, .5); }
.iq-demo__dlg::backdrop { background: rgba(6, 7, 10, .55); backdrop-filter: blur(2px); }
.iq-demo__dlg h2, .iq-demo__endcard h2 { margin: 0 0 10px; font-size: 19px; line-height: 1.3; }
.iq-demo__dlg p { margin: 0 0 10px; color: var(--text-secondary, #c9cbd1); }
.iq-demo__dlg strong { color: var(--text-primary, #f1f1f3); font-variant-numeric: tabular-nums; }
.iq-demo__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin: 16px 0 0; }
.iq-demo__btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border: 0; border-radius: 12px; cursor: pointer;
  text-decoration: none; font: 600 14px var(--font, system-ui, sans-serif); color: var(--text-primary, #f1f1f3); background: var(--surface-secondary, rgba(255, 255, 255, .08)); }
.iq-demo__btn--primary { color: var(--on-accent, #1b1407); background: var(--accent, #ff7a1a); }
.iq-demo__btn--danger { color: #fff; background: var(--danger, #ff4d4f); }
.iq-demo__btn:disabled { opacity: .55; cursor: progress; }

.iq-demo__end { position: fixed; inset: 0; z-index: 2147483002; display: flex; align-items: center; justify-content: center; padding: 16px; box-sizing: border-box;
  background: rgba(10, 11, 14, .82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); font-family: var(--font, system-ui, sans-serif); }
.iq-demo__endcard { box-sizing: border-box; width: min(560px, 100%); padding: 30px 28px; border-radius: 24px; color: var(--text-primary, #f1f1f3);
  background: var(--surface-primary, #17171a); box-shadow: 0 0 0 1px var(--border-primary, rgba(255, 255, 255, .1)), 0 24px 64px rgba(0, 0, 0, .5); }
.iq-demo__endcard p { margin: 0 0 10px; line-height: 1.55; color: var(--text-secondary, #c9cbd1); }
.iq-demo__endcard .iq-demo__lead { font-weight: 600; color: var(--text-primary, #f1f1f3); }
.iq-demo__endcard .iq-demo__actions { justify-content: flex-start; margin-top: 20px; }
.iq-demo__eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--accent, #ff7a1a) !important; }

/* phones: the control sits above the navigation dock, the menu opens upwards and fits the width */
@media (max-width: 640px) {
  .iq-demo, .iq-demo[popover] { bottom: max(96px, calc(env(safe-area-inset-bottom) + 96px)); left: 10px; }
  .iq-demo__actions { justify-content: stretch; }
  .iq-demo__actions .iq-demo__btn { flex: 1 1 auto; }
}
@media print { .iq-demo, .iq-demo__toast { display: none; } }
@media (prefers-reduced-motion: reduce) { .iq-demo__pill, .iq-demo__end { backdrop-filter: none; -webkit-backdrop-filter: none; } }
