/* ==== قسم قائمة الواتساب الإخبارية - تصميم عصري فائق ==== */
/* تاريخ التعديل: 2025-03-28 - تصميم متطور */

/* القسم العام */
.whatsapp-newsletter {
    background-color: var(--bg-section, #f8f9fa);
    position: relative;
    padding: 80px 0;
    overflow: hidden;
    border-radius: var(--border-radius-lg, 20px);
    margin: 50px 0;
    transition: transform 0.5s ease;
}

/* الخلفية المزخرفة المحسنة */
.whatsapp-newsletter:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: var(--pattern-bg, url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23000000' fill-opacity='0.03' fill-rule='evenodd'%3E%3Ccircle cx='3' cy='3' r='3'/%3E%3Ccircle cx='13' cy='13' r='3'/%3E%3C/g%3E%3C/svg%3E"));
    opacity: 0.07;
    z-index: 0;
}

/* محتوى القسم */
.newsletter-content {
    position: relative;
    z-index: 2;
    max-width: 650px;
    margin: 0 auto;
    padding: 0 15px;
}

/* العناوين تستخدم ألوان الموقع مع تحسينات */
.whatsapp-newsletter .section-title {
    margin-bottom: 20px;
    text-align: center;
}

.whatsapp-newsletter .section-title h2 {
    color: var(--secondary-color, #333);
    margin-bottom: 5px;
    font-size: 32px;
    position: relative;
    display: inline-block;
}

.whatsapp-newsletter .section-title h2:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--primary-color, #e57965);
    border-radius: 3px;
}

.whatsapp-newsletter .section-title .subtitle {
    color: var(--primary-color, #e57965);
    font-size: 18px;
    font-weight: 500;
    margin-top: 5px;
    display: inline-block;
}

.whatsapp-newsletter .section-subtitle {
    text-align: center;
    margin-bottom: 35px;
    color: var(--text-color, #555);
    font-size: 16px;
    line-height: 1.7;
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
}

/* تنسيق النموذج - تصميم فائق العصرية */
.newsletter-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 500px;
    margin: 35px auto;
    background: rgba(255, 255, 255, 0.9); /* تحسين الشفافية */
    backdrop-filter: blur(20px); /* تأثير زجاجي محسن */
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px; /* زوايا أكثر استدارة */
    padding: 30px; /* زيادة الحشو الداخلي */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 10px 20px rgba(0, 0, 0, 0.05); /* ظل مزدوج أكبر للعمق */
    gap: 24px; /* زيادة المسافة بين العناصر الرئيسية */
    border: 1px solid rgba(255, 255, 255, 0.7); /* حدود أكثر وضوحًا */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* انتقال مع تأثير متقدم */
    position: relative;
    z-index: 5;
}

.newsletter-form:hover {
    transform: translateY(-10px); /* رفع أكبر عند التحويم */
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.12), 0 10px 25px rgba(0, 0, 0, 0.08); /* ظل أكبر عند التحويم */
}

/* حاوية الحقول - تصميم متكامل ومحسن */
.input-row {
    display: flex;
    width: 100%;
    gap: 0; /* إزالة الفجوة بين الحقول */
    margin-bottom: 8px;
    position: relative;
    border-radius: 18px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    background: white;
    padding: 6px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.input-row:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border-color: rgba(229, 121, 101, 0.2);
}

/* حقل اختيار الدولة - متكامل مع حقل الإدخال وتحسين المحاذاة */
.country-select {
    width: 130px; /* ثبات العرض */
    height: 56px; /* ثبات الارتفاع */
    padding: 0 15px 0 35px; /* تعديل الحشو */
    border: none;
    background-color: transparent;
    border-radius: 12px 0 0 12px; /* زوايا مستديرة على اليمين فقط */
    font-size: 17px; /* تعديل حجم الخط */
    font-weight: 500;
    color: var(--secondary-color, #444);
    cursor: pointer;
    font-family: var(--font-family, 'Tajawal', sans-serif);
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23444' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 15px center;
    flex-shrink: 0;
    z-index: 2;
}

.country-select:focus {
    outline: none;
}

/* خط فاصل بين حقل الدولة وحقل الإدخال */
.input-row:before {
    content: '';
    position: absolute;
    height: 30px;
    width: 1px;
    background-color: rgba(0, 0, 0, 0.1);
    left: 110px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

/* أيقونة الواتساب داخل حقل الإدخال */
.input-row:after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512' fill='%2325D366'%3E%3Cpath d='M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 224.1-99.6 224.1-222 0-59.3-25.2-115-67.1-157zm-157 341.6c-33.2 0-65.7-8.9-94-25.7l-6.7-4-69.8 18.3L72 359.2l-4.4-7c-18.5-29.4-28.2-63.3-28.2-98.2 0-101.7 82.8-184.5 184.6-184.5 49.3 0 95.6 19.2 130.4 54.1 34.8 34.9 56.2 81.2 56.1 130.5 0 101.8-84.9 184.6-186.6 184.6zm101.2-138.2c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-32.6-16.3-54-29.1-75.5-66-5.7-9.8 5.7-9.1 16.3-30.3 1.8-3.7.9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 35.2 15.2 49 16.5 66.6 13.9 10.7-1.6 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    left: 127px; /* تعديل موضع الأيقونة */
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

/* حقل إدخال رقم الواتساب - متكامل مع حقل الدولة */
.newsletter-input {
    flex: 1;
    height: 56px; /* تعديل الارتفاع */
    padding: 0 20px 0 50px; /* تعديل الحشو */
    border-radius: 12px; /* تعديل الزوايا */
    font-size: 17px; /* تعديل حجم الخط */
    background-position: left 20px center; /* تعديل موضع الخلفية */
    background-size: 22px; /* تعديل حجم الخلفية */
    border: none;
    background-color: transparent;
    font-family: var(--font-family, 'Tajawal', sans-serif);
    transition: all 0.3s ease;
    z-index: 1;
}

.newsletter-input::placeholder {
    color: #aaa;
    font-size: 15px;
}

.newsletter-input:focus {
    outline: none;
}

.input-row:focus-within {
    box-shadow: 0 0 0 2px var(--primary-light, rgba(229, 121, 101, 0.2)), 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-light, rgba(229, 121, 101, 0.5));
}

/* زر الاشتراك الآن - تصميم فائق العصرية ومتناسق */
.newsletter-btn.whatsapp-btn {
    width: 100%;
    height: 58px; /* زيادة الارتفاع قليلاً */
    background: linear-gradient(135deg, #25D366, #128C7E); /* تدرج ألوان الواتساب */
    color: white;
    border: none;
    border-radius: 18px; /* زوايا مستديرة متناسقة مع النموذج */
    padding: 0 30px; /* تعديل الحشو */
    font-weight: 700; /* خط أكثر سمكاً */
    font-size: 18px; /* تعديل حجم الخط */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* انتقال مع تأثير متقدم */
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.3); /* ظل أكبر */
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px; /* تباعد أحرف محسن */
}

.newsletter-btn.whatsapp-btn: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: 0.5s;
}

.newsletter-btn.whatsapp-btn:hover:before {
    left: 100%;
}

.newsletter-btn.whatsapp-btn:hover {
    background: linear-gradient(135deg, #128C7E, #075E54); /* تدرج أغمق عند التحويم */
    transform: translateY(-3px); /* رفع طفيف عند التحويم */
    box-shadow: 0 12px 25px rgba(37, 211, 102, 0.35); /* ظل أكبر عند التحويم */
}

.newsletter-btn.whatsapp-btn i {
    font-size: 18px;
    color: white;
}

.newsletter-btn.whatsapp-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.5), 0 8px 20px rgba(37, 211, 102, 0.25);
}

/* قائمة المميزات - تصميم أكثر جاذبية */
.benefits-list {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 30px auto 15px;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 10px 18px;
    border-radius: 30px;
    font-size: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.benefit-item:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background-color: var(--primary-color, #e57965);
    opacity: 0;
    transition: all 0.3s ease;
}

.benefit-item:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.08);
    background-color: white;
}

.benefit-item:hover:before {
    opacity: 1;
}

.benefit-item i {
    color: var(--primary-color, #e57965);
    font-size: 17px;
}

.benefit-item span {
    font-weight: 500;
    color: var(--secondary-color, #333);
}

/* إشعار الخصوصية */
.privacy-notice {
    margin-top: 15px;
    color: var(--light-text, #777);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    padding: 10px;
    border-radius: 8px;
}

.privacy-notice:hover {
    background-color: rgba(255, 255, 255, 0.5);
    color: var(--secondary-color, #333);
}

.privacy-notice i {
    color: var(--primary-color, #e57965);
    transition: transform 0.3s ease;
}

.privacy-notice:hover i {
    transform: scale(1.2);
}

/* رسالة النجاح */
.success-message {
    background-color: white;
    border-radius: 20px;
    padding: 35px 30px;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    border-top: 4px solid #25D366;
    animation: fadeInUp 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    position: relative;
}

.success-message:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at 10% 90%, rgba(37, 211, 102, 0.1), transparent), 
                      radial-gradient(circle at 90% 10%, rgba(37, 211, 102, 0.1), transparent);
    border-radius: 20px;
    opacity: 0.5;
}

.success-message i {
    font-size: 48px;
    color: #25D366;
    margin-bottom: 15px;
    display: block;
    animation: scaleIn 0.5s 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.success-message h4 {
    color: var(--secondary-color, #333);
    font-size: 22px;
    margin-bottom: 10px;
    animation: fadeInUp 0.5s 0.3s ease both;
}

.success-message p {
    color: var(--light-text, #777);
    line-height: 1.7;
    animation: fadeInUp 0.5s 0.4s ease both;
}

/* الأشكال المتحركة - تحديث */
.floating-shapes {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
}

.shape {
    position: absolute;
    opacity: 0.4;
    border-radius: 50%;
    filter: blur(1px);
}

.shape-1 {
    top: 15%;
    left: 15%;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-light, #f9d8d2), var(--primary-color, #e57965));
    animation: float1 12s infinite ease-in-out;
}

.shape-2 {
    bottom: 20%;
    right: 15%;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-light, #f9d8d2), var(--primary-color, #e57965));
    animation: float2 15s infinite ease-in-out;
}

.shape-3 {
    top: 45%;
    right: 25%;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-light, #f9d8d2), var(--primary-color, #e57965));
    animation: float3 10s infinite ease-in-out;
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-15px, 15px) rotate(5deg); }
    50% { transform: translate(10px, 20px) rotate(10deg); }
    75% { transform: translate(15px, 5px) rotate(5deg); }
}

@keyframes float2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(15px, -10px) rotate(-5deg); }
    50% { transform: translate(5px, 10px) rotate(-10deg); }
    75% { transform: translate(-10px, 5px) rotate(-5deg); }
}

@keyframes float3 {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
    50% { transform: translate(-10px, 15px) scale(1.1) rotate(10deg); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

/* تعديلات للشاشات الصغيرة */
@media (max-width: 576px) {
    .newsletter-form {
        padding: 25px 20px;
        gap: 18px;
        border-radius: 20px;
    }

    .input-row {
        flex-direction: column;
        gap: 0;
        border-radius: 15px;
    }

    .country-select {
        width: 100%;
        border-radius: 12px 12px 0 0;
        padding-left: 40px;
        height: 52px;
        font-size: 16px;
        text-align: center;
    }

    .input-row:before {
        height: 1px;
        width: 90%;
        left: 5%;
        top: 52px; /* تعديل الموضع */
    }

    .input-row:after {
        left: 15px;
        top: 75px; /* تعديل الموضع */
    }

    .newsletter-input {
        border-radius: 0 0 12px 12px;
        padding-left: 40px;
        height: 54px; /* زيادة قليلة في الارتفاع */
        font-size: 16px;
        text-align: center;
    }

    .newsletter-btn.whatsapp-btn {
        height: 54px;
        font-size: 17px;
    }

    .benefit-item {
        width: 100%;
        justify-content: center;
    }

    .whatsapp-float-btn {
        width: 58px;
        height: 58px;
        bottom: 20px;
        left: 20px;
    }
    
    .whatsapp-float-btn i {
        font-size: 30px;
    }
}

/* CSS للتحقق من صحة النموذج وحالة التحميل */
.newsletter-form .error {
    border-color: #dc3545 !important;
    background-color: rgba(220, 53, 69, 0.05) !important;
}

.newsletter-form .error-message {
    color: #dc3545;
    font-size: 0.85em;
    margin-top: 5px;
    margin-bottom: 10px;
    display: block;
    text-align: right;
}

.newsletter-form.loading {
    opacity: 0.7;
    pointer-events: none;
}

.newsletter-form.loading button {
    cursor: not-allowed;
}

/* تحسينات لحقل الإدخال */
.newsletter-input:focus {
    box-shadow: 0 0 0 2px rgba(229, 121, 101, 0.2) !important;
    border-color: var(--primary-light, rgba(229, 121, 101, 0.5)) !important;
}

/* تحسينات لعناصر النجاح */
.success-message {
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* أنماط زر الواتساب الثابت */
.whatsapp-btn {
    position: fixed;
    left: 20px; /* الجانب الأيسر للمشاهد */
    bottom: 20px;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 9999; /* أعلى من كل العناصر */
    transition: all 0.3s ease;
    text-decoration: none;
}

.whatsapp-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
}

/* تأثير النبض حول الزر */
.whatsapp-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #25D366;
    border-radius: 50%;
    z-index: -1;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    70% {
        transform: scale(1.3);
        opacity: 0;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* زر الواتساب العائم - تحسين مع إضافة تأثيرات احترافية */
.whatsapp-float-btn {
    position: fixed;
    bottom: 25px;
    left: 25px; /* زيادة المسافة عن حافة الشاشة */
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, #25D366, #128C7E); /* تدرج لوني جميل */
    color: #fff;
    border-radius: 50%;
    text-align: center;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.25);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(255, 255, 255, 0.3); /* إضافة حدود لمظهر أكثر احترافية */
}

.whatsapp-float-btn i {
    font-size: 33px;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2)); /* ظل للأيقونة */
}

.whatsapp-float-btn:hover,
.whatsapp-float-btn:focus {
    background: linear-gradient(135deg, #128C7E, #075E54); /* تدرج أغمق عند التحويم */
    color: #fff;
    transform: scale(1.1) rotate(5deg); /* تأثير دوران بسيط عند التحويم */
    text-decoration: none;
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.35);
}

/* أنيميشن نبض محسن للفت الانتباه */
.whatsapp-float-btn {
    animation: whatsapp-pulse-enhanced 2.5s infinite;
}

@keyframes whatsapp-pulse-enhanced {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* إضافة تأثير وميض عند التحويم */
.whatsapp-float-btn:before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: 0.5s;
    pointer-events: none;
}

.whatsapp-float-btn:hover:before {
    left: 100%;
}

/* زر العودة للأعلى - للتأكيد على موضعه في الجهة اليمنى */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px; /* التأكيد على وضعه في الجهة اليمنى */
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 50px;
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover,
.back-to-top:focus {
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    transform: translateY(-5px);
    text-decoration: none;
}
