/* BillboardMax first-visit guide — self-contained coachmark overlay.
 *
 * Shared by the plan view (/plan/view/) and finder (/finder/) guides. Outside
 * layer: every class is namespaced `bmpvg-` so it never collides with host page
 * styles. Driven by bm-guide.js; shown to first-time desktop / iPad visitors.
 *
 * Theme tokens mirror plan-view.css: --bm-amber-2 (#ffbb06) / --bm-ink (#0b1a2b). */

.bmpvg-root {
    --bmpvg-amber: var(--bm-amber-2, #ffbb06);
    --bmpvg-ink: var(--bm-ink, #0b1a2b);
    --bmpvg-ink-muted: var(--bm-ink-muted, #4b5868);
    --bmpvg-scrim: rgba(11, 26, 43, 0.74);
    --bmpvg-card-w: 340px;
    position: fixed;
    inset: 0;
    z-index: 20000;
    font-family: inherit;
    color: var(--bmpvg-ink);
    -webkit-font-smoothing: antialiased;
}

.bmpvg-root[hidden] {
    display: none;
}

/* Spotlight: a transparent window punched out of a dark scrim via a huge
 * box-shadow spread. Pointer events pass through to the real UI underneath so
 * the user can actually try the highlighted control. */
.bmpvg-spotlight {
    position: absolute;
    border-radius: 14px;
    box-shadow:
        0 0 0 9999px var(--bmpvg-scrim),
        0 0 0 3px var(--bmpvg-amber),
        0 10px 30px rgba(11, 26, 43, 0.28);
    pointer-events: none;
    transition:
        top 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        left 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        width 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        height 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.bmpvg-spotlight::after {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: inherit;
    border: 2px solid rgba(255, 187, 6, 0.55);
    animation: bmpvg-pulse 1.8s ease-out infinite;
}

@keyframes bmpvg-pulse {
    0% {
        transform: scale(1);
        opacity: 0.9;
    }
    70% {
        transform: scale(1.06);
        opacity: 0;
    }
    100% {
        opacity: 0;
    }
}

/* Card */
.bmpvg-card {
    position: absolute;
    width: var(--bmpvg-card-w);
    max-width: calc(100vw - 32px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 18px 48px rgba(11, 26, 43, 0.32);
    padding: 18px 18px 16px;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.22s ease, transform 0.22s ease, top 0.28s ease, left 0.28s ease;
}

.bmpvg-card.is-ready {
    opacity: 1;
    transform: translateY(0);
}

/* Little arrow pointing at the spotlight */
.bmpvg-card-arrow {
    position: absolute;
    width: 16px;
    height: 16px;
    background: #fff;
    transform: rotate(45deg);
    box-shadow: -3px -3px 8px rgba(11, 26, 43, 0.06);
}

.bmpvg-card[data-arrow="top"] .bmpvg-card-arrow {
    top: -7px;
}

.bmpvg-card[data-arrow="bottom"] .bmpvg-card-arrow {
    bottom: -7px;
    box-shadow: 3px 3px 8px rgba(11, 26, 43, 0.06);
}

.bmpvg-card[data-arrow="left"] .bmpvg-card-arrow {
    left: -7px;
}

.bmpvg-card[data-arrow="right"] .bmpvg-card-arrow {
    right: -7px;
    box-shadow: 3px 3px 8px rgba(11, 26, 43, 0.06);
}

.bmpvg-card[data-arrow="none"] .bmpvg-card-arrow {
    display: none;
}

.bmpvg-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.bmpvg-card-icon {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    font-size: 1.15rem;
    color: var(--bmpvg-ink);
    background: linear-gradient(135deg, #ffd34d 0%, var(--bmpvg-amber) 100%);
    box-shadow: 0 4px 12px rgba(255, 187, 6, 0.4);
}

.bmpvg-card-title {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--bmpvg-ink);
}

.bmpvg-card-body {
    margin: 0 0 14px;
    font-size: 0.98rem;
    line-height: 1.5;
    color: var(--bmpvg-ink-muted);
}

.bmpvg-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.bmpvg-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bmpvg-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(11, 26, 43, 0.16);
    transition: background 0.2s ease, transform 0.2s ease;
}

.bmpvg-dot.is-active {
    background: var(--bmpvg-amber);
    transform: scale(1.35);
}

.bmpvg-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bmpvg-btn {
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    border-radius: 9px;
    padding: 8px 14px;
    border: 1px solid transparent;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.bmpvg-btn:active {
    transform: translateY(1px);
}

.bmpvg-btn-ghost {
    background: transparent;
    color: var(--bmpvg-ink-muted);
    padding: 8px 8px;
}

.bmpvg-btn-ghost:hover {
    color: var(--bmpvg-ink);
}

.bmpvg-btn-outline {
    background: #fff;
    border-color: rgba(11, 26, 43, 0.16);
    color: var(--bmpvg-ink);
}

.bmpvg-btn-outline:hover {
    border-color: rgba(11, 26, 43, 0.32);
}

.bmpvg-btn-primary {
    background: var(--bmpvg-amber);
    color: var(--bmpvg-ink);
    box-shadow: 0 4px 12px rgba(255, 187, 6, 0.38);
}

.bmpvg-btn-primary:hover {
    background: #ffc933;
}

/* Top-right skip / close */
.bmpvg-skip {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(11, 26, 43, 0.06);
    color: var(--bmpvg-ink-muted);
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.bmpvg-skip:hover {
    background: rgba(11, 26, 43, 0.12);
    color: var(--bmpvg-ink);
}

/* Welcome (intro) variant — centered, no spotlight */
.bmpvg-card.bmpvg-card--welcome {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    width: 400px;
    text-align: center;
    padding: 26px 24px 22px;
}

.bmpvg-card.bmpvg-card--welcome.is-ready {
    transform: translate(-50%, -50%) scale(1);
}

.bmpvg-card--welcome .bmpvg-card-head {
    flex-direction: column;
    text-align: center;
    gap: 12px;
}

.bmpvg-card--welcome .bmpvg-card-icon {
    width: 56px;
    height: 56px;
    font-size: 1.7rem;
    border-radius: 16px;
}

.bmpvg-card--welcome .bmpvg-card-title {
    font-size: 1.35rem;
}

.bmpvg-card--welcome .bmpvg-card-foot {
    flex-direction: column;
    gap: 10px;
}

.bmpvg-card--welcome .bmpvg-actions {
    width: 100%;
    flex-direction: column-reverse;
}

.bmpvg-card--welcome .bmpvg-btn {
    width: 100%;
    padding: 11px 14px;
    font-size: 1rem;
}

/* Quick guide launch button. In the plan view it sits inside the header action
 * group next to the print icon; on the finder it replaces the "Billboard Finder"
 * label. Keeps its label + an amber icon accent in either spot. */
.planner-header-action--guide {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    width: auto;
}

.planner-header-action--guide .planner-header-action-label {
    display: inline;
}

/* Keep the question icon orange in every state (hover/focus/active), beating
 * the header's `i { color: #000 }` overrides in plan.css. */
.planner-header-action--guide .bi,
.planner-header-action--guide:hover .bi,
.planner-header-action--guide:focus .bi,
.planner-header-action--guide:active .bi,
.planner-header-actions .planner-header-action--guide .bi,
.planner-header-actions .planner-header-action--guide:hover .bi,
.planner-header-actions .planner-header-action--guide:focus .bi,
.planner-header-actions .planner-header-action--guide:active .bi {
    color: var(--bm-amber-2, #ffbb06) !important;
}

.bmpvg-launch .bi {
    color: var(--bm-amber-2, #ffbb06) !important;
}

/* Floating replay help button (fallback only) */
.bmpvg-launch {
    position: fixed;
    left: 18px;
    bottom: 18px;
    z-index: 19000;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 16px 0 14px;
    border: none;
    border-radius: 999px;
    background: #fff;
    color: var(--bm-ink, #0b1a2b);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(11, 26, 43, 0.22);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* Client portal dashboard — quick guide in agency topbar (replaces notifications). */
.agency-topbar-actions .planner-header-action--guide {
    height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--ag-border, #e5e7eb);
    background: #fff;
    font-size: 13px;
    font-weight: 700;
    box-shadow: none;
}

.agency-topbar-actions .planner-header-action--guide:hover,
.agency-topbar-actions .planner-header-action--guide:focus-visible {
    background: var(--ag-soft, #f3f4f6);
    border-color: var(--ag-border, #e5e7eb);
}

.bmpvg-launch:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(11, 26, 43, 0.28);
}

.bmpvg-launch i {
    font-size: 1.05rem;
    color: var(--bm-amber-2, #ffbb06);
}

.bmpvg-launch[hidden] {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .bmpvg-spotlight,
    .bmpvg-card,
    .bmpvg-launch {
        transition: none;
    }

    .bmpvg-spotlight::after {
        animation: none;
    }
}
