/* guide.css — Fixed guide bar under navbar, target highlight */

/* Fixed guide bar directly under sticky navbar — does not block the rest of the page */
#main-content.has-sidebar #meerkat-guide-bar {
    left: 240px;
}

#main-content.has-sidebar.sidebar-collapsed #meerkat-guide-bar,
html.sidebar-collapsed-init #main-content.has-sidebar #meerkat-guide-bar {
    left: 72px;
}

@media (max-width: 991.98px) {
    #main-content.has-sidebar #meerkat-guide-bar,
    #main-content.has-sidebar.sidebar-collapsed #meerkat-guide-bar,
    html.sidebar-collapsed-init #main-content.has-sidebar #meerkat-guide-bar {
        left: 0;
    }
}

/* Guided tour bar — purple accent, above sticky UI */
#meerkat-guide-bar {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    top: var(--meerkat-navbar-height, 56px);
    z-index: 1040;
    background: linear-gradient(135deg, var(--meerkat-guide-gradient-start) 0%, var(--meerkat-graph-chip-project-fg) 35%, var(--type-project-fg) 70%, var(--meerkat-guide-gradient-end) 100%);
    color: var(--meerkat-graph-chip-project-bg);
    border-bottom: 3px solid var(--meerkat-guide-accent);
    box-shadow: 0 6px 24px rgba(var(--meerkat-guide-shadow-rgb), 0.45);
    pointer-events: auto;
    isolation: isolate;
}
#meerkat-guide-bar.meerkat-guide-bar--visible {
    display: block;
}
.meerkat-guide-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.65rem 1rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.meerkat-guide-bar-text {
    flex: 1 1 220px;
    min-width: 0;
}
#guideBarStep {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--meerkat-guide-accent);
    font-weight: 600;
    margin-bottom: 0.25rem;
}
#guideBarMessage {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--type-project-bg);
}
.meerkat-guide-bar-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.meerkat-guide-bar-actions button {
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 0.4rem;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    border: none;
    line-height: 1.2;
}
#guideBarBack {
    background: rgba(var(--meerkat-black-rgb), 0.2);
    color: var(--meerkat-graph-chip-project-bg);
    border: 1px solid rgba(var(--meerkat-plan-surface-rgb), 0.35) !important;
    font-weight: 500 !important;
}
#guideBarBack:hover {
    border-color: var(--meerkat-guide-accent) !important;
    color: var(--meerkat-surface-raised);
    background: rgba(var(--meerkat-black-rgb), 0.3);
}
#guideBarBack.is-hidden {
    display: none;
}
#guideBarNext {
    background: var(--meerkat-guide-accent);
    color: var(--meerkat-guide-text-strong);
}
#guideBarNext:hover:not(:disabled) {
    background: var(--meerkat-plan-amber-500);
    color: var(--meerkat-guide-text-strong);
}
#guideBarNext:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
#guideBarNext.is-hidden {
    display: none !important;
}
#guideBarClose {
    background: transparent;
    color: rgba(var(--meerkat-plan-surface-rgb), 0.65);
    font-size: 1.1rem !important;
    padding: 0.2rem 0.5rem !important;
    line-height: 1 !important;
    border: none !important;
}
#guideBarClose:hover {
    color: var(--meerkat-surface-raised);
}

/* Tour finished: single primary Close control */
.meerkat-guide-bar--tour-end #guideBarClose {
    background: var(--meerkat-guide-accent);
    color: var(--meerkat-guide-text-strong);
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    padding: 0.35rem 1rem !important;
    line-height: 1.2 !important;
    border-radius: 0.4rem !important;
    border: none !important;
}
.meerkat-guide-bar--tour-end #guideBarClose:hover {
    background: var(--meerkat-plan-amber-500);
    color: var(--meerkat-guide-text-strong);
}

/* Push page content below the fixed guide bar (set via --meerkat-guide-bar-offset in JS) */
#main-content > main {
    padding-top: var(--meerkat-guide-bar-offset, 0px);
    /* Snappy updates between guide steps (long ease fights rapid highlight changes) */
    transition: padding-top 0.06s ease-out;
}

/* Highlight: static ring + pulsing ::after — sharp purple, distinct from app UI */
@keyframes guide-highlight-pulse-after {
    0%,
    100% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(var(--meerkat-guide-highlight-accent-rgb), 0.5);
    }
    50% {
        transform: scale(1.06);
        opacity: 0.6;
        box-shadow: 0 0 0 12px rgba(var(--meerkat-guide-highlight-accent-rgb), 0);
    }
}

.guide-highlight {
    position: relative;
    z-index: 5;
    border-radius: 6px;
    outline: 3px solid var(--meerkat-guide-highlight-accent);
    outline-offset: 2px;
    overflow: visible;
    isolation: isolate;
}

.guide-highlight::after {
    content: "";
    position: absolute;
    inset: -7px;
    border-radius: inherit;
    pointer-events: none;
    /* Above in-flow UI (e.g. capture bar) so the pulse is visible; stays non-interactive */
    z-index: 2;
    border: 2px solid rgba(var(--meerkat-guide-ring-rgb), 0.6);
    box-shadow: 0 0 0 1px rgba(var(--meerkat-guide-highlight-accent-rgb), 0.4);
    animation: guide-highlight-pulse-after 1.75s ease-in-out infinite;
    will-change: transform, opacity, box-shadow;
}
