/**
 * EXIT-INTENT POPUP CSS - PREMIUM EDITION
 * WOW factor + grywalizacja + dark theme
 * Last updated: 2025-12-11 by BENJI
 */

/* ============================================
   OVERLAY & BACKDROP
   ============================================ */

.exit-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.4s ease;
    overflow: hidden;
}

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

.exit-popup-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 25, 47, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ============================================
   FLOATING PARTICLES (WOW EFFECT)
   ============================================ */

/* Particles disabled for clean look */
.exit-popup-particles {
    display: none;
}

/* ============================================
   PREMIUM CARD
   ============================================ */

.exit-popup-card {
    position: relative;
    background: linear-gradient(165deg,
        rgba(20, 40, 80, 0.98) 0%,
        rgba(10, 25, 47, 0.99) 50%,
        rgba(5, 15, 35, 1) 100%
    );
    border-radius: 24px;
    max-width: 620px;
    width: 100%;
    padding: 0;
    z-index: 1;
    overflow: hidden;
    animation: cardEnter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Blue accent border */
.exit-popup-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(135deg, rgba(0, 122, 204, 0.4) 0%, rgba(0, 122, 204, 0.2) 100%);
    border-radius: 26px;
    z-index: -1;
}

/* Inner glow - disabled for cleaner look */

/* Border is now static - no animation */

@keyframes cardEnter {
    from {
        transform: translateY(40px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* ============================================
   HEADER SECTION (VALUE BADGE)
   ============================================ */

.exit-popup-header {
    position: relative;
    padding: 28px 40px 20px;
    text-align: center;
    z-index: 1;
}

/* Value indicator - shows 197 PLN value */
.popup-value-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.value-price {
    display: flex;
    align-items: center;
    gap: 10px;
}

.value-original {
    color: #ef4444;
    font-size: 1.2rem;
    font-weight: 600;
    text-decoration: line-through;
    opacity: 0.8;
}

.value-free {
    background: linear-gradient(135deg, #10b981 0%, #22c55e 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    padding: 8px 20px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

/* Progress indicator - SCOPED TO POPUP */
#exit-intent-popup .popup-progress {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    padding: 14px 20px;
    margin-bottom: 20px;
}

#exit-intent-popup .progress-text {
    color: #e2e8f0;
    font-size: 0.9rem;
    margin-bottom: 10px;
    text-align: center;
}

#exit-intent-popup .progress-text strong {
    color: #34d399;
}

#exit-intent-popup .progress-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

#exit-intent-popup .progress-bar {
    flex: 1;
    height: 8px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0%, rgba(239, 68, 68, 0.3) 100%);
    border-radius: 100px;
    overflow: visible;
    position: relative;
}

/* Waiting GIF from Giphy */
#exit-intent-popup .waiting-gif {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

#exit-intent-popup .waiting-gif img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#exit-intent-popup .progress-fill {
    height: 100%;
    width: 90%;
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    border-radius: 100px;
    animation: progressPulse 1.5s ease-in-out infinite;
    position: relative;
}

#exit-intent-popup .progress-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #34d399;
    border-radius: 50%;
    box-shadow: 0 0 10px #34d399, 0 0 20px rgba(52, 211, 153, 0.5);
    animation: progressDot 1.5s ease-in-out infinite;
}

@keyframes progressPulse {
    0%, 100% {
        width: 88%;
    }
    50% {
        width: 92%;
    }
}

@keyframes progressDot {
    0%, 100% {
        box-shadow: 0 0 10px #34d399, 0 0 20px rgba(52, 211, 153, 0.5);
        transform: translateY(-50%) scale(1);
    }
    50% {
        box-shadow: 0 0 15px #34d399, 0 0 30px rgba(52, 211, 153, 0.7);
        transform: translateY(-50%) scale(1.2);
    }
}

.popup-value-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(0, 122, 204, 0.25) 0%, rgba(0, 200, 255, 0.15) 100%);
    border: 1px solid rgba(0, 200, 255, 0.4);
    border-radius: 100px;
    padding: 8px 18px;
    margin-bottom: 16px;
}

.popup-value-badge span {
    color: #00c8ff;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.exit-popup-title {
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 12px 0;
    line-height: 1.15;
    letter-spacing: -0.5px;
}

.exit-popup-title .highlight {
    background: linear-gradient(135deg, #00c8ff 0%, #007acc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.exit-popup-subtitle {
    font-size: 1.1rem;
    color: #94a3b8;
    margin: 0;
    line-height: 1.5;
}

/* ============================================
   BENEFITS SECTION
   ============================================ */

.exit-popup-benefits {
    padding: 0 40px 24px;
    position: relative;
    z-index: 1;
}

.benefits-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
}

.benefit-item:hover {
    background: rgba(0, 122, 204, 0.08);
    border-color: rgba(0, 122, 204, 0.25);
    transform: translateX(4px);
}

.benefit-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 122, 204, 0.2) 0%, rgba(0, 200, 255, 0.1) 100%);
    border-radius: 12px;
    flex-shrink: 0;
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.benefit-item:hover .benefit-icon {
    transform: scale(1.1);
}

.benefit-content {
    flex: 1;
}

.benefit-title {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.benefit-desc {
    color: #64748b;
    font-size: 0.85rem;
    margin: 0;
}

/* Staggered animation */
.benefit-item {
    opacity: 0;
    animation: benefitSlide 0.5s ease forwards;
}

.benefit-item:nth-child(1) { animation-delay: 0.2s; }
.benefit-item:nth-child(2) { animation-delay: 0.35s; }
.benefit-item:nth-child(3) { animation-delay: 0.5s; }

@keyframes benefitSlide {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

.exit-popup-form {
    padding: 0 40px 32px;
    position: relative;
    z-index: 1;
}

.form-separator {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.form-separator::before,
.form-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.form-separator span {
    color: #64748b;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

/* MailerLite Form Overrides */
#exit-popup #mlb2-31318940.ml-form-embedContainer {
    width: 100% !important;
}

#exit-popup #mlb2-31318940 .ml-form-embedWrapper.embedForm {
    max-width: 100% !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

#exit-popup #mlb2-31318940 .ml-form-embedBody {
    padding: 0 !important;
}

#exit-popup #mlb2-31318940 .ml-form-embedContent {
    display: none !important;
}

#exit-popup #mlb2-31318940 .ml-form-fieldRow {
    margin: 0 0 14px 0 !important;
}

#exit-popup #mlb2-31318940 label.ml-label {
    display: block;
    color: #94a3b8;
    font-size: 0.85rem;
    margin: 0 0 8px 4px;
    font-weight: 500;
}

#exit-popup #mlb2-31318940 .ml-form-embedWrapper,
#exit-popup #mlb2-31318940 .ml-form-embedBody form,
#exit-popup #mlb2-31318940 .ml-form-embedBody .ml-form-formContent {
    width: 100% !important;
}

/* Premium Input Fields */
#exit-popup #mlb2-31318940 input.form-control {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    border-radius: 12px !important;
    padding: 16px 18px !important;
    font-size: 16px !important;
    outline: none !important;
    transition: all 0.3s ease;
    width: 100% !important;
    box-sizing: border-box !important;
    -webkit-appearance: none !important;
    min-height: 54px !important;
}

#exit-popup #mlb2-31318940 input.form-control::placeholder {
    color: #64748b !important;
}

#exit-popup #mlb2-31318940 input.form-control:focus {
    border-color: rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08) !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

/* Premium CTA Button */
#exit-popup #mlb2-31318940 .ml-form-embedSubmit {
    margin-top: 18px !important;
}

#exit-popup #mlb2-31318940 .ml-form-embedSubmit .primary {
    background: linear-gradient(135deg, #10b981 0%, #22c55e 100%) !important;
    border: none !important;
    color: #ffffff !important;
    padding: 18px 24px !important;
    border-radius: 14px !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    width: 100% !important;
    cursor: pointer !important;
    min-height: 58px !important;
    -webkit-appearance: none !important;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}

#exit-popup #mlb2-31318940 .ml-form-embedSubmit .primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

#exit-popup #mlb2-31318940 .ml-form-embedSubmit .primary:hover::before {
    left: 100%;
}

#exit-popup #mlb2-31318940 .ml-form-embedSubmit .primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.5);
}

#exit-popup #mlb2-31318940 .ml-form-embedSubmit .primary:active {
    transform: translateY(0);
}

/* CTA is now static - hover effect only */

/* Custom Checkboxes */
#exit-popup .consents {
    margin: 18px 0 0 0;
}

#exit-popup .consent-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin: 10px 0;
}

#exit-popup .consent-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
    position: relative;
    transition: all 0.2s ease;
}

#exit-popup .consent-item input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #10b981 0%, #22c55e 100%);
    border-color: #22c55e;
}

#exit-popup .consent-item input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 6px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

#exit-popup .consent-item input[type="checkbox"]:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

#exit-popup .consent-item .consent-text {
    color: #64748b;
    font-size: 0.8rem;
    line-height: 1.4;
}

#exit-popup .consent-item .consent-text a {
    color: #60a5fa;
    text-decoration: none;
    transition: color 0.2s ease;
}

#exit-popup .consent-item .consent-text a:hover {
    color: #93c5fd;
    text-decoration: underline;
}

/* ============================================
   TRUST BADGES
   ============================================ */

.exit-popup-trust {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    padding: 20px 40px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #10b981;
    font-size: 0.85rem;
    font-weight: 500;
}

.trust-badge svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

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

.exit-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    line-height: 1;
    z-index: 10;
}

.exit-popup-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    transform: rotate(90deg);
    border-color: rgba(255, 255, 255, 0.2);
}

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

#exit-popup #mlb2-31318940 .row-success h4,
#exit-popup #mlb2-31318940 .row-success p {
    color: #e2e8f0 !important;
}

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

@media (max-width: 768px) {
    .exit-popup-overlay {
        padding: 16px;
        align-items: flex-end;
    }

    .exit-popup-card {
        max-width: 100%;
        max-height: 90vh;
        overflow-y: auto;
        border-radius: 24px 24px 0 0;
        animation: cardEnterMobile 0.4s ease;
    }

    @keyframes cardEnterMobile {
        from {
            transform: translateY(100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    .exit-popup-header {
        padding: 24px 24px 16px;
    }

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

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

    .exit-popup-benefits {
        padding: 0 24px 20px;
    }

    .benefit-item {
        padding: 14px 16px;
    }

    .benefit-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .benefit-title {
        font-size: 0.95rem;
    }

    .exit-popup-form {
        padding: 0 24px 24px;
    }

    .exit-popup-trust {
        padding: 16px 24px;
        gap: 16px;
    }

    .trust-badge {
        font-size: 0.8rem;
    }

    /* Hide particles on mobile for performance */
    .exit-popup-particles {
        display: none;
    }
}

@media (max-width: 480px) {
    .exit-popup-header {
        padding: 20px 20px 14px;
    }

    .popup-value-badge {
        padding: 6px 14px;
    }

    .popup-value-badge span {
        font-size: 0.75rem;
    }

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

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

    .exit-popup-benefits {
        padding: 0 20px 16px;
    }

    .benefits-grid {
        gap: 10px;
    }

    .benefit-item {
        padding: 12px 14px;
        gap: 12px;
    }

    .exit-popup-form {
        padding: 0 20px 20px;
    }

    .exit-popup-trust {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
}

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

.exit-popup-overlay:focus-within .exit-popup-card {
    outline: 2px solid rgba(0, 200, 255, 0.5);
    outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
    .exit-popup-card,
    .benefit-item,
    .particle {
        animation: none !important;
    }

    .exit-popup-card::before {
        animation: none;
        background: rgba(0, 122, 204, 0.6);
    }
}

/* Prevent body scroll */
body.exit-popup-open {
    overflow: hidden;
}
