/* Newsletter Popup Styles */
.newsletter-popup {
    position: fixed;
    z-index: 10000;
    width: 350px;
    max-width: 90vw;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    color: white;
    font-family: 'Arial', sans-serif;
    overflow: hidden;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.newsletter-popup.show {
    transform: translateY(0);
    opacity: 1;
}

.newsletter-popup.left {
    left: 30px;
    bottom: 30px;
}

.newsletter-popup.right {
    right: 30px;
    bottom: 30px;
}

.newsletter-popup.center {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
}

.newsletter-popup.center.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.popup-header {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    text-align: center;
    position: relative;
}

.popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.popup-close:hover {
    opacity: 1;
}

.popup-icon {
    font-size: 48px;
    margin-bottom: 10px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.popup-title {
    font-size: 24px;
    font-weight: bold;
    margin: 0 0 5px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.popup-subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin: 0;
}

.popup-content {
    padding: 25px;
}

.offer-badge {
    background: #ff6b6b;
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    display: inline-block;
    animation: pulse 2s infinite;
}

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

.popup-description {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 20px;
    opacity: 0.95;
}

.popup-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.popup-input {
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    transition: all 0.3s;
}

.popup-input:focus {
    outline: none;
    background: white;
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.popup-input::placeholder {
    color: #666;
}

.popup-submit {
    background: linear-gradient(45deg, #ff6b6b, #ffa500);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.popup-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 107, 107, 0.4);
}

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

.popup-benefits {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.popup-benefits li {
    padding: 5px 0;
    font-size: 14px;
    opacity: 0.9;
}

.popup-benefits li:before {
    content: "✓";
    color: #4CAF50;
    font-weight: bold;
    margin-right: 8px;
}

.popup-footer {
    text-align: center;
    padding: 15px;
    font-size: 12px;
    opacity: 0.8;
    background: rgba(0, 0, 0, 0.1);
}

/* Exit Intent Popup Styles */
.exit-intent-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 15000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.exit-intent-popup.show {
    opacity: 1;
    visibility: visible;
}

.exit-popup-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    color: white;
    position: relative;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.exit-intent-popup.show .exit-popup-content {
    transform: scale(1);
}

.exit-popup-emoji {
    font-size: 64px;
    margin-bottom: 20px;
    animation: shake 0.5s ease-in-out infinite alternate;
}

@keyframes shake {
    0% { transform: translateX(0); }
    100% { transform: translateX(5px); }
}

.exit-popup-title {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.exit-popup-subtitle {
    font-size: 18px;
    margin-bottom: 25px;
    opacity: 0.9;
}

.exit-popup-offer {
    background: #ff6b6b;
    color: white;
    padding: 15px 25px;
    border-radius: 30px;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 25px;
    display: inline-block;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { box-shadow: 0 0 20px rgba(255, 107, 107, 0.5); }
    to { box-shadow: 0 0 30px rgba(255, 107, 107, 0.8); }
}

.exit-popup-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.exit-popup-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.exit-popup-btn.primary {
    background: linear-gradient(45deg, #ff6b6b, #ffa500);
    color: white;
}

.exit-popup-btn.secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.exit-popup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* Center Position Popup */
.newsletter-popup.center {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    z-index: 10001;
}

.newsletter-popup.center.show {
    transform: translate(-50%, -50%) scale(1);
}

/* Enhanced Mobile Optimization */
@media (max-width: 768px) {
    .newsletter-popup {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        transform: translate(-50%, -50%) scale(0.8) !important;
        width: 90% !important;
        max-width: 350px !important;
        max-height: 80vh !important;
        overflow-y: auto !important;
        margin: 0 !important;
    }
    
    .newsletter-popup.show {
        transform: translate(-50%, -50%) scale(1) !important;
    }
    
    .popup-content {
        flex-direction: column !important;
        padding: 20px !important;
    }
    
    .popup-form {
        flex-direction: column !important;
        gap: 12px !important;
    }
    
    .popup-input {
        width: 100% !important;
        margin-bottom: 10px !important;
        font-size: 16px !important; /* Prevent zoom on iOS */
    }
    
    .popup-submit {
        width: 100% !important;
        padding: 14px !important;
        font-size: 16px !important;
    }
    
    /* Improved touch targets */
    .popup-close {
        width: 44px !important;
        height: 44px !important;
        font-size: 24px !important;
    }
    
    /* Better spacing for mobile */
    .popup-benefits {
        margin: 15px 0 !important;
    }
    
    .popup-benefits li {
        padding: 8px 0 !important;
        font-size: 14px !important;
    }
    
    .exit-popup-content {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .exit-popup-title {
        font-size: 24px;
    }
    
    .exit-popup-buttons {
        flex-direction: column;
    }
    
    .exit-popup-btn {
        width: 100%;
    }
}

/* Tablet Optimization */
@media (min-width: 769px) and (max-width: 1024px) {
    .newsletter-popup {
        width: 400px !important;
        max-width: 90vw !important;
    }
    
    .popup-content {
        padding: 25px !important;
    }
}

/* High DPI Display Optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .newsletter-popup {
        border: 0.5px solid rgba(255, 255, 255, 0.2);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .newsletter-popup {
        transition: opacity 0.2s ease !important;
        transform: translate(-50%, -50%) !important;
    }
    
    .newsletter-popup.show {
        transform: translate(-50%, -50%) !important;
    }
    
    .newsletter-popup.left.show,
    .newsletter-popup.right.show {
        transform: translateY(-50%) !important;
    }
    
    .offer-badge {
        animation: none !important;
    }
    
    .popup-icon {
        animation: none !important;
    }
}

/* Loading Animation */
.popup-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success Animation */
.popup-success {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.popup-success .popup-icon {
    animation: checkmark 0.6s ease-in-out;
}

@keyframes checkmark {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Enhanced Offer Styling */
.offer-value {
    background: linear-gradient(45deg, #ff6b6b, #ffa500);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 18px;
    font-weight: bold;
    margin: 10px 0;
    display: inline-block;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    animation: valueGlow 2s ease-in-out infinite alternate;
}

@keyframes valueGlow {
    from { box-shadow: 0 0 15px rgba(255, 107, 107, 0.6); }
    to { box-shadow: 0 0 25px rgba(255, 165, 0, 0.8); }
}

/* Urgency Timer */
.urgency-timer {
    background: rgba(255, 0, 0, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 15px;
    font-size: 16px;
    font-weight: bold;
    margin: 15px 0;
    text-align: center;
    animation: urgentPulse 1s ease-in-out infinite;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

@keyframes urgentPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.timer-text {
    font-size: 14px;
    margin-bottom: 5px;
    opacity: 0.9;
}

.timer-countdown {
    font-size: 20px;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

/* Social Proof */
.social-proof {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    text-align: center;
    border-left: 4px solid #4CAF50;
}

.social-proof-text {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.social-proof-stats {
    font-size: 16px;
    font-weight: bold;
    color: #4CAF50;
}

/* Trust Badges */
.trust-badges {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.trust-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 5px;
}

.trust-badge-icon {
    font-size: 14px;
}

/* Enhanced Exit Intent Popup */
.exit-popup-value {
    background: linear-gradient(45deg, #ff6b6b, #ffa500);
    color: white;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 24px;
    font-weight: bold;
    margin: 20px 0;
    display: inline-block;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: megaGlow 2s ease-in-out infinite alternate;
}

@keyframes megaGlow {
    from { 
        box-shadow: 0 0 20px rgba(255, 107, 107, 0.6);
        transform: scale(1);
    }
    to { 
        box-shadow: 0 0 40px rgba(255, 165, 0, 0.9);
        transform: scale(1.05);
    }
}

.exit-popup-urgency {
    background: rgba(255, 0, 0, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    margin: 15px 0;
    animation: urgentBlink 1.5s ease-in-out infinite;
}

@keyframes urgentBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.exit-popup-social {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 20px;
    border-radius: 15px;
    margin: 15px 0;
    font-size: 14px;
    border-left: 4px solid #4CAF50;
}

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

.exit-popup-input {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    box-sizing: border-box;
}

.exit-popup-input:focus {
    outline: none;
    background: white;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

.exit-popup-trust {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.exit-trust-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 11px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Mobile Enhancements */
@media (max-width: 768px) {
    .offer-value {
        font-size: 16px;
        padding: 8px 16px;
    }
    
    .urgency-timer {
        font-size: 14px;
        padding: 10px 15px;
    }
    
    .timer-countdown {
        font-size: 18px;
    }
    
    .exit-popup-value {
        font-size: 20px;
        padding: 12px 24px;
    }
    
    .trust-badges {
        gap: 8px;
    }
    
    .trust-badge {
        font-size: 11px;
        padding: 6px 10px;
    }
}