/* onboard-walkthrough.css — Scripted action-gated onboarding overlay */

/* Hide the inbox +New button during the demo. The walkthrough no longer
   funnels through it, and a stray "create message" affordance just
   confuses first-run users. Real tenants (no .demo-mode body class)
   keep the button. */
body.demo-mode #inboxAddBtn { display: none !important; }


/* ── Overlay container ── */
.ow-overlay {
  position: fixed;
  inset: 0;
  z-index: 99000;
  pointer-events: none;
}
.ow-overlay[hidden] { display: none !important; }

/* ── Card ── */
.ow-card {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  /* Match other modals/panels — they use --surface (white) rather than
     --bg (which resolves to the page-body grey on this theme). */
  background: var(--surface, #fff);
  color: var(--text, #111);
  border: 1px solid var(--border, #ddd);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 20px 56px rgba(0,0,0,0.28);
  pointer-events: auto;
  font-size: 0.95rem;
  line-height: 1.5;
  animation: owCardIn 0.35s ease-out;
}
@keyframes owCardIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ow-progress {
  font-size: 0.72rem;
  color: var(--muted, #888);
  margin-bottom: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}

.ow-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 12px 0;
  color: #0f172a;
}

.ow-body {
  color: var(--muted, #555);
  margin: 0 0 16px 0;
  white-space: pre-wrap;
}

.ow-note {
  font-size: 0.82rem;
  color: var(--muted, #777);
  font-style: italic;
  margin: -8px 0 14px 0;
  padding-left: 12px;
  border-left: 3px solid #e2e8f0;
}

.ow-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.ow-skip, .ow-back, .ow-next {
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.ow-skip {
  background: transparent;
  color: var(--muted, #888);
}
.ow-skip:hover { color: #555; }

.ow-back {
  background: var(--bg, #f3f4f6);
  color: var(--text, #333);
  border: 1px solid var(--border, #ddd);
}

.ow-next {
  background: #16a34a;
  color: #fff;
  font-weight: 600;
  min-width: 90px;
  transition: background 0.15s, opacity 0.15s;
}
.ow-next:hover { background: #15803d; }
.ow-next:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #94a3b8 !important;
}

.ow-go-live {
  background: #16a34a !important;
  font-weight: 700 !important;
  font-size: 0.95rem !important;
  padding: 10px 20px !important;
}
.ow-go-live:hover { background: #15803d !important; }

/* ── Spotlight ring ── */
/* Three layers stacked via box-shadow:
 *   1. 3px green ring (the visible highlight border)
 *   2. 9999px outset dim — darkens everything outside the box
 *   3. inset white wash — brightens the area inside the box so the
 *      highlighted element reads as a clean white tile lifted above
 *      the dimmed page (rather than just "the un-dimmed bit"). The
 *      wash is alpha-blended so the underlying text/icon is still
 *      visible, just on a more saturated white base. */
.ow-spotlight {
  position: fixed;
  z-index: 98500;
  border-radius: 10px;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.55);
  box-shadow:
    0 0 0 3px #16a34a,
    0 0 0 9999px rgba(0,0,0,0.45),
    inset 0 0 0 9999px rgba(255,255,255,0.55);
  transition: top 0.25s, left 0.25s, width 0.25s, height 0.25s;
}

/* Subtle pulse on the actual target element */
.ow-highlight-pulse {
  animation: owPulse 1.4s ease-in-out infinite;
  position: relative;
  z-index: 98501;
}
@keyframes owPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); }
  50%       { box-shadow: 0 0 0 8px rgba(22,163,74,0.15); }
}

/* ── Responsive ──
   Mobile behaviour is driven by Tailwind utility classes baked into the
   JS template (see renderCard in onboard-walkthrough.js). Two stateful
   bits remain here because Tailwind's arbitrary attribute variants
   (`data-[collapsed=1]:`) aren't always reliable through the CDN JIT
   for nested selectors:

   • Collapsed-state child hiding (.ow-body / .ow-actions go away when
     the card is folded down to a thin header).
   • Approval-panel-open repositioning (the slide-up sheet would cover
     the bottom-anchored card, so we push it to the top instead). */
@media (max-width: 640px) {
  .ow-card[data-collapsed="1"] .ow-body,
  .ow-card[data-collapsed="1"] .ow-actions { display: none; }
  body:has(#approvalPanel.open) .ow-card {
    top: 0.5rem;
    bottom: auto;
    max-height: 32vh;
  }
  /* Always-on scrollbar inside the modal body — iOS Safari hides the
     native scrollbar by default, so steps with long bodies (e.g. S08
     "two ways your to-do list grows…" with two numbered points) read
     as if there's only one. */
  .ow-card .ow-body {
    scrollbar-width: thin;
    scrollbar-color: rgba(15,23,42,0.35) rgba(15,23,42,0.08);
  }
  .ow-card .ow-body::-webkit-scrollbar { width: 6px; }
  .ow-card .ow-body::-webkit-scrollbar-track {
    background: rgba(15,23,42,0.08);
    border-radius: 3px;
  }
  .ow-card .ow-body::-webkit-scrollbar-thumb {
    background: rgba(15,23,42,0.4);
    border-radius: 3px;
  }
  /* "Scroll for more" hint — added by JS as a sibling element when
     the body content overflows. Sits below the body, above the
     action buttons, and animates a subtle bounce so it reads as an
     affordance, not chrome. JS removes it once the user has
     scrolled past the threshold. */
  .ow-scroll-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.72rem;
    color: var(--muted, #64748b);
    margin: -4px 0 8px 0;
    padding: 2px 0;
    animation: owScrollBounce 1.6s ease-in-out infinite;
  }
  .ow-scroll-hint[data-done="1"] { display: none; }
  @keyframes owScrollBounce {
    0%, 100% { transform: translateY(0); opacity: 0.7; }
    50%      { transform: translateY(2px); opacity: 1; }
  }
}
