/* ============================================================
   MIRANDA'S LIST TOUR — ml-tour.css
   Guided tooltip tour overlay, spotlight cutout, tooltip card,
   arrow, step indicator, and responsive mobile styles.
   ============================================================ */

/* ── Overlay with spotlight cutout ── */
.ml-tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0, 0, 0, 0.55);
    transition: clip-path 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

/* ── Spotlight fade gradient ── */
/* Soft dissolve at the bottom of clamped spotlights (e.g. cookbook grid) */
.ml-tour-fade {
    position: fixed;
    z-index: 9000; /* Same as overlay, sits inside the cutout */
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.55) 100%
    );
    transition: opacity 0.35s ease, top 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ml-tour-fade-visible {
    opacity: 1;
}

/* ── Tooltip card ── */
.ml-tour-tooltip {
    position: fixed;
    z-index: 9001;
    max-width: 320px;
    width: max-content;
    background: var(--surface);
    border-radius: 1.25rem;
    box-shadow: var(--card-shadow-lg);
    padding: 1.25rem;
    font-family: 'Quicksand', sans-serif;
    opacity: 0;
    transform: translateY(8px);
    /* Smooth glide between steps — top/left for position, opacity/transform for fade */
    transition: opacity 0.3s ease, transform 0.3s ease, top 0.4s cubic-bezier(0.4, 0, 0.2, 1), left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ml-tour-tooltip.ml-tour-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Position-aware slide direction */
.ml-tour-tooltip[data-position="bottom"] {
    transform: translateY(-8px);
}
.ml-tour-tooltip[data-position="bottom"].ml-tour-visible {
    transform: translateY(0);
}

/* Centered tooltip (welcome / done steps) */
.ml-tour-tooltip[data-position="center"] {
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(0.95);
}
.ml-tour-tooltip[data-position="center"].ml-tour-visible {
    transform: translate(-50%, -50%) scale(1);
}

/* ── Tooltip arrow ── */
.ml-tour-arrow {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--surface);
    transform: rotate(45deg);
    border-radius: 2px;
}

/* Arrow positioning based on tooltip direction */
.ml-tour-tooltip[data-position="top"] .ml-tour-arrow {
    bottom: -6px;
    left: 50%;
    margin-left: -6px;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.06);
}

.ml-tour-tooltip[data-position="bottom"] .ml-tour-arrow {
    top: -6px;
    left: 50%;
    margin-left: -6px;
    box-shadow: -2px -2px 4px rgba(0, 0, 0, 0.06);
}

/* ── Header row ── */
.ml-tour-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.ml-tour-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-dim);
    color: var(--primary);
    font-size: 1rem;
    flex-shrink: 0;
}

.ml-tour-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-main);
    flex: 1;
}

.ml-tour-counter {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ── Body text ── */
.ml-tour-body {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* ── Footer with navigation ── */
.ml-tour-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.ml-tour-skip {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.375rem 0;
    font-family: inherit;
    transition: color 0.15s;
}

.ml-tour-skip:hover {
    color: var(--text-main);
}

.ml-tour-nav {
    display: flex;
    gap: 0.5rem;
}

.ml-tour-btn {
    font-size: 0.8125rem;
    font-weight: 700;
    font-family: inherit;
    border: none;
    border-radius: 0.75rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.ml-tour-btn:active {
    transform: scale(0.97);
}

.ml-tour-btn-back {
    background: var(--bg-alt);
    color: var(--text-muted);
}

.ml-tour-btn-next {
    background: var(--primary);
    color: white;
}

.ml-tour-btn-next:hover {
    background: var(--primary-hover);
}

/* ── Mobile responsive ── */
@media (max-width: 767px) {
    /* Full-width tooltip on mobile — but NOT centered (welcome/done) steps */
    .ml-tour-tooltip:not([data-position="center"]) {
        max-width: calc(100vw - 32px);
        width: calc(100vw - 32px);
        left: 16px !important;
        right: 16px;
    }

    /* Centered steps get a comfortable max-width on mobile */
    .ml-tour-tooltip[data-position="center"] {
        max-width: calc(100vw - 48px);
        width: calc(100vw - 48px);
    }

    .ml-tour-arrow {
        /* Re-center arrow over the actual target on mobile */
    }
}
