/* exit-intent.css */

#exit-intent-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 999999;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#exit-intent-overlay.show {
    opacity: 1;
}

.exit-intent-popup {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f9f0 100%);
    border-radius: 24px;
    max-width: 480px;
    width: 90%;
    margin: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: translateY(30px) scale(0.9);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 3px solid #5cb85c;
}

#exit-intent-overlay.show .exit-intent-popup {
    transform: translateY(0) scale(1);
}

.popup-header {
    background: linear-gradient(135deg, #5cb85c, #4a9c4a);
    color: white;
    padding: 30px 25px 25px;
    border-radius: 21px 21px 0 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.popup-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 24px;
    position: relative;
    z-index: 1;
}

.popup-title {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.2;
    position: relative;
    z-index: 1;
}

.popup-subtitle {
    font-size: 16px;
    opacity: 0.9;
    margin: 0;
    position: relative;
    z-index: 1;
}

.popup-content {
    padding: 30px 25px;
    text-align: center;
}

.discount-highlight {
    background: linear-gradient(135deg, #fff 0%, #f8fff8 100%);
    border: 2px solid #5cb85c;
    border-radius: 16px;
    padding: 20px;
    margin: 0 0 25px 0;
    position: relative;
    overflow: hidden;
}

.discount-highlight::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(92, 184, 92, 0.1), transparent);
    animation: slideAcross 2s infinite;
}

@keyframes slideAcross {
    0% { left: -100%; }
    100% { left: 100%; }
}

.discount-text {
    color: #2d5a2d;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px 0;
}

.discount-amount {
    color: #5cb85c;
    font-size: 32px;
    font-weight: 900;
    display: block;
    line-height: 1;
}

.popup-description {
    color: #555;
    font-size: 16px;
    line-height: 1.5;
    margin: 0 0 25px 0;
}

#exit-intent-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#exit-intent-email {
    padding: 16px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    color: #333;
    font-family: inherit;
}

#exit-intent-email:focus {
    outline: none;
    border-color: #5cb85c;
    box-shadow: 0 0 0 4px rgba(92, 184, 92, 0.1);
    transform: translateY(-1px);
}

#exit-intent-email::placeholder {
    color: #999;
}

#exit-intent-submit {
    background: linear-gradient(135deg, #5cb85c, #4a9c4a);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-family: inherit;
}

#exit-intent-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(92, 184, 92, 0.3);
}

#exit-intent-submit:active:not(:disabled) {
    transform: translateY(0);
}

#exit-intent-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#exit-intent-close {
    background: none;
    border: none;
    color: #999;
    font-size: 14px;
    cursor: pointer;
    margin-top: 15px;
    transition: color 0.3s ease;
    font-family: inherit;
}

#exit-intent-close:hover {
    color: #666;
}

.message {
    display: none;
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 14px;
    text-align: center;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.trust-badges {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
    font-size: 12px;
}

.trust-icon {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 600px) {
    .exit-intent-popup {
        max-width: 95%;
        margin: 10px;
    }
    
    .popup-header {
        padding: 25px 20px 20px;
    }
    
    .popup-content {
        padding: 25px 20px;
    }
    
    .popup-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
        margin-bottom: 12px;
    }
    
    .popup-title {
        font-size: 24px;
    }
    
    .popup-subtitle {
        font-size: 15px;
    }
    
    .discount-highlight {
        padding: 16px;
        margin-bottom: 20px;
    }
    
    .discount-text {
        font-size: 16px;
    }
    
    .discount-amount {
        font-size: 28px;
    }
    
    .popup-description {
        font-size: 15px;
        margin-bottom: 20px;
    }
    
    #exit-intent-email {
        padding: 14px 16px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    #exit-intent-submit {
        padding: 14px 20px;
        font-size: 15px;
    }
}

@media (max-width: 400px) {
    .popup-header {
        padding: 20px 15px 15px;
    }
    
    .popup-content {
        padding: 20px 15px;
    }
    
    .popup-title {
        font-size: 22px;
    }
    
    .discount-amount {
        font-size: 26px;
    }
    
    .trust-badges {
        flex-direction: column;
        gap: 8px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .exit-intent-popup {
        background: linear-gradient(135deg, #1a2e1a 0%, #1f3a1f 100%);
        border-color: #4a9c4a;
    }
    
    .popup-content {
        color: #e0e0e0;
    }
    
    .discount-highlight {
        background: linear-gradient(135deg, #2a2a2a 0%, #1f3a1f 100%);
        border-color: #4a9c4a;
    }
    
    .discount-text {
        color: #b8e6b8;
    }
    
    .popup-description {
        color: #ccc;
    }
    
    #exit-intent-email {
        background: #2a2a2a;
        border-color: #444;
        color: #e0e0e0;
    }
    
    #exit-intent-email:focus {
        border-color: #5cb85c;
        background: #333;
    }
    
    #exit-intent-close {
        color: #aaa;
    }
    
    #exit-intent-close:hover {
        color: #ccc;
    }
    
    .trust-badges {
        border-color: #444;
    }
    
    .trust-badge {
        color: #aaa;
    }
}