/* ============================================
   NEXUS COPIER - EXIT INTENT POPUP STYLES
   Version: 1.0
   ============================================ */

/* ============================================
   POPUP CONTAINER & OVERLAY
   ============================================ */

.exit-popup {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.exit-popup.active {
    display: flex;
    opacity: 1;
}

.exit-popup-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   POPUP CONTENT
   ============================================ */

.exit-popup-content {
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, #1a1f2e 0%, #0c111d 100%);
    border: 2px solid;
    border-image: linear-gradient(135deg, 
        rgba(0, 169, 255, 0.4),
        rgba(139, 92, 246, 0.4)
    ) 1;
    border-radius: 1.5rem;
    max-width: 540px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 100px rgba(139, 92, 246, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    animation: popupSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popupSlideIn {
    from {
        transform: scale(0.8) translateY(30px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* ============================================
   CLOSE BUTTON
   ============================================ */

.exit-popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 50%;
    color: #ef4444;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.exit-popup-close:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

/* ============================================
   POPUP BODY
   ============================================ */

.exit-popup-body {
    padding: 2.5rem 2rem 2rem;
    text-align: center;
}

.exit-popup-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, rgba(0, 169, 255, 0.15), rgba(139, 92, 246, 0.15));
    border: 2px solid rgba(139, 92, 246, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(139, 92, 246, 0);
    }
}

.exit-popup-icon svg {
    stroke: var(--nexus-accent);
    filter: drop-shadow(0 0 10px rgba(70, 248, 212, 0.5));
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

.exit-popup-title {
    font-size: clamp(1.75rem, 4vw, 2rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-light);
    line-height: 1.2;
}

.exit-popup-subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.5;
}

.exit-popup-subtitle strong {
    color: var(--nexus-accent);
    font-weight: 700;
    font-size: 1.25em;
}

/* ============================================
   DISCOUNT BADGE
   ============================================ */

.exit-popup-discount {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
}

.discount-badge {
    background: linear-gradient(135deg, 
        rgba(239, 68, 68, 0.15),
        rgba(220, 38, 38, 0.15)
    );
    border: 2px solid rgba(239, 68, 68, 0.4);
    border-radius: 1rem;
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: badgePulse 2s ease-in-out infinite;
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.2);
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 30px rgba(239, 68, 68, 0.2);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 40px rgba(239, 68, 68, 0.4);
    }
}

.discount-amount {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.discount-label {
    font-size: 0.875rem;
    color: #ef4444;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   BENEFITS LIST
   ============================================ */

.exit-popup-benefits {
    text-align: left;
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.benefit-item:hover {
    background: rgba(16, 185, 129, 0.1);
    transform: translateX(5px);
}

.benefit-item svg {
    flex-shrink: 0;
}

.benefit-item span {
    color: var(--text-light);
    font-size: 0.9375rem;
    line-height: 1.4;
}

/* ============================================
   FORM
   ============================================ */

.exit-popup-form {
    margin: 2rem 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.exit-popup-input {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(26, 31, 46, 0.8);
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 0.75rem;
    color: var(--text-light);
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.exit-popup-input:focus {
    border-color: var(--nexus-primary);
    background: rgba(26, 31, 46, 1);
    box-shadow: 0 0 0 4px rgba(0, 169, 255, 0.1);
}

.exit-popup-input::placeholder {
    color: var(--text-muted);
}

.exit-popup-button {
    width: 100%;
    padding: 1.125rem 1.5rem;
    background: linear-gradient(135deg, var(--nexus-primary), var(--nexus-secondary));
    border: none;
    border-radius: 0.75rem;
    color: white;
    font-size: 1.0625rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 169, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.exit-popup-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.exit-popup-button:hover::before {
    transform: translateX(100%);
}

.exit-popup-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 169, 255, 0.4);
}

.exit-popup-button:active {
    transform: translateY(0);
}

.exit-popup-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ============================================
   URGENCY TIMER
   ============================================ */

.exit-popup-urgency {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 1.5rem 0 1rem;
}

.exit-popup-urgency strong {
    color: #f59e0b;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

/* ============================================
   PRIVACY TEXT
   ============================================ */

.exit-popup-privacy {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 1rem;
    margin-bottom: 0;
}

/* ============================================
   SUCCESS STATE
   ============================================ */

.exit-popup-success {
    animation: successFadeIn 0.5s ease-out;
}

@keyframes successFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.success-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.15));
    border: 3px solid rgba(16, 185, 129, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: successPulse 2s ease-in-out infinite;
}

@keyframes successPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 20px rgba(16, 185, 129, 0);
    }
}

/* ============================================
   DISCOUNT CODE DISPLAY
   ============================================ */

.discount-code-container {
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.discount-code {
    background: linear-gradient(135deg, 
        rgba(139, 92, 246, 0.15),
        rgba(0, 169, 255, 0.15)
    );
    border: 2px dashed rgba(139, 92, 246, 0.5);
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.code-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.code-value {
    font-size: 2rem;
    font-weight: 900;
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, var(--nexus-primary), var(--nexus-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.1em;
}

.copy-code-btn {
    padding: 0.875rem 1.5rem;
    background: rgba(139, 92, 246, 0.2);
    border: 2px solid rgba(139, 92, 246, 0.4);
    border-radius: 0.5rem;
    color: var(--nexus-secondary);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.copy-code-btn:hover {
    background: rgba(139, 92, 246, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.3);
}

/* ============================================
   INSTRUCTIONS
   ============================================ */

.discount-instructions {
    background: rgba(26, 31, 46, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: left;
    margin: 1.5rem 0;
}

.discount-instructions p {
    margin-bottom: 1rem;
    color: var(--text-light);
    font-weight: 600;
}

.discount-instructions ol {
    margin: 0;
    padding-left: 1.5rem;
    color: var(--text-muted);
}

.discount-instructions li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.discount-instructions strong {
    color: var(--nexus-accent);
}

/* ============================================
   CTA BUTTON (Success State)
   ============================================ */

.exit-popup-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.125rem 2rem;
    background: linear-gradient(135deg, var(--nexus-primary), var(--nexus-secondary));
    border-radius: 0.75rem;
    color: white;
    font-size: 1.0625rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(0, 169, 255, 0.3);
    margin-top: 1rem;
}

.exit-popup-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0, 169, 255, 0.4);
    color: white;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 640px) {
    .exit-popup-content {
        width: 95%;
        max-height: 95vh;
    }

    .exit-popup-body {
        padding: 2rem 1.5rem 1.5rem;
    }

    .exit-popup-title {
        font-size: 1.5rem;
    }

    .exit-popup-subtitle {
        font-size: 1rem;
    }

    .discount-amount {
        font-size: 2rem;
    }

    .code-value {
        font-size: 1.5rem;
    }

    .benefit-item {
        padding: 0.625rem 0.875rem;
    }

    .benefit-item span {
        font-size: 0.875rem;
    }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

.exit-popup-content::-webkit-scrollbar {
    width: 8px;
}

.exit-popup-content::-webkit-scrollbar-track {
    background: rgba(26, 31, 46, 0.5);
    border-radius: 0 1.5rem 1.5rem 0;
}

.exit-popup-content::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 4px;
}

.exit-popup-content::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.5);
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .exit-popup-content,
    .exit-popup-overlay,
    .exit-popup-icon,
    .discount-badge,
    .success-icon {
        animation: none !important;
    }
    
    .exit-popup-close:hover,
    .exit-popup-button:hover,
    .exit-popup-cta:hover,
    .benefit-item:hover {
        transform: none !important;
    }
}
