/* Guided "Show me where" tours — coach-mark overlay: dark veil with spotlight holes, a glowing
   ring + arrow + caption bubble anchored to the target. Teal (#008080) accents match the app. */

.guided-tour-root {
    position: fixed;
    inset: 0;
    /* z-index set inline by the engine so it always beats modal overlays. */
}

/* Transparent layer that captures stray clicks so the user stays on-script. */
.guided-tour-blocker {
    position: fixed;
    inset: 0;
    background: transparent;
    cursor: default;
}

/* A compact "Show me where" link for use mid-sentence (inside a list item or paragraph), where the
   full btn-actions button would break the flow of the text. */
.help-topic-tour-link--inline {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    margin-left: 6px;
    padding: 1px 8px;
    border: 1px solid rgba(0, 128, 128, 0.35);
    border-radius: 999px;
    background: rgba(0, 128, 128, 0.06);
    color: #008080;
    font-size: 0.82em;
    font-weight: 600;
    line-height: 1.5;
    cursor: pointer;
    vertical-align: baseline;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.help-topic-tour-link--inline:hover {
    background: rgba(0, 128, 128, 0.14);
    border-color: #008080;
}

/* Cross-page steps render the other page in a full-screen iframe, layered above the real page but
   below the tour overlay (z-index set inline). Kept laid out (visibility, not display) while
   inactive so it stays loaded and its elements keep measurable geometry. */
.guided-tour-frame {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    border: 0;
    visibility: hidden;
    pointer-events: none;
}

.guided-tour-frame--active {
    visibility: visible;
}

/* The dark veil, drawn on a canvas. pointer-events:none so it never eats clicks (the blocker does). */
.guided-tour-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

/* The spotlight never animates its position: step reveals wait for the target to settle, then snap
   into place, and live scroll/zoom/resize tracking is instant. No transition on geometry. */

/* Glowing border drawn around each spotlighted target. */
.guided-tour-ring {
    position: fixed;
    border: 2px solid #008080;
    border-radius: 10px;
    box-shadow: 0 0 0 3px rgba(0, 128, 128, 0.35), 0 0 18px 4px rgba(0, 128, 128, 0.55);
    pointer-events: none;
    animation: guided-tour-ring-pulse 1.8s ease-in-out infinite;
}

@keyframes guided-tour-ring-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(0, 128, 128, 0.30), 0 0 16px 3px rgba(0, 128, 128, 0.45); }
    50%      { box-shadow: 0 0 0 4px rgba(0, 128, 128, 0.45), 0 0 24px 6px rgba(0, 128, 128, 0.70); }
}

/* The caption bubble. */
.guided-tour-tooltip {
    position: fixed;
    left: 0;
    top: 0;
    width: 340px;
    max-width: calc(100vw - 24px);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    padding: 18px 20px 14px;
    color: #222;
    animation: guided-tour-tooltip-in 0.28s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes guided-tour-tooltip-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.guided-tour-tooltip__title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #008080;
    margin-bottom: 6px;
}

.guided-tour-tooltip__body {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #444;
}

/* Rich text authored in a step's body (bold, emphasis, paragraphs, lists). */
.guided-tour-tooltip__body strong { font-weight: 600; color: #222; }
.guided-tour-tooltip__body em { font-style: italic; }
.guided-tour-tooltip__body p { margin: 0 0 8px; }
.guided-tour-tooltip__body p:last-child { margin-bottom: 0; }
.guided-tour-tooltip__body ul,
.guided-tour-tooltip__body ol { margin: 6px 0; padding-left: 20px; }
.guided-tour-tooltip__body li { margin-bottom: 4px; }

.guided-tour-tooltip__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
}

.guided-tour-tooltip__count {
    font-size: 0.78rem;
    color: #888;
}

.guided-tour-tooltip__actions {
    display: flex;
    gap: 8px;
}

.guided-tour-tooltip__skip {
    background: transparent;
    border: none;
    color: #888;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
}

.guided-tour-tooltip__skip:hover {
    color: #555;
    background: #f2f2f2;
}

.guided-tour-tooltip__next {
    background: #008080;
    border: none;
    color: #fff;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    padding: 7px 18px;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.guided-tour-tooltip__next:hover {
    background: #006a6a;
}

/* Arrow: a small rotated square anchored on the bubble edge facing the target. */
.guided-tour-arrow {
    position: fixed;
    width: 14px;
    height: 14px;
    background: #ffffff;
    transform: translate(-50%, -50%) rotate(45deg);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    pointer-events: none;
}

/* Nudge the arrow so its flat side kisses the bubble edge on the relevant side. */
.guided-tour-arrow--bottom { transform: translate(-50%, -30%) rotate(45deg); }
.guided-tour-arrow--top    { transform: translate(-50%, -70%) rotate(45deg); }
.guided-tour-arrow--right  { transform: translate(-30%, -50%) rotate(45deg); }
.guided-tour-arrow--left   { transform: translate(-70%, -50%) rotate(45deg); }

/* While a tour runs, soften every open modal's dark backdrop — the tour canvas already darkens the
   page, so stacking full-strength modal veils under it would make things progressively too dark.
   The slid-away Help Topics viewer keeps its own fully-transparent rule below (so it never re-dims
   the spotlighted target beneath the canvas holes). */
body.guided-tour-active .modal-window-overlay:not(.guided-tour-hidden),
body.guided-tour-active .modal-option-choice-overlay {
    background: rgba(0, 0, 0, 0.2) !important;
}

/* ── Help Topics viewer slides away while a tour runs ── */
/* Base transition lives on the container so both the slide-out and the slide-back animate.
   Played regardless of prefers-reduced-motion (per project preference). */
.modal-window-container.help-topic-modal-container {
    transition: transform 0.42s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.42s ease;
}

/* While hidden for a tour, drop the viewer's dark backdrop too — otherwise it stays full-screen
   below the tour canvas and dims the spotlighted cog (which lives in the navbar, beneath it). */
.modal-window-overlay.guided-tour-hidden {
    pointer-events: none;
    background: transparent !important;
}

.modal-window-overlay.guided-tour-hidden .modal-window-container.help-topic-modal-container {
    transform: translateX(-115%) !important;
    opacity: 0;
}
