/* ============================================================================
   CONTEXTUAL HELP — Spotlight overlay for feature discovery
   ============================================================================ */

/* Full-screen overlay with cutout */
.ctx-help-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}
.ctx-help-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* SVG backdrop fills the screen; the <rect> provides the dim, the <rect> with mask punches the hole */
.ctx-help-overlay svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Tooltip bubble */
.ctx-help-tooltip {
    position: fixed;
    z-index: 10001;
    max-width: 300px;
    background: var(--bg-card, #f8f7f2);
    border: 1px solid var(--border, #d4cec0);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    padding: 1.15rem 1.25rem 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    pointer-events: none;
}
.ctx-help-tooltip.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Arrow — positioned dynamically via JS */
.ctx-help-arrow {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--bg-card, #f8f7f2);
    border: 1px solid var(--border, #d4cec0);
    transform: rotate(45deg);
}
/* When tooltip is below target, arrow points up */
.ctx-help-tooltip[data-position="below"] .ctx-help-arrow {
    top: -7px;
    border-bottom: none;
    border-right: none;
}
/* When tooltip is above target, arrow points down */
.ctx-help-tooltip[data-position="above"] .ctx-help-arrow {
    bottom: -7px;
    border-top: none;
    border-left: none;
}

/* Tooltip message */
.ctx-help-message {
    font-family: 'Crimson Pro', serif;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text, #2a2416);
    margin-bottom: 0.85rem;
}

/* Footer: counter on left, button on right */
.ctx-help-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

/* Step counter (e.g. "1 / 3") */
.ctx-help-counter {
    font-family: 'Crimson Pro', serif;
    font-size: 0.9rem;
    color: var(--text-muted, #8a7f6a);
}

/* Dismiss / Next / Done button */
.ctx-help-dismiss {
    display: inline-block;
    font-family: 'EB Garamond', serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    background: var(--burgundy, #7a2828);
    border: none;
    border-radius: 6px;
    padding: 0.4rem 1.1rem;
    cursor: pointer;
    transition: opacity 0.2s;
    margin-left: auto;
}
.ctx-help-dismiss:hover {
    opacity: 0.85;
}

/* Pulsing ring around the spotlighted element */
@keyframes ctx-help-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(122, 40, 40, 0.45); }
    70%  { box-shadow: 0 0 0 10px rgba(122, 40, 40, 0); }
    100% { box-shadow: 0 0 0 0 rgba(122, 40, 40, 0); }
}
.ctx-help-highlight {
    position: fixed;
    z-index: 10000;
    border-radius: 6px;
    pointer-events: none;
    animation: ctx-help-pulse 1.8s ease-in-out infinite;
}
[data-theme="dark"] .ctx-help-highlight {
    animation-name: ctx-help-pulse-dark;
}
@keyframes ctx-help-pulse-dark {
    0%   { box-shadow: 0 0 0 0 rgba(216, 112, 112, 0.5); }
    70%  { box-shadow: 0 0 0 10px rgba(216, 112, 112, 0); }
    100% { box-shadow: 0 0 0 0 rgba(216, 112, 112, 0); }
}
