/* Explore mode overlay (assets/explore.js). Scoped to .mira-explore-* so it
   never touches anything else. Colours reuse the navbar accent (#0d6efd) and
   the RAG palette from dashAgGridComponentFunctions.js. */

/* Scroll is tracked, not locked, while explore mode is open — explore.js re-measures
   pins/cutouts on scroll. The body.mira-explore-open class stays as a state hook. */

/* pointer-events: none so wheel/scroll/touch pass through to the page's scroller
   (#page-content-wrapper) — the page keeps scrolling while explore is open. The
   interactive bits (pins, popover, exit bar) re-enable pointer-events below; an
   outside-click-to-close handler in explore.js swallows clicks on the page. */
.mira-explore-overlay { position: fixed; inset: 0; z-index: 20000; pointer-events: none; }
.mira-explore-scrim   { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }

/* pins — visible frame + numbered dot */
.mira-explore-pins { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
/* momentary state while explore.js probes elementFromPoint to forward a wheel
   scroll to the page's real scroller — pins must not intercept that hit-test */
.mira-explore-overlay.mira-explore-nohit .mira-explore-pin,
.mira-explore-overlay.mira-explore-nohit .mira-explore-popover { pointer-events: none; }
.mira-explore-pin {
    position: absolute; pointer-events: auto; background: transparent;
    border: 2px solid #0d6efd; border-radius: 8px; cursor: pointer; padding: 0;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25); transition: box-shadow 0.15s, border-color 0.15s;
}
.mira-explore-pin:hover, .mira-explore-pin.is-active {
    border-color: #0b5ed7; box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.45);
}
.mira-explore-pin__dot {
    position: absolute; top: -11px; right: -11px; width: 22px; height: 22px;
    border-radius: 50%; background: #0d6efd; color: #fff; font-size: 0.8rem;
    font-weight: 700; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* focus state: a per-pin popover is open — spotlight the active region */
.mira-explore-overlay.has-active .mira-explore-pin {
    opacity: 0.45; transition: opacity 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.mira-explore-overlay.has-active .mira-explore-pin.is-active {
    opacity: 1; border-color: #0b5ed7; background: rgba(13, 110, 253, 0.10);
    box-shadow: 0 0 0 5px rgba(13, 110, 253, 0.55);
}
.mira-explore-overlay.has-active .mira-explore-pin.is-active .mira-explore-pin__dot {
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

/* popover */
.mira-explore-popover {
    position: absolute; z-index: 3; background: #fff; color: #212529;
    border-radius: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
    max-width: 440px; padding: 22px 24px 18px; pointer-events: auto;
}
.mira-explore-popover h3 { font-size: 1.2rem; font-weight: 700; margin: 0 0 6px; }
.mira-explore-popover .body { font-size: 0.95rem; line-height: 1.55; color: #343a40; }
.mira-explore-popover .body p { margin: 0 0 10px; }
.mira-explore-popover .body p:last-child { margin-bottom: 0; }

.mira-explore-kicker { display: block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #0d6efd; margin-bottom: 8px; }
.mira-explore-legend { list-style: none; margin: 4px 0 10px; padding: 0; }
.mira-explore-legend li { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 0.88rem; }
.mira-explore-chip { width: 14px; height: 14px; border-radius: 3px; flex: 0 0 auto; }
.mira-explore-chip--crit { background: #FFCFC3; }
.mira-explore-chip--warn { background: #FFF2A5; }
.mira-explore-chip--ok { background: #B8FB66; }
.mira-explore-chip--auto { background: #DBEAFE; }
.mira-explore-chip--review { background: #FFF2A5; }
.mira-explore-chip--done { background: #60A5FA; }

/* exit bar */
.mira-explore-bar {
    position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 2;
    display: flex; align-items: center; gap: 16px; background: #212529; color: #fff;
    padding: 8px 14px; border-radius: 999px; font-size: 0.9rem; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
}
.mira-explore-exit { background: rgba(255, 255, 255, 0.15); color: #fff; border: none; border-radius: 999px; padding: 4px 12px; cursor: pointer; }
.mira-explore-exit:hover { background: rgba(255, 255, 255, 0.28); }

/* the ? button — moved here from styles.css */
.mira-explore-btn {
    width: 34px; height: 34px; border-radius: 50%; border: none; background: transparent;
    color: rgba(255, 255, 255, 0.7); cursor: pointer; display: flex; align-items: center; justify-content: center;
    padding: 0; margin-right: 12px; vertical-align: middle; transition: color 0.15s, background-color 0.15s;
}
.mira-explore-btn:hover, .mira-explore-btn.is-active { color: #fff; background-color: rgba(255, 255, 255, 0.1); }

/* ----------------------------------------------------------------------------
   Tour mode (assets/explore.js → window.MiraTour). Reuses the explore scrim and
   popover card; adds a single spotlight frame and forward-only action buttons.
   pointer-events:none on the overlay so the highlighted nav target stays
   clickable and the page keeps scrolling underneath.
---------------------------------------------------------------------------- */
.mira-tour-overlay { position: fixed; inset: 0; z-index: 20000; pointer-events: none; }
/* momentary state while explore.js probes elementFromPoint to forward a wheel
   scroll past the popover to the page's real scroller */
.mira-tour-overlay.mira-tour-nohit .mira-explore-popover { pointer-events: none; }

/* spotlight frame around the current step's element */
.mira-tour-frame {
    position: absolute; pointer-events: none; z-index: 1;
    border: 2px solid #0d6efd; border-radius: 8px;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}
/* action steps pulse to draw the eye to the nav target to click */
.mira-tour-frame--action { animation: mira-tour-pulse 1.4s ease-in-out infinite; }
@keyframes mira-tour-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.35); }
    50%      { box-shadow: 0 0 0 8px rgba(13, 110, 253, 0.10); }
}

/* centered Hello window — same card, no pin anchor */
.mira-explore-popover--intro {
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    max-width: 460px; text-align: left;
}

/* drill-down hint — "click the highlighted grid to continue" */
.mira-tour-hint { margin-top: 14px; font-size: 0.92rem; font-weight: 600; color: #0d6efd; }

/* forward-only controls (Next / Skip) */
.mira-tour-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.mira-tour-btn {
    background: #0d6efd; color: #fff; border: none; border-radius: 6px;
    padding: 6px 14px; font-size: 0.88rem; cursor: pointer; transition: background-color 0.15s;
}
.mira-tour-btn:hover { background: #0b5ed7; }
.mira-tour-btn--ghost { background: transparent; color: #6c757d; border: 1px solid #dee2e6; }
.mira-tour-btn--ghost:hover { background: #f8f9fa; color: #495057; }
