/* Driver.js popover theming — matches the DataCentral Display admin look
   (light + dark via [data-theme]). The engine sets popoverClass 'app-tour'
   on every tour (tour-engine.js). Solid background on purpose: the admin's
   --surface is semi-transparent in dark mode, which reads badly over the
   dimmed tour overlay. */
.driver-popover.app-tour {
  --tour-popover-bg: #ffffff;
  background: var(--tour-popover-bg);
  color: var(--text, #111827);
  border-radius: var(--radius, 12px);
  padding: 16px;
  font-family: var(--font-body, "IBM Plex Sans", sans-serif);
  max-width: 21rem;
  box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));
}
.driver-popover.app-tour .driver-popover-title {
  font-family: var(--font-heading, "Space Grotesk", sans-serif);
  font-size: 1rem;
}
.driver-popover.app-tour .driver-popover-description {
  color: var(--text-soft, #374151);
}
.driver-popover.app-tour .driver-popover-progress-text {
  color: var(--muted, #6b7280);
}
.driver-popover.app-tour .driver-popover-next-btn,
.driver-popover.app-tour .driver-popover-done-btn {
  background: var(--accent, #7c3aed);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 5px 13px;
  text-shadow: none;
}
.driver-popover.app-tour .driver-popover-prev-btn {
  border-radius: 8px;
  padding: 5px 13px;
}
.driver-popover.app-tour .driver-popover-arrow-side-left { border-left-color: var(--tour-popover-bg); }
.driver-popover.app-tour .driver-popover-arrow-side-right { border-right-color: var(--tour-popover-bg); }
.driver-popover.app-tour .driver-popover-arrow-side-top { border-top-color: var(--tour-popover-bg); }
.driver-popover.app-tour .driver-popover-arrow-side-bottom { border-bottom-color: var(--tour-popover-bg); }

[data-theme="dark"] .driver-popover.app-tour {
  --tour-popover-bg: #0b1022;
  color: #f8fafc;
}
[data-theme="dark"] .driver-popover.app-tour .driver-popover-title { color: #f8fafc; }
[data-theme="dark"] .driver-popover.app-tour .driver-popover-description { color: #e2e8f0; }
[data-theme="dark"] .driver-popover.app-tour .driver-popover-progress-text,
[data-theme="dark"] .driver-popover.app-tour .driver-popover-close-btn { color: #9aa4c7; }
[data-theme="dark"] .driver-popover.app-tour .driver-popover-prev-btn {
  background: transparent;
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.3);
}

/* Floating help button + menu (TourHost.tsx). Bottom-right; the version badge
   owns bottom-left and the LogPane docks along the bottom when enabled. */

/* The modal backdrop (z-index 50) sits below the tour host (90); rather than
   reshuffling the app's stacking order, hide the tour widget while any modal
   is open so it can't float above or interact through the dimmed layer. */
body:has(.modal-backdrop) .tour-host {
  display: none;
}

.tour-host {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.tour-help-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--surface, #ffffff);
  color: var(--text-soft, #374151);
  font-size: 18px;
  font-weight: 600;
  font-family: var(--font-heading, "Space Grotesk", sans-serif);
  box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));
  cursor: pointer;
  transition: transform 0.15s ease;
}
.tour-help-button:hover {
  transform: scale(1.06);
}
.tour-resume-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--surface, #ffffff);
  color: var(--text-soft, #374151);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));
  cursor: pointer;
  transition: transform 0.15s ease;
}
.tour-resume-chip:hover {
  transform: scale(1.04);
}
.tour-menu {
  width: 264px;
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius, 12px);
  box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));
  padding: 12px;
}
[data-theme="dark"] .tour-menu,
[data-theme="dark"] .tour-help-button,
[data-theme="dark"] .tour-resume-chip {
  background: #0b1022;
}
.tour-menu-title {
  font-family: var(--font-heading, "Space Grotesk", sans-serif);
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text, #111827);
}
.tour-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: none;
  border-radius: 8px;
  padding: 7px 8px;
  font-size: 13px;
  color: var(--text, #111827);
  text-align: left;
  cursor: pointer;
}
.tour-menu-item:hover {
  background: var(--surface-soft, #f3f4f6);
}
.tour-menu-item-icon {
  width: 16px;
  flex: none;
  text-align: center;
  color: var(--accent, #7c3aed);
}
.tour-menu-item-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tour-menu-item-progress {
  flex: none;
  font-size: 11px;
  color: var(--muted, #6b7280);
}
.tour-menu-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border, #e5e7eb);
}
.tour-menu-manual {
  padding: 2px 8px;
  font-size: 12.5px;
  color: var(--accent, #7c3aed);
  text-decoration: none;
}
.tour-menu-manual:hover {
  text-decoration: underline;
}
.tour-menu-hide {
  border: none;
  background: none;
  padding: 2px 8px;
  font-size: 11.5px;
  color: var(--muted, #6b7280);
  cursor: pointer;
}
.tour-menu-hide:hover {
  color: var(--text-soft, #374151);
  text-decoration: underline;
}
