/* promotional-popup.css - Updated with Email Support */
#promotional-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#promotional-popup {
    background: white;
    border-radius: 15px;
    padding: 30px;
    width: 90%;
    max-width: 450px; /* Increased width for better email field display */
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-in-out;
    font-family: 'Almarai', sans-serif;
    direction: rtl;
    text-align: center;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideIn {
    from { 
        transform: translateY(-50px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

#popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.3s ease;
}

#popup-close:hover {
    background: #e0e0e0;
    color: #333;
}

.popup-header {
    margin-bottom: 20px;
}

.popup-logo {
    margin-bottom: 15px;
}

.popup-logo img {
    height: 80px;
}

.popup-header h2 {
    color: #2c3e50;
    font-size: 24px;
    margin: 0;
    font-weight: bold;
}

.popup-content {
    text-align: right;
}

.popup-description {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: center;
}

.discount-highlight {
    color: #e74c3c;
    font-weight: bold;
    font-size: 16px;
}

.form-group {
    margin-bottom: 15px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #2c3e50;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.form-group input:valid {
    border-color: #27ae60;
}

.form-group input:invalid:not(:placeholder-shown) {
    border-color: #e74c3c;
}

/* International telephone input styling */
.iti {
    width: 100%;
    margin-bottom: 0;
}

.iti__flag-container {
    padding: 12px;
}

.iti__selected-flag {
    border-right: none;
}

#phone {
    border-radius: 0 8px 8px 0;
    border-left: none;
    padding-left: 50px;
}

/* Contact methods section */
.contact-methods {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.contact-requirement {
    color: #495057;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
}

.contact-warning {
    color: #e74c3c;
    font-size: 13px;
    background: #fdf2f2;
    padding: 8px 12px;
    border-radius: 5px;
    margin: 10px 0;
    text-align: center;
    border-left: 3px solid #e74c3c;
    animation: fadeIn 0.3s ease-in-out;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #2c3e50;
    font-size: 14px;
}

/* Email benefits hint */
.email-benefits {
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    padding: 8px;
    border-radius: 5px;
    margin-top: 5px;
    font-size: 12px;
    color: #2e7d32;
    line-height: 1.4;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.submit-btn {
    background: #104c43!important;
    color: white!important;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    background: #0d3d35!important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 76, 67, 0.3);
}

/* Submit button disabled state removed since it's no longer needed */
.submit-btn:active {
    transform: translateY(0);
}

.cancel-btn {
    background: #ecf0f1;
    color: #7f8c8d;
    padding: 10px 30px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    background: #d5dbdb;
    color: #5d6d7e;
}

.popup-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ecf0f1;
}

.popup-footer small {
    color: #7f8c8d;
    font-size: 11px;
    line-height: 1.4;
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading .submit-btn {
    position: relative;
}

.loading .submit-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    margin-left: -10px;
    border: 2px solid transparent;
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success message */
.success-message {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    animation: fadeIn 0.3s ease-in-out;
    box-shadow: 0 2px 10px rgba(46, 204, 113, 0.3);
}

/* Error message */
.error-message {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    animation: fadeIn 0.3s ease-in-out;
    box-shadow: 0 2px 10px rgba(231, 76, 60, 0.3);
}

/* Notification status styling */
.notification-status {
    margin-top: 10px;
    text-align: right;
}

.status-item {
    padding: 5px 10px;
    margin: 5px 0;
    border-radius: 5px;
    font-size: 12px;
    border-left: 3px solid;
}

.status-item.success {
    background-color: rgba(255, 255, 255, 0.2);
    border-left-color: #fff;
}

.status-item.error {
    background-color: rgba(255, 255, 255, 0.2);
    border-left-color: #ffcdd2;
}

.status-item.info {
    background-color: rgba(255, 255, 255, 0.2);
    border-left-color: #e1f5fe;
}

/* Form validation styling */
.form-group.has-error input {
    border-color: #e74c3c;
    background-color: #fdf2f2;
}

.form-group.has-success input {
    border-color: #27ae60;
    background-color: #f2fdf2;
}

/* Field focus effects */
.form-group.focused label {
    color: #3498db;
    transform: scale(0.95);
    transition: all 0.3s ease;
}

/* Email field icon */
.form-group:has(#email)::before {
    content: "✉";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #bdc3c7;
    font-size: 16px;
    pointer-events: none;
    z-index: 1;
}

/* Phone field improvements */
.form-group:has(#phone) {
    position: relative;
}

/* Name field icon */
.form-group:has(#first-name)::before {
    content: "👤";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #bdc3c7;
    font-size: 16px;
    pointer-events: none;
    z-index: 1;
}

/* Responsive design */
@media (max-width: 480px) {
    #promotional-popup {
        width: 95%;
        padding: 20px;
        margin: 20px;
        max-width: none;
    }
    
    .popup-header h2 {
        font-size: 20px;
    }
    
    .popup-logo img {
        height: 60px;
    }
    
    .popup-description {
        font-size: 13px;
    }
    
    .contact-methods {
        padding: 10px;
        margin: 15px 0;
    }
    
    .contact-requirement {
        font-size: 13px;
    }
    
    .contact-warning {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .form-group input {
        padding: 10px;
        font-size: 13px;
    }
    
    .form-group label {
        font-size: 13px;
    }
    
    .submit-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .notification-status {
        font-size: 11px;
    }
    
    .status-item {
        padding: 3px 8px;
        font-size: 11px;
    }
}

@media (max-width: 320px) {
    #promotional-popup {
        padding: 15px;
    }
    
    .popup-header h2 {
        font-size: 18px;
    }
    
    .form-group input {
        padding: 8px;
        font-size: 12px;
    }
}

/* Print styles */
@media print {
    #promotional-popup-overlay {
        display: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    #promotional-popup {
        border: 2px solid #000;
    }
    
    .form-group input {
        border: 2px solid #000;
    }
    
    .submit-btn {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    #promotional-popup-overlay,
    #promotional-popup,
    .success-message,
    .error-message,
    .email-benefits {
        animation: none;
    }
    
    .submit-btn:hover {
        transform: none;
    }
}

/* RTL improvements */
[dir="rtl"] .iti__flag-container {
    left: 0;
    right: auto;
}

[dir="rtl"] #phone {
    padding-right: 50px;
    padding-left: 12px;
    border-radius: 8px 0 0 8px;
    border-left: 2px solid #e0e0e0;
    border-right: none;
}

[dir="rtl"] .form-group:has(#email)::before,
[dir="rtl"] .form-group:has(#first-name)::before {
    right: auto;
    left: 12px;
}

/* Accessibility improvements */
.form-group input:focus {
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.25);
}

.submit-btn:focus,
.cancel-btn:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

#popup-close:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Loading state improvements */
.loading .form-group input {
    background-color: #f8f9fa;
    cursor: not-allowed;
}

.loading .submit-btn {
    cursor: not-allowed;
    background: #95a5a6 !important;
}

/* Success state animation */
.form-submitted .form-group input {
    border-color: #27ae60;
    background-color: #f2fdf2;
}

/* Additional email field styling */
#email[type="email"]:valid {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2327ae60' viewBox='0 0 16 16'%3E%3Cpath d='M10.97 4.97a.75.75 0 0 1 1.07 1.05l-3.99 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425a.267.267 0 0 1 .02-.022z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    background-size: 16px;
}

/* WhatsApp field styling */
#phone.valid {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2327ae60' viewBox='0 0 16 16'%3E%3Cpath d='M10.97 4.97a.75.75 0 0 1 1.07 1.05l-3.99 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425a.267.267 0 0 1 .02-.022z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    background-size: 16px;
}