/**
 * Lead Forms - Exit Intent Popup Overlay
 * 
 * Fullscreen overlay with centered form container.
 * Features:
 * - Backdrop blur effect
 * - Fade-in + slide-down animations
 * - Floating close button (X)
 * - Mobile responsive
 * 
 * @package GeneratePressChild
 * @since 2.7.0
 */

/* Exit Intent Overlay (Fullscreen) */
.gp-lead-exit_intent {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: gp-fadeIn 0.3s ease-out;
}

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

/* Backdrop (Dark overlay with blur) */
.gp-lead-exit_intent__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Container (Form wrapper) */
.gp-lead-exit_intent__container {
    position: relative;
    z-index: 2;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: gp-slideDown 0.4s ease-out;
}

@keyframes gp-slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Close Button (Floating X) */
.gp-lead-exit_intent__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 3;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gp-lead-exit_intent__close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: rotate(90deg);
}

.gp-lead-exit_intent__close:active {
    transform: rotate(90deg) scale(0.95);
}

/* Form inside popup (enhanced shadow) */
.gp-lead-exit_intent .gp-lead-form {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 
                0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Ensure form title is visible (accessibility) */
.gp-lead-exit_intent .gp-lead-form__title {
    margin-top: 0;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .gp-lead-exit_intent__container {
        max-width: 95%;
        max-height: 95vh;
    }
    
    .gp-lead-exit_intent__close {
        top: 0.5rem;
        right: 0.5rem;
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
}

/* Tablet (adjust container width) */
@media (min-width: 641px) and (max-width: 1024px) {
    .gp-lead-exit_intent__container {
        max-width: 600px;
    }
}

/* Desktop (optimal form width) */
@media (min-width: 1025px) {
    .gp-lead-exit_intent__container {
        max-width: 500px;
    }
}

/* Scrollbar styling (optional, for long forms) */
.gp-lead-exit_intent__container::-webkit-scrollbar {
    width: 8px;
}

.gp-lead-exit_intent__container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.gp-lead-exit_intent__container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.gp-lead-exit_intent__container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* Accessibility: Focus visible on close button */
.gp-lead-exit_intent__close:focus-visible {
    outline: 3px solid #0073aa;
    outline-offset: 2px;
}

/* Animation for success state (form submitted) */
.gp-lead-exit_intent .gp-lead-form__success {
    animation: gp-successPulse 0.6s ease-out;
}

@keyframes gp-successPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}
