/* =============================================================================
   Nudge Toast — Upgrade glimpse system
   Premium slide-in toast for showing real portfolio data as upgrade motivation.
   Visually DISTINCT from regular toast-notifications (gradient border, glow).
   ============================================================================= */

.ps-nudge-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9500; /* Below modals (10000), above content */
    pointer-events: none;
    max-width: 420px;
    width: calc(100% - 48px);
}

.ps-nudge {
    pointer-events: auto;
    position: relative;
    padding: 20px;
    border-radius: 14px;
    background: var(--bg-card, #1a1a2e);
    border: 1px solid transparent;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Animate in */
.ps-nudge--visible {
    opacity: 1;
    transform: translateY(0);
}

/* Animate out */
.ps-nudge--exit {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .ps-nudge {
        transition: opacity 0.15s ease;
        transform: none;
    }
    .ps-nudge--exit {
        transition: opacity 0.15s ease;
        transform: none;
    }
}

/* --- Gradient border overlays --- */

/* Shield → Pro: green → blue gradient */
.ps-nudge--shield-to-pro::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 15px;
    padding: 1px;
    background: linear-gradient(135deg, #22c55e, #3b82f6);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 0;
}

/* Pro → Elite: purple → gold gradient */
.ps-nudge--pro-to-elite::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 15px;
    padding: 1px;
    background: linear-gradient(135deg, #a855f7, #eab308);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 0;
}

/* Subtle glow behind the card */
.ps-nudge--shield-to-pro {
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(59, 130, 246, 0.08);
}
.ps-nudge--pro-to-elite {
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(168, 85, 247, 0.08);
}

/* --- Content --- */

.ps-nudge__content {
    position: relative;
    z-index: 1;
}

.ps-nudge__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    background: none;
    border: none;
    color: var(--text-muted, #64748b);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 6px;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}
.ps-nudge__close:hover {
    color: var(--text-primary, #f1f5f9);
    background: rgba(255, 255, 255, 0.06);
}

.ps-nudge__title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary, #f1f5f9);
    margin: 0 0 8px 0;
    padding-right: 28px; /* space for close button */
    line-height: 1.3;
}

.ps-nudge__body {
    font-size: 0.8rem;
    color: var(--text-secondary, #94a3b8);
    line-height: 1.5;
    margin: 0 0 16px 0;
}

/* Highlight numbers within body text */
.ps-nudge__body strong {
    color: var(--text-primary, #f1f5f9);
    font-weight: 600;
}

.ps-nudge__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: filter 0.2s, transform 0.15s;
}
.ps-nudge__cta:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}
.ps-nudge__cta:active {
    transform: translateY(0);
}

/* Shield → Pro CTA: blue gradient */
.ps-nudge--shield-to-pro .ps-nudge__cta {
    background: linear-gradient(135deg, #22c55e, #3b82f6);
}

/* Pro → Elite CTA: purple gradient */
.ps-nudge--pro-to-elite .ps-nudge__cta {
    background: linear-gradient(135deg, #a855f7, #eab308);
}

/* --- Auto-dismiss progress bar --- */

.ps-nudge__timer {
    position: absolute;
    bottom: 0;
    left: 14px;
    right: 14px;
    height: 2px;
    border-radius: 0 0 14px 14px;
    overflow: hidden;
    z-index: 1;
}
.ps-nudge__timer-bar {
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    width: 100%;
    transform-origin: left;
    animation: ps-nudge-timer 15s linear forwards;
}

@keyframes ps-nudge-timer {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

@media (prefers-reduced-motion: reduce) {
    .ps-nudge__timer-bar {
        animation: none;
    }
}

/* --- Mobile --- */
@media (max-width: 480px) {
    .ps-nudge-container {
        bottom: 12px;
        right: 12px;
        left: 12px;
        max-width: none;
        width: auto;
    }
    .ps-nudge {
        padding: 16px;
    }
}
