/* ==========================================================================
 * Onboarding tour — spotlight overlay, click-gating, tooltip card.
 * Loaded site-wide; only renders when the tour engine activates it.
 * ========================================================================== */

:root {
    --ws-tour-accent: #9c1c34;
    --ws-tour-scrim: rgba(15, 23, 42, 0.62);
    --ws-tour-z: 100000;
}

/* The animated dim: a transparent hole with a giant box-shadow darkening the rest. */
.ws-tour-hole {
    position: fixed;
    z-index: var(--ws-tour-z);
    border-radius: 12px;
    box-shadow: 0 0 0 9999px var(--ws-tour-scrim);
    pointer-events: none;
    transition: top 0.3s cubic-bezier(0.4, 0, 0.2, 1), left 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        width 0.3s cubic-bezier(0.4, 0, 0.2, 1), height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Pulsing highlight ring around the spotlighted element. */
.ws-tour-ring {
    position: fixed;
    z-index: calc(var(--ws-tour-z) + 2);
    border-radius: 12px;
    border: 2px solid var(--ws-tour-accent);
    pointer-events: none;
    box-shadow: 0 0 0 0 rgba(156, 28, 52, 0.45);
    transition: top 0.3s, left 0.3s, width 0.3s, height 0.3s;
    animation: wsTourPulse 1.8s ease-out infinite;
}
@keyframes wsTourPulse {
    0% { box-shadow: 0 0 0 0 rgba(156, 28, 52, 0.45); }
    70% { box-shadow: 0 0 0 12px rgba(156, 28, 52, 0); }
    100% { box-shadow: 0 0 0 0 rgba(156, 28, 52, 0); }
}

/* Transparent click-blockers (4 around the hole) — only the hole stays clickable. */
.ws-tour-block {
    position: fixed;
    z-index: calc(var(--ws-tour-z) + 1);
    background: transparent;
    pointer-events: auto;
}

/* Full-screen scrim for centered (modal) steps. */
.ws-tour-scrim {
    position: fixed;
    inset: 0;
    z-index: var(--ws-tour-z);
    background: var(--ws-tour-scrim);
    pointer-events: auto;
}

/* Tooltip / step card. */
.ws-tour-card {
    position: fixed;
    z-index: calc(var(--ws-tour-z) + 3);
    width: min(340px, calc(100vw - 32px));
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 40px -8px rgba(15, 23, 42, 0.45);
    padding: 18px 20px 16px;
    pointer-events: auto;
    animation: wsTourCardIn 0.22s ease-out;
    text-transform: none; /* override any inherited capitalize */
}
.ws-tour-card__title, .ws-tour-card__body, .ws-tour-card__progress,
.ws-tour-btn, .ws-tour-card__cue { text-transform: none; }
.ws-tour-card--center {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(440px, calc(100vw - 32px));
    text-align: center;
    padding: 28px 28px 22px;
}
@keyframes wsTourCardIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
.ws-tour-card--center { animation: wsTourCenterIn 0.25s ease-out; }
@keyframes wsTourCenterIn {
    from { opacity: 0; transform: translate(-50%, -46%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

/* Little pointer arrow toward the target. */
.ws-tour-card__arrow {
    position: absolute;
    width: 14px;
    height: 14px;
    background: #ffffff;
    transform: rotate(45deg);
}

.ws-tour-card__eyebrow {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ws-tour-accent);
    margin: 0 0 6px;
}
.ws-tour-card__title {
    font-size: 1.1rem;
    font-weight: 750;
    color: #0f172a;
    margin: 0 0 8px;
    line-height: 1.25;
}
.ws-tour-card__body {
    font-size: 0.9rem;
    line-height: 1.55;
    color: #475569;
    margin: 0 0 16px;
}
.ws-tour-card__body strong { color: #0f172a; }

.ws-tour-card__foot {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
}
.ws-tour-card--center .ws-tour-card__foot { justify-content: center; }
.ws-tour-card__progress {
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
}
.ws-tour-card__btns { display: flex; gap: 8px; align-items: center; }

.ws-tour-btn {
    font: inherit;
    font-size: 0.85rem;
    font-weight: 650;
    border-radius: 9px;
    padding: 8px 14px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: filter 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}
.ws-tour-btn--primary { background: linear-gradient(180deg, #b3203f, #8c1a2b); color: #fff; }
.ws-tour-btn--primary:hover { filter: brightness(1.06); }
.ws-tour-btn--ghost { background: transparent; color: #475569; border-color: #e2e8f0; padding: 8px 12px; }
.ws-tour-btn--ghost:hover { background: #f8fafc; }
.ws-tour-btn--link { background: transparent; color: #94a3b8; border: none; padding: 8px 4px; font-weight: 600; }
.ws-tour-btn--link:hover { color: #475569; text-decoration: underline; }

/* "Click the highlighted item" hint for guided-navigation steps. */
.ws-tour-card__cue {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ws-tour-accent);
}
.ws-tour-card__cue::before { content: "👉"; }

/* Topbar launcher button. */
.ws-tour-launch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #4338ca;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    white-space: nowrap;
}
.ws-tour-launch:hover { background: #e0e7ff; }

@media (max-width: 640px) {
    .ws-tour-launch span { display: none; }
}

/* Mobile bottom-sheet card (class applied by the engine on phones). */
.ws-tour-card--sheet {
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    border-radius: 18px;
    padding: 18px 18px 14px;
    box-shadow: 0 8px 30px -6px rgba(15, 23, 42, 0.4);
    animation: wsTourSheetIn 0.2s ease-out;
}
@keyframes wsTourSheetIn {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}
.ws-tour-card--sheet .ws-tour-card__title { font-size: 1.15rem; }
.ws-tour-card--sheet .ws-tour-card__body { font-size: 0.95rem; }
/* Stack the footer so Back/Next get full-width room (no cramming on small screens). */
.ws-tour-card--sheet .ws-tour-card__foot { flex-direction: column; align-items: stretch; gap: 10px; }
.ws-tour-card--sheet .ws-tour-card__btns { order: 1; width: 100%; gap: 10px; flex-wrap: wrap; }
.ws-tour-card--sheet .ws-tour-card__btns .ws-tour-btn { flex: 1 1 0; padding: 12px 10px; font-size: 0.95rem; }
.ws-tour-card--sheet .ws-tour-card__progress { order: 2; text-align: center; }
.ws-tour-card--sheet .ws-tour-card__cue { order: 1; width: 100%; justify-content: center; padding: 10px 0; font-size: 0.92rem; }
.ws-tour-card--sheet .ws-tour-btn--link { display: block; width: 100%; text-align: center; margin-top: 4px; }
