/* =====================================================================
   Demo mode + tour styling (Simple / Advanced toggle, tour overlay).
   Loaded after app.css so it can layer on top of existing pages.
   ===================================================================== */

/* ---- mode toggle button (header.php + welcome index.php) ---- */
.mode-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  white-space: nowrap;
}
.mode-toggle-btn.active {
  background: var(--bs-primary, #0d6efd);
  color: #fff;
  border-color: var(--bs-primary, #0d6efd);
}
/* welcome page (index.php) uses .text-link styling for its header buttons */
.site-header .mode-toggle-btn.text-link,
.site-header .tour-start-btn.text-link {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  border-bottom: 1px dashed transparent;
}
.site-header .mode-toggle-btn.text-link:hover,
.site-header .tour-start-btn.text-link:hover {
  border-bottom-color: currentColor;
}

/* ---- Simple mode: hide advanced-only sections ---- */
[data-mode='simple'] .adv-only {
  display: none !important;
}
/* Advanced mode: hide simple-only sections (rarely used) */
[data-mode='advanced'] .simple-only {
  display: none !important;
}

/* ---- Financial report: mark advanced panels so authors can opt-in ---- */
/* Authors add class="adv-only" to deep panels. Common ones auto-tagged: */
[data-mode='simple'] .fr-options,
[data-mode='simple'] .fr-synth,
[data-mode='simple'] .fr-text-ai-advanced,
[data-mode='simple'] .fr-raw-xbrl {
  display: none !important;
}

/* ---- Mode badge shown in footer of catalog/company to hint at mode ---- */
.mode-hint {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 1050;
  background: rgba(13, 110, 253, 0.95);
  color: #fff;
  font-size: 0.72rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  display: none;
  pointer-events: none;
}
.mode-hint.is-visible { display: inline-block; }

/* =====================================================================
   Guided tour overlay
   ===================================================================== */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: none;
}
.tour-overlay.is-active { display: block; }

/* dimmed backdrop with a cutout hole drawn via box-shadow on the spotlight */
.tour-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 20, 0);
  transition: background 0.25s ease;
  pointer-events: none;
}
.tour-overlay.is-active .tour-backdrop {
  background: rgba(8, 12, 20, 0.55);
  pointer-events: auto;
}

.tour-spotlight {
  position: absolute;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(8, 12, 20, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.85);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 1081;
}

.tour-popover {
  position: absolute;
  z-index: 1082;
  max-width: 360px;
  background: #fff;
  color: #1a1a1a;
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  padding: 1rem 1.1rem 0.9rem;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
.tour-popover .tour-step-no {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  margin-bottom: 0.25rem;
}
.tour-popover h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
}
.tour-popover p {
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0 0 0.9rem;
  color: #374151;
}
.tour-popover .tour-mode-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
  background: #eef2ff;
  color: #4338ca;
}
.tour-popover .tour-mode-pill.advanced { background: #fef3c7; color: #92400e; }
.tour-popover .tour-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.tour-popover .tour-actions button {
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  padding: 0.4rem 0.85rem;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
}
.tour-popover .tour-actions button:hover { background: #f3f4f6; }
.tour-popover .tour-actions .tour-next {
  background: #0d6efd;
  border-color: #0d6efd;
  color: #fff;
}
.tour-popover .tour-actions .tour-next:hover { background: #0b5ed7; }
.tour-popover .tour-actions .tour-prev:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.tour-dots {
  display: flex;
  gap: 5px;
}
.tour-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d1d5db;
}
.tour-dots span.is-active { background: #0d6efd; }
.tour-dots span.is-done { background: #93c5fd; }

/* welcome page (dark cream theme) needs darker text keep readable */
.tour-popover .tour-skip {
  background: none;
  border: 0;
  color: #6b7280;
  font-size: 0.82rem;
  text-decoration: underline;
  padding: 0.4rem 0.3rem;
}
