/* ==========================================================================
   Ultra-Premium Purchase Success Modal
   ========================================================================== */

#purchase-success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

#purchase-success-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.purchase-success-card {
    position: relative;
    width: 90%;
    max-width: 440px;
    background: rgba(15, 15, 18, 0.65);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    padding: 40px 32px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(20px) scale(0.98);
    text-align: center;
}

/* Subtle glowing orb behind the card */
.purchase-success-card::before {
    content: '';
    position: absolute;
    top: -30%;
    left: 50%;
    transform: translateX(-50%);
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.25) 0%, rgba(0, 240, 255, 0.15) 50%, transparent 70%);
    filter: blur(60px);
    opacity: 0.8;
    z-index: 0;
    pointer-events: none;
}

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

/* Checkmark Icon */
.ps-icon-container {
    width: 72px;
    height: 72px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(0, 240, 255, 0.15));
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.2), inset 0 0 15px rgba(255,255,255,0.05);
}

.ps-icon-container svg {
    width: 32px;
    height: 32px;
    stroke: url(#ps-gradient-stroke) #fff; /* Fallback to white if SVG gradient fails */
    stroke-width: 2.5px;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    filter: drop-shadow(0 0 8px rgba(255,255,255,0.4));
}

#purchase-success-overlay.active .ps-icon-container svg {
    animation: drawCheck 0.8s cubic-bezier(0.65, 0, 0.45, 1) forwards 0.2s;
}

@keyframes drawCheck {
    to { stroke-dashoffset: 0; }
}

.purchase-success-card h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.purchase-success-card p.ps-subtitle {
    color: #a1a1aa;
    font-size: 0.95rem;
    margin-bottom: 32px;
    font-weight: 400;
}

/* Receipt Area */
.ps-receipt {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 32px;
    text-align: left;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.2);
}

.ps-receipt-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    color: #d4d4d8;
    font-size: 0.95rem;
    font-weight: 500;
}

.ps-receipt-item:last-of-type {
    margin-bottom: 0;
}

.ps-receipt-item.total {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-weight: 700;
    font-size: 1.15rem;
}

/* Actions */
.ps-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-ps {
    padding: 14px 24px;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    flex: 1;
    min-width: 140px;
    letter-spacing: 0.01em;
}

.btn-ps-secondary {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e4e4e7;
}

.btn-ps-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-ps-primary {
    background: linear-gradient(135deg, #8b5cf6, #3b82f6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.25), inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-ps-primary:hover {
    box-shadow: 0 12px 25px rgba(139, 92, 246, 0.4), inset 0 1px 0 rgba(255,255,255,0.3);
    transform: translateY(-2px);
    filter: brightness(1.1);
}

/* ==========================================================================
   Payment Error / Cancellation Modal
   ========================================================================== */

#payment-error-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

#payment-error-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.payment-error-card {
    position: relative;
    width: 90%;
    max-width: 440px;
    background: rgba(18, 15, 15, 0.75);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 28px;
    padding: 40px 32px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(20px) scale(0.98);
    text-align: center;
}

.payment-error-card::before {
    content: '';
    position: absolute;
    top: -30%;
    left: 50%;
    transform: translateX(-50%);
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.25) 0%, rgba(245, 158, 11, 0.15) 50%, transparent 70%);
    filter: blur(60px);
    opacity: 0.8;
    z-index: 0;
    pointer-events: none;
}

.pe-icon-container {
    width: 72px;
    height: 72px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(245, 158, 11, 0.2));
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    font-size: 28px;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.2), inset 0 0 15px rgba(255,255,255,0.05);
}

.payment-error-card h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.payment-error-card p.pe-subtitle {
    color: #a1a1aa;
    font-size: 0.95rem;
    margin-bottom: 24px;
    line-height: 1.5;
}

.pe-reason-box {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 14px;
    padding: 14px 18px;
    color: #fca5a5;
    font-size: 0.9rem;
    margin-bottom: 28px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-pe-retry {
    background: linear-gradient(135deg, #ef4444, #8b5cf6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.25);
}

.btn-pe-retry:hover {
    box-shadow: 0 12px 25px rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
    filter: brightness(1.1);
}

