/* ============================================
   Tutorial Spotlight System
   ============================================ */

/* ── Overlay (blocks pointer events on the rest of the UI) ── */
.ii-tutorial-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: all;
}

/* ── Spotlight ring (sits above the overlay, over the target element) ── */
.ii-tutorial-spotlight {
    position: fixed;
    z-index: 10001;
    pointer-events: none;
    border-radius: var(--ii-radius-sm);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.72);
    outline: 2px solid var(--ii-accent);
    outline-offset: 0;
    opacity: 1;
    transition:
        top var(--ii-transition),
        left var(--ii-transition),
        width var(--ii-transition),
        height var(--ii-transition),
        opacity 0.2s ease;
}

.ii-tutorial-spotlight.is-hidden {
    opacity: 0;
    box-shadow: none;
    outline-color: transparent;
}

/* ── Popover card ── */
.ii-tutorial-popover {
    position: fixed;
    z-index: 10002;
    width: 320px;
    background: var(--ii-surface-white);
    border: 1px solid var(--ii-border);
    border-radius: var(--ii-radius-md);
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22), 0 4px 16px rgba(0, 0, 0, 0.10);
    opacity: 1;
    transition: opacity 0.15s ease;
    /* prevent layout thrash during initial render */
    max-width: calc(100vw - 16px);
}

.ii-tutorial-popover.is-fading {
    opacity: 0;
}

/* ── Close button ── */
.ii-tutorial-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--ii-bg-hover);
    color: var(--ii-text-secondary);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}

.ii-tutorial-close:hover {
    background: var(--ii-bg-active);
    color: var(--ii-text-primary);
}

/* ── Progress bar ── */
.ii-tutorial-progress {
    height: 3px;
    background: var(--ii-border);
    border-radius: 99px;
    margin-right: 28px;
    margin-bottom: 8px;
    overflow: hidden;
}

.ii-tutorial-progress-bar {
    height: 100%;
    background: var(--ii-accent);
    border-radius: 99px;
    transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ── Step label ── */
.ii-tutorial-step-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ii-accent);
    margin-bottom: 10px;
}

/* ── Title ── */
.ii-tutorial-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ii-text-primary);
    margin: 0 0 8px;
    padding-right: 20px;
    /* room for close btn */
    line-height: 1.35;
}

/* ── Description ── */
.ii-tutorial-desc {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--ii-text-secondary);
    margin: 0 0 20px;
}

/* ── Footer ── */
.ii-tutorial-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ii-tutorial-nav {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

/* ── Skip link ── */
.ii-tutorial-skip {
    background: none;
    border: none;
    color: var(--ii-text-tertiary);
    font-size: 13px;
    cursor: pointer;
    padding: 6px 0;
    transition: color 0.15s ease;
    white-space: nowrap;
}

.ii-tutorial-skip:hover {
    color: var(--ii-text-secondary);
}

/* ── Navigation buttons ── */
.ii-tutorial-btn-secondary,
.ii-tutorial-btn-primary {
    border: none;
    border-radius: var(--ii-radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 16px;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.ii-tutorial-btn-secondary {
    background: var(--ii-bg-hover);
    color: var(--ii-text-primary);
}

.ii-tutorial-btn-secondary:hover {
    background: var(--ii-bg-active);
}

.ii-tutorial-btn-primary {
    background: var(--ii-accent);
    color: #fff;
}

.ii-tutorial-btn-primary:hover {
    background: var(--ii-accent-hover);
}

/* ── Elevate interactive UI elements above the overlay when tutorial is active ── */
.ii-tutorial-active .ii-popper-menu,
.ii-tutorial-active .ii-super-popper-menu,
.ii-tutorial-active .ii-ctx-dropdown {
    z-index: 10001 !important;
}

.ii-tutorial-active .ii-ai-popup-panel {
    z-index: 10001 !important;
}

.ii-tutorial-active .ii-drawer {
    z-index: 10001 !important;
}

/* ── Full-dim state: collapse spotlight to 0×0 but keep box-shadow overlay ── */
.ii-tutorial-spotlight.is-full-dim {
    outline: none;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {

    .ii-tutorial-spotlight,
    .ii-tutorial-popover,
    .ii-tutorial-progress-bar {
        transition: none !important;
    }
}