/* ============================================================
   Spotlight Tutorial Tour — tutorial.css
   All tour styles live here. Do not add tour CSS elsewhere.
   ============================================================ */

/* ── Navbar tour wrapper — always visible (outside collapse) ─ */
/* On mobile: stays in the header row alongside the hamburger.  */
/* On desktop (sm+): ordered last so it sits at the far right.  */
.navbar-tour-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── ? Trigger button ────────────────────────────────────── */
.tour-trigger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.75);
    background: transparent;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.2s, border-color 0.2s;
    flex-shrink: 0;
}

.tour-trigger-btn.tour-active {
    animation: tour-btn-pulse 2.4s ease-in-out infinite;
}

.tour-trigger-btn:hover,
.tour-trigger-btn:focus-visible {
    background: rgba(255, 255, 255, 0.18);
    border-color: #fff;
    outline: none;
    animation: none;
}

@keyframes tour-btn-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(255, 255, 255, 0.55); }
    55%  { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0   rgba(255, 255, 255, 0); }
}

/* ── First-visit welcome prompt ──────────────────────────── */
#tour-welcome-prompt {
    position: fixed;
    top: 62px;
    right: 16px;
    z-index: 10050;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.15);
    padding: 12px 16px;
    min-width: 240px;
    max-width: 300px;
    font-size: 0.875rem;
    animation: tour-prompt-in 0.25s cubic-bezier(0.34, 1.38, 0.64, 1) both;
}

/* Caret pointing up-right toward the ? button */
#tour-welcome-prompt::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 14px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #dee2e6;
}

#tour-welcome-prompt::after {
    content: '';
    position: absolute;
    top: -7px;
    right: 15px;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 7px solid #fff;
}

@keyframes tour-prompt-in {
    from { opacity: 0; transform: translateY(-8px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.tour-prompt-text {
    color: #212529;
    margin: 0 0 10px;
    line-height: 1.4;
}

.tour-prompt-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ── Overlay panels (4-panel framing — no clip-path) ─────── */
.tour-overlay-panel {
    position: fixed;
    z-index: 10100;
    background: rgba(0, 0, 0, 0.45);
    pointer-events: all;
    transition: top    0.32s cubic-bezier(0.4, 0, 0.2, 1),
                left   0.32s cubic-bezier(0.4, 0, 0.2, 1),
                width  0.32s cubic-bezier(0.4, 0, 0.2, 1),
                height 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Tooltip card ────────────────────────────────────────── */
#tour-card {
    position: fixed;
    z-index: 10300;
    min-width: 290px;
    max-width: 390px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
    padding: 20px 22px 16px;
    outline: none;
}

#tour-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #212529;
    margin: 0 0 6px;
}

#tour-card-description {
    font-size: 1rem;
    color: #495057;
    line-height: 1.55;
    margin: 0 0 10px;
}

/* Hint block — blue left-border accent for validation rules / indicator meanings */
#tour-card-hint {
    display: none;
    background: #f0f4ff;
    border-left: 3px solid #0d6efd;
    border-radius: 0 4px 4px 0;
    padding: 8px 12px;
    font-size: 0.875rem;
    color: #343a40;
    line-height: 1.45;
    margin-bottom: 12px;
    white-space: pre-line; /* enables \n line breaks in hint strings */
}

#tour-card-hint.tour-hint-visible {
    display: block;
}

/* Footer: step counter + navigation buttons */
.tour-card-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid #e9ecef;
    padding-top: 12px;
    margin-top: 4px;
}

#tour-step-counter {
    font-size: 0.75rem;
    color: #6c757d;
    flex: 1;
}

/* ── Highlighted target element ──────────────────────────── */
/* No z-index needed — the 4-panel approach leaves the element fully uncovered */
.tour-active-target {
    outline: 3px solid #ff3b30 !important;
    outline-offset: 5px !important;
    border-radius: 6px !important;
    animation: tour-target-glow 1.2s ease-in-out infinite !important;
}

@keyframes tour-target-glow {
    0%, 100% { box-shadow: 0 0 0 0    rgba(255, 59, 48, 0.6); }
    50%       { box-shadow: 0 0 0 12px rgba(255, 59, 48, 0); }
}

/* ── Body scroll lock ────────────────────────────────────── */
body.tour-open {
    overflow: hidden;
}

/* ── Bouncing arrow pointer ───────────────────────────────── */
#tour-arrow {
    position: fixed;
    z-index: 10201;
    font-size: 2rem;
    line-height: 1;
    color: #ff3b30;
    pointer-events: none;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
    display: none;
    animation: tour-arrow-bounce-down 0.9s ease-in-out infinite alternate;
}

#tour-arrow.tour-arrow-up {
    animation: tour-arrow-bounce-up 0.9s ease-in-out infinite alternate;
}

@keyframes tour-arrow-bounce-down {
    from { transform: translateY(0); }
    to   { transform: translateY(8px); }
}

@keyframes tour-arrow-bounce-up {
    from { transform: translateY(0); }
    to   { transform: translateY(-8px); }
}

/* ── Step progress dots ──────────────────────────────────── */
.tour-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #dee2e6;
    margin: 0 2px;
    transition: background 0.2s;
}

.tour-dot.tour-dot-done {
    background: #0d6efd;
}

.tour-dot.tour-dot-active {
    background: #0d6efd;
    transform: scale(1.4);
}

/* ── Condition-fail info toast ───────────────────────────── */
#tour-info-toast {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 10050;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: tour-prompt-in 0.2s ease both;
}

/* ── Mobile overrides ────────────────────────────────────── */
@media (max-width: 575.98px) {
    /* On mobile the ? button is on the LEFT side of the navbar,
       so flip the prompt to align under it. */
    #tour-welcome-prompt {
        right: auto;
        left: 16px;
    }

    /* Flip both pseudo-elements so the caret points upper-left */
    #tour-welcome-prompt::before {
        right: auto;
        left: 14px;
    }

    #tour-welcome-prompt::after {
        right: auto;
        left: 15px;
    }

    /* Tour card — full-width so it fits on small phones */
    #tour-card {
        min-width: 0;
        width: calc(100vw - 32px);
        max-width: none;
    }
}

/* ── Desktop overrides (must come after base rules to win the cascade) ─ */
@media (min-width: 576px) {
    /* Push the wrapper to the far right of the navbar, after the collapse */
    .navbar-tour-wrapper {
        order: 10;
        align-self: center;
        flex-shrink: 0;
    }

    /* Scale down to match nav-link height — 44px touch target only matters on mobile */
    .tour-trigger-btn {
        width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }
}
