/* Guided onboarding tour — vanilla, no external dependencies.
   Lives on top of the app: overlay + spotlight cutout + popover. */

.mk-tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    pointer-events: none;
    opacity: 0;
    transition: opacity .22s ease;
}
.mk-tour-overlay.is-visible { opacity: 1; }

.mk-tour-overlay-bg {
    position: absolute;
    inset: 0;
    pointer-events: auto;
    background: rgba(8, 14, 24, 0.55);
}
[data-theme="dark"] .mk-tour-overlay-bg {
    background: rgba(0, 0, 0, 0.70);
}

/* The spotlight is a transparent box with a huge box-shadow that darkens
   everything around it — cheap, GPU-friendly, no SVG mask required. */
.mk-tour-spotlight {
    position: absolute;
    border-radius: 10px;
    box-shadow: 0 0 0 9999px rgba(8, 14, 24, 0.62);
    pointer-events: none;
    transition: top .25s ease, left .25s ease, width .25s ease, height .25s ease;
    outline: 2px solid rgba(196, 69, 54, 0.85);
    outline-offset: 2px;
}
[data-theme="dark"] .mk-tour-spotlight {
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.78);
}

.mk-tour-popover {
    position: absolute;
    z-index: 2001;
    width: min(360px, calc(100vw - 32px));
    background: #ffffff;
    color: #1d2530;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    padding: 18px 20px 16px;
    pointer-events: auto;
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
    transition: top .25s ease, left .25s ease, opacity .18s ease;
}
[data-theme="dark"] .mk-tour-popover {
    background: #1d2530;
    color: #f3f5f8;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}

.mk-tour-popover.is-centered {
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%);
}

.mk-tour-popover-arrow {
    position: absolute;
    width: 14px;
    height: 14px;
    background: inherit;
    transform: rotate(45deg);
    box-shadow: -2px -2px 4px rgba(0,0,0,.05);
}
.mk-tour-popover[data-placement="top"]    .mk-tour-popover-arrow { bottom: -7px; left: 50%; margin-left: -7px; box-shadow: 2px 2px 4px rgba(0,0,0,.08); }
.mk-tour-popover[data-placement="bottom"] .mk-tour-popover-arrow { top: -7px;    left: 50%; margin-left: -7px; }
.mk-tour-popover[data-placement="left"]   .mk-tour-popover-arrow { right: -7px;  top: 50%;  margin-top: -7px; box-shadow: 2px -2px 4px rgba(0,0,0,.08); }
.mk-tour-popover[data-placement="right"]  .mk-tour-popover-arrow { left: -7px;   top: 50%;  margin-top: -7px; }
.mk-tour-popover.is-centered .mk-tour-popover-arrow { display: none; }

.mk-tour-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #c44536;
    margin-bottom: 6px;
}

.mk-tour-title {
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.25;
}

.mk-tour-body {
    font-size: .92rem;
    line-height: 1.5;
    margin: 0 0 14px;
    color: inherit;
}
.mk-tour-body p:last-child { margin-bottom: 0; }
.mk-tour-body strong { color: #c44536; }

.mk-tour-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
}

.mk-tour-progress {
    font-size: .78rem;
    color: #6b7684;
    font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .mk-tour-progress { color: #9aa5b4; }

.mk-tour-buttons {
    display: inline-flex;
    gap: 6px;
}

.mk-tour-btn {
    border: none;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform .08s ease, background .15s ease, color .15s ease;
}
.mk-tour-btn:active { transform: translateY(1px); }

.mk-tour-btn.is-skip {
    background: transparent;
    color: #6b7684;
}
.mk-tour-btn.is-skip:hover { color: #1d2530; }
[data-theme="dark"] .mk-tour-btn.is-skip { color: #9aa5b4; }
[data-theme="dark"] .mk-tour-btn.is-skip:hover { color: #f3f5f8; }

.mk-tour-btn.is-back {
    background: #eef0f3;
    color: #1d2530;
}
.mk-tour-btn.is-back:hover { background: #dde1e6; }
[data-theme="dark"] .mk-tour-btn.is-back { background: #2b3340; color: #f3f5f8; }
[data-theme="dark"] .mk-tour-btn.is-back:hover { background: #3a4452; }

.mk-tour-btn.is-next {
    background: #c44536;
    color: #ffffff;
}
.mk-tour-btn.is-next:hover { background: #a83a2d; }

.mk-tour-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: transparent;
    border: none;
    color: #6b7684;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
}
.mk-tour-close:hover { color: #1d2530; background: rgba(0,0,0,.05); }
[data-theme="dark"] .mk-tour-close:hover { color: #f3f5f8; background: rgba(255,255,255,.08); }

/* When a step has no valid anchor we render the popover centered and skip
   the spotlight entirely — the screen just dims. */
.mk-tour-overlay.is-no-target .mk-tour-spotlight { display: none; }

@media (max-width: 520px) {
    .mk-tour-popover { width: calc(100vw - 24px); }
    .mk-tour-title { font-size: 1.1rem; }
}

/* Small launcher button we expose in the navbar user menu so people can
   re-run the tour on-demand (also accessible from /account/preferences). */
.mk-tour-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px dashed rgba(196, 69, 54, .5);
    border-radius: 8px;
    background: transparent;
    color: #c44536;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
}
.mk-tour-trigger:hover { background: rgba(196, 69, 54, .08); }
