/* ── TaskPilot Guided Tour ─────────────────────────────────────────────────── */

/* Backdrop — full-screen click blocker; background set by JS */
.tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    pointer-events: all;
    transition: background 0.26s ease;
}

/* Spotlight ring — box-shadow creates the surrounding dim + accent outline */
.tour-spotlight {
    position: fixed;
    z-index: 9001;
    border-radius: 16px;
    pointer-events: none;
    box-shadow:
        0 0 0 9999px rgba(8, 12, 22, 0.66),
        0 0 0 2px rgba(249, 115, 22, 0.70),
        0 0 28px rgba(249, 115, 22, 0.18);
    transition:
        left   0.30s cubic-bezier(0.4, 0, 0.2, 1),
        top    0.30s cubic-bezier(0.4, 0, 0.2, 1),
        width  0.30s cubic-bezier(0.4, 0, 0.2, 1),
        height 0.30s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tooltip card */
.tour-tooltip {
    position: fixed;
    z-index: 9002;
    width: min(380px, calc(100vw - 32px));
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-lg);
    box-shadow:
        0 0 0 1px rgba(249, 115, 22, 0.12),
        var(--shadow-lg);
    overflow: hidden;
    animation: tour-tt-in 0.22s cubic-bezier(0.34, 1.28, 0.64, 1) both;
    pointer-events: all;
}

@keyframes tour-tt-in {
    from { opacity: 0; transform: scale(0.94) translateY(6px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Progress bar strip */
.tour-progress {
    height: 3px;
    background: var(--surface-3);
    width: 100%;
}

.tour-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 0 999px 999px 0;
    transition: width 0.32s ease;
}

/* Inner padding wrapper */
.tour-inner {
    padding: 20px 20px 18px;
    position: relative;
}

/* Close button */
.tour-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-3);
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s ease, color 0.12s ease;
    z-index: 1;
}
.tour-close:hover {
    background: var(--surface-3);
    color: var(--text-1);
}

/* Step counter */
.tour-counter {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-4);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

/* Title */
.tour-h {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-1);
    letter-spacing: -0.03em;
    line-height: 1.22;
    margin-bottom: 10px;
    padding-right: 28px;
}

/* Body text */
.tour-p {
    font-size: 13.5px;
    line-height: 1.62;
    color: var(--text-2);
    margin-bottom: 0;
}

/* Footer row */
.tour-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 20px 18px;
    border-top: 1px solid var(--border-soft);
    margin-top: 16px;
}

.tour-footer-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Buttons */
.tour-btn {
    height: 36px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.14s ease, border-color 0.14s ease, transform 0.12s ease;
}
.tour-btn:hover { transform: translateY(-1px); }
.tour-btn:active { transform: none; }

.tour-btn--pri {
    background: var(--accent);
    border: 1px solid rgba(249, 115, 22, 0.22);
    color: #ffffff;
    box-shadow: 0 3px 12px rgba(249, 115, 22, 0.28);
}
.tour-btn--pri:hover {
    background: var(--accent-strong);
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.36);
}

.tour-btn--sec {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-2);
    box-shadow: var(--shadow-xs);
}
.tour-btn--sec:hover {
    background: var(--surface-3);
    border-color: var(--border-strong);
    color: var(--text-1);
}

.tour-btn--ghost {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-3);
}
.tour-btn--ghost:hover {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--text-2);
}

/* Done step: stacked CTA buttons */
.tour-done-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}
.tour-btn--full {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
}

/* Footer layout when done-actions is present */
.tour-footer:has(.tour-done-actions) {
    flex-direction: column;
    align-items: stretch;
}
.tour-footer:has(.tour-done-actions) > span:first-child {
    display: none;
}
.tour-footer:has(.tour-done-actions) .tour-footer-right {
    width: 100%;
}

/* ── Center mode overlay (no spotlight target) ───────────────── */
.tour-overlay--dim {
    background: rgba(8, 12, 22, 0.70);
}

/* ── Light mode refinements ──────────────────────────────────── */
[data-theme="light"] .tour-spotlight {
    box-shadow:
        0 0 0 9999px rgba(12, 18, 30, 0.52),
        0 0 0 2px rgba(249, 115, 22, 0.72),
        0 0 24px rgba(249, 115, 22, 0.20);
}

[data-theme="light"] .tour-overlay--dim {
    background: rgba(12, 18, 30, 0.52);
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .tour-spotlight {
        box-shadow:
            0 0 0 9999px rgba(12, 18, 30, 0.52),
            0 0 0 2px rgba(249, 115, 22, 0.72),
            0 0 24px rgba(249, 115, 22, 0.20);
    }
    :root:not([data-theme="dark"]) .tour-overlay--dim {
        background: rgba(12, 18, 30, 0.52);
    }
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 680px) {
    .tour-tooltip {
        width: calc(100vw - 24px) !important;
        left: 12px !important;
        right: auto !important;
        top: auto !important;
        bottom: 16px !important;
        transform: none !important;
        position: fixed !important;
        max-height: 70vh;
        overflow-y: auto;
    }

    .tour-spotlight {
        display: none !important;
    }

    .tour-overlay {
        background: rgba(8, 12, 22, 0.66) !important;
    }
}
