/* تنسيقات عامة */
body {
    font-family: 'Cairo', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6;
    color: #333;
    direction: rtl;
    text-align: right;
}

/* استيراد خط القاهرة من جوجل فونتس */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap');

/* تنسيقات الهيدر */
.main-header {
    background-color: #1a237e; /* أزرق داكن جداً */
    color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    position: relative; /* لتمكين وضع زر الهامبرغر بالنسبة له */
}

/* قسم جديد للشعار والإعلان - محاذاة أفقية */
.header-top-section {
    display: flex;
    justify-content: space-between; /* الشعار على اليمين والإعلان على اليسار */
    align-items: center;
    padding: 15px 30px; /* بادينج لهذا القسم */
    max-width: 1200px;
    margin: 0 auto;
}

.main-header .logo {
    display: flex;
    align-items: center;
}

/* تنسيقات الشعار الجديد (الصورة) */
.main-header .logo img.site-logo {
    height: 100px; /* ارتفاع أكبر للشعار */
    width: auto;
   /* max-width: 200px;  لضمان عدم تجاوز العرض في الشاشات الصغيرة */
    border-radius: 8px; /* حواف مستديرة للشعار */
}

.ad-banner {
    flex-grow: 1; /* للسماح للإعلان بأخذ المساحة المتاحة */
    text-align: left; /* محاذاة الإعلان لليسار في وضع RTL */
    padding-right: 20px; /* مسافة بين الشعار والإعلان */
}

.ad-banner img.ad-placeholder {
    width: 100%;
    max-width: 728px; /* عرض قياسي للإعلان */
    height: 90px; /* ارتفاع قياسي للإعلان */
    background-color: #e0e0e0;
    border-radius: 8px; /* حواف مستديرة */
    object-fit: cover; /* لضمان تغطية الصورة للمساحة دون تشويه */
}

/* تنسيقات شريط التنبيهات */
.alert-bar {
    background-color: #ffc107; /* لون تحذيري (أصفر) */
    color: #333;
    padding: 10px 20px;
    text-align: center;
    font-size: 0.95em;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px; /* مسافة بين الأيقونة والنص */
    border-bottom: 2px solid #e0a800;
}

.alert-bar .alert-icon {
    color: #e0a800; /* لون الأيقونة */
    font-size: 1.2em;
}

/* تنسيقات شريط التنقل الثانوي (القائمة الرئيسية) */
.secondary-nav {
    background-color: #3f51b5; /* أزرق داكن مطابق للتصميم القديم */
    padding: 10px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.secondary-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap; /* للسماح للعناصر بالنزول لسطر جديد في الشاشات الصغيرة */
}

.secondary-nav ul li {
    position: relative; /* لتمكين القوائم المنسدلة */
    margin: 0 15px;
}

.secondary-nav ul li a {
    color: #fff;
    text-decoration: none;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 8px; /* مسافة بين الأيقونة والنص */
    font-weight: 600;
    transition: background-color 0.3s ease, border-radius 0.3s ease;
    border-radius: 8px; /* حواف مستديرة للروابط */
}

.secondary-nav ul li a:hover,
.secondary-nav ul li.active a {
    background-color: #303f9f; /* أزرق أغمق عند التمرير أو للنشط مطابق للتصميم القديم */
    border-radius: 8px;
}

/* تنسيقات القائمة المنسدلة (الأقسام) */
.secondary-nav .dropdown-content {
    display: none;
    position: absolute;
    background-color: #303f9f; /* نفس لون hover للقائمة الرئيسية */
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 8px; /* حواف مستديرة للقائمة المنسدلة */
    overflow: hidden; /* لإخفاء أي محتوى زائد عن الحواف المستديرة */
    right: 0; /* محاذاة القائمة لليمين في وضع RTL */
    text-align: right;
}

.secondary-nav .dropdown-content a {
    color: #fff; /* لون أبيض للروابط داخل القائمة المنسدلة */
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: right; /* محاذاة النص لليمين داخل القائمة */
    transition: background-color 0.3s ease;
}

.secondary-nav .dropdown-content a:hover {
    background-color: #1a237e; /* لون أغمق عند التمرير داخل القائمة المنسدلة */
}

.secondary-nav .dropdown:hover .dropdown-content {
    display: block;
}

/* زر قائمة الهامبرغر (للموبايل) */
.hamburger-menu-btn {
    display: none; /* مخفي افتراضياً في الشاشات الكبيرة */
    background: none;
    border: none;
    color: #fff;
    font-size: 1.8em;
    cursor: pointer;
    padding: 10px 20px;
    position: absolute;
    top: 15px; /* محاذاة مع قسم الشعار والإعلان */
    left: 15px; /* يظهر على اليسار في وضع RTL */
    z-index: 1000; /* ليكون فوق باقي العناصر */
}

/* تنسيقات المحتوى الرئيسي */
.main-content {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

.hero-section {
    background-color: #e3f2fd; /* أزرق فاتح جداً */
    padding: 60px 30px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.hero-section h2 {
    color: #1a237e;
    font-size: 2.5em;
    margin-bottom: 15px;
    font-weight: 700;
}

.hero-section p {
    color: #555;
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 25px;
}

.start-now-btn {
    background-color: #4CAF50; /* أخضر */
    color: #fff;
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 50px; /* زر دائري */
    font-size: 1.2em;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    display: inline-block; /* لتمكين البادينج والهوامش */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.start-now-btn:hover {
    background-color: #45a049;
    transform: translateY(-2px); /* تأثير رفع بسيط */
}

.ministry-section {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.ministry-title-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.ministry-icon {
    font-size: 2.5em;
    color: #2196f3; /* أزرق الأيقونات */
}

.ministry-section h3 {
    color: #2c3e50;
    font-size: 2.2em;
    margin: 0;
    font-weight: 700;
}

.calculators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.calculator-card {
    background-color: #f0f0f0;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px; /* ارتفاع موحد للبطاقات */
}

.calculator-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.calculator-card-icon {
    font-size: 3em;
    color: #2196f3; /* لون افتراضي للأيقونات */
    margin-bottom: 15px;
}

.calculator-card h4 {
    font-size: 1.4em;
    margin: 0;
    font-weight: 600;
    color: #2c3e50;
}

/* ألوان بطاقات الحاسبات */
.color-1 { background-color: #4CAF50; color: #fff; }
.color-1 h4 { color: #fff; }
.color-2 { background-color: #FFB74D; color: #fff; }
.color-2 h4 { color: #fff; }
.color-3 { background-color: #64B5F6; color: #fff; }
.color-3 h4 { color: #fff; }
.color-4 { background-color: #BA68C8; color: #fff; }
.color-4 h4 { color: #fff; }
.color-5 { background-color: #E57373; color: #fff; }
.color-5 h4 { color: #fff; }
.color-6 { background-color: #4DB6AC; color: #fff; }
.color-6 h4 { color: #fff; }


/* تنسيقات خاصة بصفحات المحتوى (مثل سياسة الخصوصية والشروط والأحكام) */
.content-page-section {
    padding: 40px 20px;
    max-width: 900px;
    margin: 30px auto;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    text-align: right; /* لضمان محاذاة النص لليمين */
}
.content-page-section h2 {
    font-size: 2.2em;
    color: #2c3e50;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 700;
}
.content-page-section h3 {
    font-size: 1.6em;
    color: #2196f3; /* لون أزرق مميز للعناوين الفرعية */
    margin-top: 30px;
    margin-bottom: 15px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}
.content-page-section p {
    line-height: 1.8;
    margin-bottom: 15px;
    color: #555;
    font-size: 1.1em;
}
.content-page-section ul {
    list-style-type: disc;
    margin-right: 25px; /* مسافة بادئة للقائمة في وضع RTL */
    margin-bottom: 20px;
    color: #555;
}
.content-page-section ul li {
    margin-bottom: 10px;
    line-height: 1.6;
}
.content-page-section a {
    color: #2196f3;
    text-decoration: none;
    font-weight: 600;
}
.content-page-section a:hover {
    text-decoration: underline;
}
.contact-info {
    text-align: center;
    font-size: 1.2em;
    font-weight: 600;
    color: #1a237e;
    margin-top: 20px;
}
.contact-info a {
    color: #1a237e;
    text-decoration: none;
}
.contact-info a:hover {
    text-decoration: underline;
}

/* تنسيقات خاصة بصفحة قريباً */
.coming-soon-content {
    text-align: center;
    padding: 80px 20px;
    background-color: #fff;
    max-width: 800px;
    margin: 50px auto;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.coming-soon-icon {
    font-size: 5em;
    color: #FFC107; /* لون أصفر */
    margin-bottom: 20px;
}

.coming-soon-content h2 {
    font-size: 2.5em;
    color: #2c3e50;
    margin-bottom: 15px;
}

.coming-soon-content p {
    font-size: 1.1em;
    color: #555;
    line-height: 1.7;
    margin-bottom: 10px;
}

/* تنسيقات نموذج الاتصال */
.contact-form-section {
    padding: 40px 20px;
    max-width: 700px;
    margin: 30px auto;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    text-align: right;
}

.contact-form-section h2 {
    font-size: 2.2em;
    color: #2c3e50;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 700;
}

.contact-form-section .form-group {
    margin-bottom: 20px;
}

.contact-form-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 1.05em;
}

.contact-form-section input[type="text"],
.contact-form-section input[type="email"],
.contact-form-section textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1.1em;
    background-color: #f8f8f8;
    box-sizing: border-box; /* لضمان أن البادينج لا يزيد العرض الكلي */
    direction: rtl;
    text-align: right;
}

.contact-form-section textarea {
    min-height: 120px;
    resize: vertical; /* السماح بتغيير حجم مربع النص عمودياً فقط */
}

.contact-form-section input[type="submit"] {
    background-color: #28a745; /* لون أخضر للزر */
    color: #fff;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    width: auto; /* لضبط العرض تلقائياً */
    display: block; /* لجعل الزر يأخذ سطرًا كاملاً */
    margin: 20px auto 0 auto; /* توسيط الزر */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.contact-form-section input[type="submit"]:hover {
    background-color: #218838;
    transform: translateY(-2px);
}

.form-status-message {
    padding: 10px;
    border-radius: 5px;
    margin-top: 15px;
    text-align: center;
    font-weight: bold;
    display: none; /* مخفي افتراضياً */
}

.form-status-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-status-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}


/* تنسيقات الفوتر */
.main-footer {
    background-color: #1a237e; /* نفس لون الهيدر */
    color: #fff;
    padding: 20px 30px;
    text-align: center;
    font-size: 0.95em;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.2);
    margin-top: 40px;
}

.footer-links {
    margin-bottom: 15px;
}

.footer-links a {
    color: #fff;
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #2196f3; /* أزرق فاتح عند التمرير */
}

/* Responsive design adjustments for main content (index.html) */
@media (max-width: 900px) {
    .hero-section {
        padding: 40px 15px;
    }
    .hero-section h2 {
        font-size: 1.8em;
    }
    .hero-section p {
        font-size: 1em;
    }
    .start-now-btn {
        padding: 12px 25px;
        font-size: 1.1em;
    }
    .ministry-icon {
        font-size: 2em;
    }
    .ministry-section h3 {
        font-size: 2em;
    }
    .calculators-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
    }
    .calculator-card {
        padding: 20px;
    }
    .calculator-card-icon {
        font-size: 2.5em;
    }
    .calculator-card h4 {
        font-size: 1.2em;
    }
    .content-page-section, .contact-form-section {
        padding: 30px 15px;
        margin: 20px auto;
    }
    .content-page-section h2, .contact-form-section h2 {
        font-size: 1.8em;
    }
    .content-page-section h3 {
        font-size: 1.4em;
    }
    .content-page-section p, .content-page-section ul li {
        font-size: 0.95em;
    }
    .contact-form-section label {
        font-size: 1em;
    }
    .contact-form-section input[type="text"],
    .contact-form-section input[type="email"],
    .contact-form-section textarea {
        font-size: 1em;
        padding: 10px 12px;
    }
    .contact-form-section input[type="submit"] {
        font-size: 1.1em;
        padding: 10px 20px;
    }
}

/* Responsive adjustments for header and navigation */
@media (max-width: 768px) {
    .header-top-section {
        flex-direction: column; /* ترتيب رأسي للشعار والإعلان */
        align-items: center;
        padding: 10px 15px;
    }
    .main-header .logo {
        margin-bottom: 10px;
    }
    .ad-banner {
        width: 100%;
        text-align: center;
        padding-right: 0;
    }
    .ad-banner img.ad-placeholder {
        max-width: 100%;
        height: auto; /* السماح بتعديل الارتفاع تلقائياً */
    }

    .secondary-nav {
        display: none; /* إخفاء القائمة الأفقية افتراضياً في الموبايل */
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%; /* أسفل الهيدر مباشرة */
        left: 0;
        background-color: #3f51b5; /* لون مطابق للتصميم القديم */
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        z-index: 999;
        padding: 0;
        max-height: 0; /* لإخفائها بتأثير سلس */
        overflow: hidden;
        transition: max-height 0.3s ease-out;
    }

    .secondary-nav.show {
        display: flex; /* إظهار القائمة عند إضافة فئة 'show' */
        max-height: 300px; /* ارتفاع كافٍ لإظهار جميع الروابط */
    }

    .secondary-nav ul {
        flex-direction: column;
        align-items: flex-end; /* محاذاة الروابط لليمين في القائمة الرأسية */
        width: 100%;
    }

    .secondary-nav ul li {
        margin: 0;
        width: 100%; /* جعل كل عنصر يأخذ عرضاً كاملاً */
        border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* فاصل بين الروابط */
    }
    .secondary-nav ul li:last-child {
        border-bottom: none;
    }

    .secondary-nav ul li a {
        padding: 12px 20px;
        justify-content: flex-end; /* محاذاة الأيقونة والنص لليمين */
    }

    .secondary-nav .dropdown-content {
        position: static; /* لجعل القائمة المنسدلة تظهر ضمن تدفق المستند */
        width: 100%;
        box-shadow: none;
        border-radius: 0;
        background-color: #303f9f; /* لون مطابق للتصميم القديم */
    }

    .secondary-nav .dropdown-content a {
        padding-right: 40px; /* مسافة بادئة للداخل */
        color: #fff;
    }
    .secondary-nav .dropdown-content a:hover {
        background-color: #1a237e; /* لون أغمق عند التمرير */
    }

    .hamburger-menu-btn {
        display: block; /* إظهار زر الهامبرغر في الموبايل */
    }

    .main-content {
        padding: 0 15px;
    }
}

/* تنسيقات الحاسبة */
.calculator-section {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.calculator-section h2 {
    color: #1a237e;
    font-size: 2.2em;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 700;
}

.calculator-section p {
    color: #555;
    font-size: 1.05em;
    line-height: 1.6;
    margin-bottom: 25px;
    text-align: center;
}

.calculator-form .input-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}

.calculator-form .input-group {
    flex: 1;
    min-width: 280px; /* لضمان عرض كافٍ في الشاشات الصغيرة */
    display: flex;
    flex-direction: column; /* ترتيب رأسي للعنصر والتسمية */
    position: relative; /* لتحديد موضع الـ tooltip */
}

.calculator-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 1.05em;
}

.calculator-form input[type="number"],
.calculator-form select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    margin-bottom: 15px; /* تم تقليلها لأنها داخل input-group */
    font-size: 1.1em;
    direction: rtl;
    text-align: right;
    background-color: #f8f8f8;
    box-sizing: border-box; /* إضافة box-sizing: border-box هنا */
    -webkit-appearance: none; /* Remove default arrow in Chrome/Safari */
    -moz-appearance: none;    /* Remove default arrow in Firefox */
    appearance: none;         /* Remove default arrow */
    /* إضافة سهم مخصص للقوائم المنسدلة */
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%232196f3"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: left 15px center; /* وضع السهم على اليسار في RTL */
    background-size: 18px;
    padding-left: 40px; /* مسافة كافية للسهم */
    padding-right: 15px; /* تأكيد البادينج على اليمين */
}

/* تنسيق خاص لحقول الغياب والزيارات الديناميكية */
#absentDaysInputsContainer .input-group,
#monthlyVisitsInputsWrapper .input-group {
    flex: 1;
    min-width: 250px;
    margin-bottom: 15px;
}

#monthlyVisitsInputsWrapper .input-group label {
    text-align: right;
    width: 100%;
}

/* Radio buttons styling */
.radio-group {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-top: 10px;
    margin-bottom: 15px;
}

.radio-group input[type="radio"] {
    display: none; /* Hide default radio button */
}

.radio-group label {
    background-color: #fff; /* لون أزرق داكن مطابق للتصميم القديم */
    color: #000; /* نص أبيض */
    padding: 10px 20px;
    border-radius: 8px; /* حواف مستديرة */
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center; /* توسيط النص */
    gap: 5px;
    margin-bottom: 0; /* Override default label margin */
    border: 1px solid #3f51b5; /* حدود مطابقة للخلفية */
    min-width: 80px; /* لضمان عرض كافٍ للأزرار */
}

.radio-group input[type="radio"]:checked + label {
    background-color: #1a237e; /* لون أزرق أغمق عند الاختيار مطابق للتصميم القديم */
    color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-color: #1a237e; /* حدود مطابقة للخلفية */
}

/* إزالة تنسيقات ::before لأزرار الراديو لإعادة شكلها الأصلي */
.radio-group label::before {
    content: none; /* إزالة النقطة/الدائرة المخصصة */
}


/* Buttons Group */
.buttons-group {
    text-align: center;
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap; /* للسماح للأزرار بالنزول لسطر جديد */
}

.calculate-btn, .clear-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex; /* لتمكين الأيقونة والنص معاً */
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.calculate-btn {
    background-color: #28a745; /* أخضر */
    color: #fff;
}

.calculate-btn:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.calculate-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.clear-btn {
    background-color: #f44336; /* أحمر */
    color: #fff;
}

.clear-btn:hover {
    background-color: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Results Section */
.result-group {
    background-color: #e8f5e9; /* خلفية خضراء فاتحة للنجاح */
    border: 1px solid #c8e6c9;
    padding: 25px;
    border-radius: 12px;
    margin-top: 30px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: none; /* Hidden by default, shown by JS */
    text-align: right;
    transition: all 0.5s ease-in-out;
}

.result-group.result-failure {
    background-color: #ffebee; /* خلفية حمراء فاتحة للفشل */
    border-color: #ffcdd2;
}

.result-group h3.summary-title {
    color: #1a237e;
    font-size: 1.8em;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid #c8e6c9; /* لون أخضر */
    padding-bottom: 10px;
}

.result-group.result-failure h3.summary-title {
    border-bottom-color: #ffcdd2; /* لون أحمر */
}


.result-group .result-label-right {
    display: block;
    font-weight: 700;
    color: #333;
    font-size: 1.1em;
    margin-bottom: 15px;
    text-align: right;
}

.output-values-wrapper {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #eee;
    margin-bottom: 20px;
}

.detailed-result-text {
    display: block;
    font-size: 1.2em;
    font-weight: 600;
    color: #1a237e;
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.5;
}

.monthly-results-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed #ccc;
}

.monthly-result-item {
    background-color: #fdfdfd;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #eee;
    text-align: right;
}

.monthly-result-item h4 {
    color: #2196f3;
    font-size: 1.3em;
    margin-top: 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 5px;
}

.monthly-result-item p {
    margin: 5px 0;
    font-size: 0.95em;
    color: #444;
}

.monthly-result-item strong {
    color: #1a237e;
    font-size: 1.1em;
}

.result-success-light {
    background-color: #e8f5e9; /* أخضر فاتح جداً */
    border-color: #a5d6a7;
}

.result-failure-light {
    background-color: #ffebee; /* أحمر فاتح جداً */
    border-color: #ef9a9a;
}

/* تعديل عرض قيمة الحافز الإجمالية لتظهر في سطر مستقل */
.total-incentive-box {
    display: flex;
    flex-direction: column; /* لعرض العناصر عمودياً */
    align-items: center; /* لتوسيط المحتوى */
    justify-content: center;
    gap: 5px; /* تقليل المسافة بين العناصر */
    background-color: #e0f2f7; /* أزرق سماوي فاتح */
    border: 1px solid #b3e5fc;
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.incentive-value-box .currency-text-display {
    font-size: 1.1em;
    font-weight: 600;
    color: #1a237e;
    text-align: center; /* توسيط النص */
    width: 100%; /* لجعلها تأخذ العرض الكامل */
    margin-bottom: 5px; /* مسافة إضافية أسفل النص */
}

.incentive-value-box input[type="text"] {
    border: none;
    background-color: transparent;
    font-size: 1.8em; /* تكبير حجم الخط */
    font-weight: 700;
    color: #0d47a1; /* أزرق داكن جداً */
    text-align: center;
    width: auto; /* السماح للعرض بالتكيف مع المحتوى */
    padding: 0;
    margin-bottom: 5px; /* مسافة إضافية أسفل القيمة */
}

.amount-in-words {
    display: block;
    text-align: center;
    font-size: 1.1em;
    color: #555;
    margin-top: 15px;
    line-height: 1.6;
    font-weight: 500;
}

.disclaimer-note {
    background-color: #fff3e0; /* لون برتقالي فاتح */
    border: 1px solid #ffcc80;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 0.95em;
    color: #6d4c41;
    display: flex;
    align-items: flex-start; /* محاذاة الأيقونة للأعلى */
    gap: 10px;
}

.disclaimer-note .note-icon {
    color: #ff9800; /* لون برتقالي */
    font-size: 1.3em;
    margin-top: 3px; /* لضبط محاذاة الأيقونة مع النص */
}

/* قسم شروط استحقاق الحافز */
.conditions-section {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.conditions-section h3 {
    color: #1a237e;
    font-size: 1.8em;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.conditions-section .info-icon {
    color: #2196f3;
    font-size: 1.2em;
}

.conditions-section ul {
    list-style: none; /* إزالة التنقيط الافتراضي */
    padding: 0;
    margin: 0;
}

.conditions-section ul li {
    background-color: #f9f9f9;
    border-right: 4px solid #2196f3; /* شريط أزرق على اليمين */
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    font-size: 1em;
    color: #444;
    line-height: 1.6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.conditions-section ul li strong {
    color: #1a237e;
}

/* Responsive adjustments for calculator section */
@media (max-width: 768px) {
    .calculator-section {
        padding: 20px;
    }
    .calculator-section h2 {
        font-size: 1.8em;
    }
    .calculator-section p {
        font-size: 0.95em;
    }
    .calculator-form .input-row {
        flex-direction: column;
        gap: 0; /* إزالة الفراغ بين العناصر */
    }
    .calculator-form .input-group {
        min-width: 100%; /* جعل كل حقل يأخذ عرضاً كاملاً */
        margin-bottom: 15px;
    }
    .calculator-form input[type="number"],
    .calculator-form select {
        margin-bottom: 10px; /* تعديل الهامش السفلي */
    }
    .buttons-group {
        flex-direction: column;
        gap: 15px;
    }
    .calculate-btn, .clear-btn {
        width: 100%;
        padding: 15px;
        font-size: 1.2em;
    }
    .result-group {
        padding: 20px;
    }
    .result-group h3.summary-title {
        font-size: 1.6em;
    }
    .monthly-results-container {
        grid-template-columns: 1fr; /* عمود واحد في الشاشات الصغيرة */
    }
    .incentive-value-box {
        flex-direction: column;
        gap: 5px;
        padding: 10px;
    }
    .incentive-value-box input[type="text"] {
        font-size: 1.3em;
        width: 100%;
    }
    .incentive-value-box .currency-text-display {
        font-size: 1em;
    }
    .amount-in-words {
        font-size: 1em;
    }
    .disclaimer-note {
        font-size: 0.9em;
        padding: 10px;
    }
    .conditions-section {
        padding: 20px;
    }
    .conditions-section h3 {
        font-size: 1.6em;
    }
    .conditions-section ul li {
        font-size: 0.9em;
        padding: 10px 12px;
    }
}

/* -------------------------------------------------- */
/* NEW STYLES FOR SCROLL TO TOP BUTTON AND TOOLTIPS */
/* -------------------------------------------------- */

/* Scroll to Top Button - Now within the result-group */
.scroll-to-top-btn {
    background-color: #2196f3; /* لون أزرق */
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 8px; /* حواف مستديرة مثل الأزرار الأخرى */
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: inline-flex; /* لتمكين الأيقونة والنص معاً */
    align-items: center;
    gap: 8px;
    margin-top: 20px; /* مسافة من العناصر التي فوقه */
    transition: background-color 0.3s ease, transform 0.2s ease;
    /* Removed fixed positioning as it's now inside the result group */
}

.scroll-to-top-btn:hover {
    background-color: #1976d2;
    transform: translateY(-2px);
}

/* Tooltip Styling */
.tooltip-container {
    position: relative; /* لتموضع مربع الشرح بالنسبة له */
    display: inline-flex; /* لجعل الأيقونة بجانب النص */
    align-items: center;
    gap: 5px; /* مسافة بين النص والأيقونة */
    cursor: pointer; /* للإشارة إلى أنه قابل للضغط */
}

.tooltip-icon {
    color: #2196f3; /* لون أزرق لأيقونة الاستفهام */
    font-size: 0.9em; /* حجم أصغر قليلاً من النص */
    transition: color 0.2s ease;
}

.tooltip-icon:hover {
    color: #1976d2; /* لون أزرق أغمق عند التمرير */
}

.tooltip-content {
    display: none; /* مخفي افتراضياً بواسطة CSS */
    position: absolute;
    background-color: #333; /* خلفية داكنة لمربع الشرح */
    color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.9em;
    line-height: 1.5;
    white-space: normal; /* السماح للنص بالالتفاف */
    max-width: 280px; /* عرض أقصى لمربع الشرح */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1001; /* ليكون فوق كل شيء */
    text-align: right; /* محاذاة النص لليمين */
    
    /* تحديد الموضع لظهوره أسفل الأيقونة */
    top: 100%; /* أسفل الأيقونة مباشرة */
    right: 0; /* محاذاة لليمين مع الأيقونة */
    margin-top: 10px; /* مسافة بين الأيقونة ومربع الشرح */
    
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tooltip-content.show {
    display: block; /* يتم إظهاره بواسطة JavaScript */
    opacity: 1;
    visibility: visible;
}

/* سهم صغير يشير إلى الأيقونة */
.tooltip-content::before { /* Changed from ::after to ::before for better positioning relative to top */
    content: '';
    position: absolute;
    top: -8px; /* على أعلى مربع الشرح */
    right: 15px; /* يمين مربع الشرح */
    transform: rotate(45deg);
    width: 15px;
    height: 15px;
    background-color: #333;
    border-radius: 3px;
    z-index: -1; /* ليكون خلف مربع الشرح */
}

/* Responsive adjustments for tooltips */
@media (max-width: 768px) {
    .tooltip-content {
        max-width: 90%; /* عرض أقصى في الموبايل */
        right: 50%; /* توسيط */
        transform: translateX(50%); /* توسيط */
        top: 100%;
        margin-top: 10px;
    }
    .tooltip-content::before {
        right: 50%; /* توسيط السهم */
        transform: translateX(50%) rotate(45deg);
    }
}
