/* ============================================================================
   FEFER SNAPSHOT — announcement bar + entry modal
   Feature module. Loaded after style.css; all copy lives in snapshot.js.
   ========================================================================== */

:root {
    --snapshot-bar-height: 44px;

    /* Amber is the only warm colour on the site — it reads as an event,
       and never competes with the green/red that carry meaning on the chart. */
    --snapshot-amber: #F5A623;
    --snapshot-amber-bright: #FFB84D;
    --snapshot-amber-soft: rgba(245, 166, 35, 0.12);
    --snapshot-amber-border: rgba(245, 166, 35, 0.3);
    --snapshot-ink: #131722;

    --snapshot-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── ANNOUNCEMENT BAR ────────────────────────────────────────────────────── */

.snapshot-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    height: var(--snapshot-bar-height);
    padding: 0 16px;
    background:
        linear-gradient(90deg,
            rgba(245, 166, 35, 0.16) 0%,
            rgba(245, 166, 35, 0.06) 38%,
            rgba(245, 166, 35, 0) 72%),
        #171B26;
    border-bottom: 1px solid var(--snapshot-amber-border);
    white-space: nowrap;
    overflow: hidden;
    flex-shrink: 0;
}

.snapshot-dot {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--snapshot-amber);
    flex-shrink: 0;
}

/* Pulse rides on a pseudo-element so only transform/opacity animate. */
.snapshot-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background-color: var(--snapshot-amber);
}

[data-status="live"] .snapshot-dot::after {
    animation: snapshotPing 2.2s var(--snapshot-ease-out) infinite;
}

@keyframes snapshotPing {
    0%   { transform: scale(1); opacity: 0.65; }
    100% { transform: scale(3.2); opacity: 0; }
}

/* Completed and upcoming states drop the urgency signalling. */
.snapshot-bar[data-status="completed"] {
    background: #171B26;
    border-bottom-color: var(--border-color);
}

.snapshot-bar[data-status="completed"] .snapshot-dot {
    background-color: var(--text-muted);
}

.snapshot-bar[data-status="completed"] .snapshot-bar-title {
    color: var(--text-primary);
}

.snapshot-bar-title {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--snapshot-amber-bright);
    flex-shrink: 0;
}

.snapshot-bar-desc {
    font-size: 12px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.snapshot-bar-cta {
    margin-left: auto;
    flex-shrink: 0;
}

/* ── SHARED BUTTON ───────────────────────────────────────────────────────── */

.snapshot-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, #FFC46B 0%, #F5A623 100%);
    color: var(--snapshot-ink);
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(245, 166, 35, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.snapshot-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(245, 166, 35, 0.45);
}

.snapshot-cta:active {
    transform: translateY(0);
}

.snapshot-cta:focus-visible {
    outline: 2px solid var(--snapshot-amber-bright);
    outline-offset: 2px;
}

.snapshot-cta:disabled {
    opacity: 0.55;
    cursor: progress;
    transform: none;
    box-shadow: none;
}

.snapshot-cta svg {
    width: 13px;
    height: 13px;
}

/* ── MODAL ───────────────────────────────────────────────────────────────── */

.snapshot-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;

    /* Blur sits on the overlay, not on .app-container: filtering the container
       would force the candlestick canvas to re-rasterise on every 700ms tick.
       Browsers without backdrop-filter still get the opaque fill below. */
    background-color: rgba(9, 12, 19, 0.78);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    backdrop-filter: blur(8px) saturate(120%);

    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0s linear 0.22s;
}

.snapshot-overlay.is-open {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.22s ease, visibility 0s;
}

.snapshot-modal {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background-color: #171B26;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
    transform: translateY(14px) scale(0.985);
    transition: transform 0.28s var(--snapshot-ease-out);
}

.snapshot-overlay.is-open .snapshot-modal {
    transform: none;
}

.snapshot-modal:focus {
    outline: none;
}

.snapshot-accent {
    height: 3px;
    border-radius: 12px 12px 0 0;
    background: linear-gradient(90deg,
        var(--snapshot-amber) 0%,
        rgba(245, 166, 35, 0.25) 60%,
        rgba(245, 166, 35, 0) 100%);
}

.snapshot-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 0;
}

.snapshot-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background-color: var(--snapshot-amber-soft);
    border: 1px solid var(--snapshot-amber-border);
    border-radius: 20px;
    padding: 4px 11px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--snapshot-amber-bright);
}

.snapshot-close {
    background: none;
    border: none;
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.snapshot-close:hover {
    color: var(--text-white);
    background-color: var(--bg-card-hover);
}

.snapshot-close:focus-visible {
    outline: 2px solid var(--snapshot-amber);
    outline-offset: 1px;
}

.snapshot-close svg {
    width: 16px;
    height: 16px;
}

.snapshot-modal-body {
    padding: 14px 20px 0;
}

.snapshot-eyebrow {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.snapshot-modal-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-white);
    margin: 6px 0 10px;
}

.snapshot-lead {
    font-size: 13px;
    line-height: 1.65;
    color: var(--text-primary);
}

.snapshot-rows {
    margin-top: 16px;
    background-color: #131722;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px 12px;
}

.snapshot-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    font-size: 11.5px;
    border-bottom: 1px solid rgba(42, 46, 57, 0.5);
}

.snapshot-row:last-child {
    border-bottom: none;
}

.snapshot-row-key {
    color: var(--text-muted);
}

.snapshot-row-val {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

.snapshot-row-val.is-accent {
    color: var(--snapshot-amber-bright);
}

.snapshot-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 14px;
    padding: 10px 12px;
    background-color: var(--snapshot-amber-soft);
    border: 1px solid var(--snapshot-amber-border);
    border-radius: 8px;
    font-size: 11.5px;
    line-height: 1.55;
    color: var(--text-primary);
}

.snapshot-note svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--snapshot-amber);
}

/* Reserved for the eligibility result / address input. Empty and hidden until
   the developer fills #snapshotResult and removes the [hidden] attribute. */
.snapshot-result {
    margin-top: 14px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-primary);
}

.snapshot-result[hidden] {
    display: none;
}

.snapshot-modal-foot {
    padding: 18px 20px 20px;
}

.snapshot-cta-block {
    width: 100%;
    padding: 11px;
    font-size: 13px;
}

.snapshot-hint {
    margin-top: 10px;
    text-align: center;
    font-size: 10.5px;
    color: var(--text-muted);
}

/* ── ACCESSIBILITY & MOTION ──────────────────────────────────────────────── */

body.snapshot-locked {
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .snapshot-dot::after,
    [data-status="live"] .snapshot-dot::after {
        animation: none;
        opacity: 0;
    }

    .snapshot-modal {
        transform: none;
        transition: none;
    }

    .snapshot-cta:hover {
        transform: none;
    }
}

/* ── RESPONSIVE ──────────────────────────────────────────────────────────── */

/* Narrow desktop: drop the summary line rather than let the bar wrap, which
   would break the fixed-height arithmetic .terminal-grid depends on. */
@media (max-width: 1100px) {
    .snapshot-bar-desc {
        display: none;
    }
}

@media (max-width: 768px) {
    .snapshot-bar {
        height: auto;
        min-height: var(--snapshot-bar-height);
        padding: 9px 10px;
        gap: 9px;
        white-space: normal;
    }

    .snapshot-bar-title {
        font-size: 11px;
        letter-spacing: 0.05em;
        white-space: normal;
    }

    .snapshot-bar-cta {
        padding: 6px 11px;
        font-size: 11px;
    }

    .snapshot-overlay {
        padding: 12px;
        align-items: flex-end;
    }

    .snapshot-modal {
        max-width: none;
        max-height: calc(100vh - 24px);
    }

    .snapshot-modal-title {
        font-size: 19px;
    }

    .snapshot-lead {
        font-size: 12.5px;
    }
}
