/* ============================================================
   wallet-popups.css
   Result popups for the wallet (deposit received, review / sent
   withdrawal, exchange complete) + the "deposit detected" toast.

   Built from the site's own design tokens so it reads as part of the
   same UI as the auth and wallet modals:
     shell      = .auth-modal / .wallet-modal  (glass card, pink hairline)
     ring+tick  = the "Welcome!" success screen in auth-modals
     close      = .modal-close (36px, rotates on hover)
     primary    = .btn-auth-submit             (#E91EFE -> #C01EFE)
     secondary  = .wallet-btn-secondary
     details    = .wallet-address-box surface
     toast      = .auth-toast
   Colours come from base-styles.css (:root) — nothing hard-coded that
   the site already defines. Loaded after wallet-modal.css.
   ============================================================ */

/* ── Overlay (same scrim as .modal-overlay) ─────────────────── */
.pulse-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 2500;                      /* above the wallet modal (2000), below toasts (3000) */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(10, 6, 16, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.25s ease;
}
.pulse-popup-overlay.visible { opacity: 1; }

/* ── Shell (same as .auth-modal / .wallet-modal) ────────────── */
.pulse-popup {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow: hidden;                    /* rounded corners mask the scrollbar */
    background: rgba(42, 27, 61, 0.98);
    border: 1px solid rgba(233, 30, 254, 0.15);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.94) translateY(10px);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.pulse-popup-overlay.visible .pulse-popup {
    transform: scale(1) translateY(0);
    opacity: 1;
}
.theme-dark .pulse-popup { background: rgba(26, 26, 26, 0.98); }

.pulse-popup-scroll {
    max-height: 90vh;
    overflow-y: auto;
    padding: 36px 24px 24px;
    text-align: center;
}
.pulse-popup-scroll::-webkit-scrollbar       { width: 6px; }
.pulse-popup-scroll::-webkit-scrollbar-track { background: transparent; }
.pulse-popup-scroll::-webkit-scrollbar-thumb { background: rgba(233, 30, 254, 0.3); border-radius: 3px; }

/* ── Close button (same as .modal-close) ────────────────────── */
.pulse-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
    z-index: 2;
}
.pulse-popup-close:hover {
    background: rgba(233, 30, 254, 0.1);
    border-color: var(--accent);
    color: var(--text-primary);
    transform: rotate(90deg);
}
.pulse-popup-close svg { width: 18px; height: 18px; }

/* ── Status ring (same drawing animation as the Welcome screen) ─ */
.pulse-popup-ring {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}
.pulse-popup-ring svg { width: 80px; height: 80px; }

.pulse-popup-ring-circle {
    stroke-dasharray: 226;
    stroke-dashoffset: 226;
    animation: pulsePopupDraw 0.6s ease forwards 0.1s;
}
.pulse-popup-ring-mark {
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    animation: pulsePopupDraw 0.4s ease forwards 0.65s;
}
/* Arrow / "!" glyphs are short strokes — no need to draw them slowly. */
.pulse-popup-ring-glyph {
    opacity: 0;
    animation: pulsePopupFade 0.3s ease forwards 0.45s;
}
@keyframes pulsePopupDraw { to { stroke-dashoffset: 0; } }
@keyframes pulsePopupFade { to { opacity: 1; } }

/* ── Heading (same scale as .auth-title / .auth-subtitle) ───── */
.pulse-popup-title {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
}
.pulse-popup-subtitle {
    margin: 0 0 22px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* ── Amount ─────────────────────────────────────────────────── */
.pulse-popup-amount {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0 0 4px;
}
.pulse-popup-amount-text {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.3px;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}
.pulse-popup-amount-sub {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}
.pulse-popup-amount-wrap { margin-bottom: 22px; }

/* Coin monogram — same badge as .wallet-coin-icon */
.pulse-popup-coin {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--icon-color, #888);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
}

/* ── Details card (same surface as .wallet-address-box) ─────── */
.pulse-popup-rows {
    margin: 0 0 16px;
    padding: 4px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    text-align: left;
}
.pulse-popup-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    font-size: 13px;
}
.pulse-popup-row + .pulse-popup-row { border-top: 1px solid rgba(255, 255, 255, 0.08); }
.pulse-popup-row-label {
    flex-shrink: 0;
    font-weight: 600;
    color: var(--text-secondary);
}
.pulse-popup-row-value {
    min-width: 0;
    text-align: right;
    font-weight: 600;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}
.pulse-popup-row-value.mono {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-weight: 500;
    font-size: 12.5px;
    word-break: break-all;
}
/* "Confirmed" / "Sent" status — same green the site uses for success (#2ED573) */
.pulse-popup-row-value.tone-success { color: #2ED573; }
.pulse-popup-row-value.tone-success::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 7px;
    border-radius: 50%;
    background: #2ED573;
    vertical-align: 1px;
}
.pulse-popup-row-value.tone-warning { color: #FFA64D; }

/* ── Note (same treatment as .form-success-general / .form-error-general) ─ */
.pulse-popup-note {
    margin: 0 0 16px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.5;
    text-align: left;
    color: var(--text-secondary);
    background: rgba(233, 30, 254, 0.06);
    border: 1px solid rgba(233, 30, 254, 0.2);
    border-radius: 8px;
}
.pulse-popup-warning .pulse-popup-note,
.pulse-popup-confirm .pulse-popup-note {
    color: #FFC48A;
    background: rgba(255, 166, 77, 0.08);
    border-color: rgba(255, 166, 77, 0.25);
}
.pulse-popup-error .pulse-popup-note {
    color: #FF8FA3;
    background: rgba(255, 77, 109, 0.08);
    border-color: rgba(255, 77, 109, 0.2);
}

/* ── Buttons ────────────────────────────────────────────────── */
.pulse-popup-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}
.pulse-popup-btn {
    display: block;
    width: 100%;
    padding: 13px;
    background: rgba(255, 255, 255, 0.06);          /* = .wallet-btn-secondary */
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s;
}
.pulse-popup-btn:hover {
    border-color: var(--accent);
    background: rgba(233, 30, 254, 0.06);
}
.pulse-popup-btn:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(233, 30, 254, 0.2);
}
.pulse-popup-btn.primary {                          /* = .btn-auth-submit */
    padding: 14px;
    background: linear-gradient(135deg, #E91EFE 0%, #C01EFE 100%);
    border: none;
    font-size: 15px;
    box-shadow: 0 4px 15px rgba(233, 30, 254, 0.3);
    transition: all 0.3s;
}
.pulse-popup-btn.primary:hover {
    background: linear-gradient(135deg, #E91EFE 0%, #C01EFE 100%);
    box-shadow: 0 6px 20px rgba(233, 30, 254, 0.4);
    transform: translateY(-2px);
}
.pulse-popup-btn.primary:focus-visible { box-shadow: 0 0 0 3px rgba(233, 30, 254, 0.35), 0 4px 15px rgba(233, 30, 254, 0.3); }

/* ── "Deposit detected" toast (same as .auth-toast) ─────────── */
.pulse-pending-wrap {
    position: fixed;
    top: 88px;
    right: 20px;
    z-index: 2900;                     /* just under .auth-toast-container (3000) */
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 360px;
    max-width: calc(100vw - 24px);
    pointer-events: none;
}
.pulse-pending {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 14px 14px 16px;
    background: rgba(42, 27, 61, 0.98);
    border: 1px solid rgba(233, 30, 254, 0.35);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    color: var(--text-primary);
    animation: pulsePendingIn 0.25s ease both;
}
.theme-dark .pulse-pending { background: rgba(26, 26, 26, 0.98); }
@keyframes pulsePendingIn {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: translateX(0); }
}
.pulse-pending .pulse-popup-coin { width: 34px; height: 34px; font-size: 13px; }
.pulse-pending-body  { flex: 1; min-width: 0; }
.pulse-pending-title { font-size: 13px; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.pulse-pending-sub   { margin-top: 2px; font-size: 12px; color: var(--text-muted); }
.pulse-pending-bar   { height: 4px; margin-top: 8px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.pulse-pending-bar span {
    display: block;
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, #E91EFE 0%, #C01EFE 100%);
    transition: width 0.4s ease;
}
.pulse-pending-x {
    align-self: flex-start;
    width: 24px;
    height: 24px;
    padding: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.25s;
}
.pulse-pending-x:hover { color: var(--text-primary); }

/* ── Withdraw tab additions (match .wallet-hint / .wallet-section-label) ─ */
.wallet-address-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-muted);
}

/* ── Motion + small screens ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .pulse-popup, .pulse-popup-overlay, .pulse-pending { transition: none; animation: none; }
    .pulse-popup-ring-circle, .pulse-popup-ring-mark { animation: none; stroke-dashoffset: 0; }
    .pulse-popup-ring-glyph { animation: none; opacity: 1; }
}

@media (max-width: 480px) {
    .pulse-popup { max-width: 100%; border-radius: 16px; }
    .pulse-popup-scroll { padding: 32px 16px 20px; }
    .pulse-popup-amount-text { font-size: 26px; }
    .pulse-pending-wrap { left: 12px; right: 12px; top: 80px; width: auto; max-width: none; }
}