/* css/style.css */
body, button {
    font-family: "Zain", sans-serif;
    background-color: #eef2f7;
    color: #333;
    margin: 0;
    text-align: center;
    line-height: 1.6;
    direction: rtl; /* اتجاه النص من اليمين لليسار */
}
.container {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    max-width: 900px;
    margin: 30px auto;
    border: 1px solid #e0e0e0;
}
h1 {
    color: #007bff;
    margin-bottom: 30px;
    font-size: 2.5em;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
    display: inline-block;
}
h2 {
    color: #0056b3;
    margin-top: 40px;
    margin-bottom: 25px;
    font-size: 1.8em;
}
.tool-section {
    margin-bottom: 40px;
    padding: 25px;
    border: 1px solid #dcdcdc;
    border-radius: 10px;
    background-color: #fcfdff;
    text-align: right;
}
.tool-section p {
    margin-bottom: 15px;
}
label {
    display: inline-block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
    min-width: 150px;
    text-align: right;
    padding-left: 10px;
}
input[type="date"],
input[type="number"],
input[type="text"] {
    padding: 12px 15px;
    margin: 5px 0;
    border-radius: 6px;
    border: 1px solid #c0c0c0;
    width: calc(100% - 180px);
    box-sizing: border-box;
    font-size: 1em;
    transition: border-color 0.3s ease-in-out;
}
input[type="date"]:focus,
input[type="number"]:focus,
input[type="text"]:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.2);
}
button {
    padding: 12px 25px;
    margin: 15px 0 5px;
    border-radius: 6px;
    border: none;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
}
button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}
button:active {
    background-color: #004085;
    transform: translateY(0);
}
.result {
    margin-top: 25px;
    padding: 15px;
    background-color: #e9f7ef;
    border-radius: 8px;
    font-size: 1.2em;
    font-weight: bold;
    color: #28a745;
    border: 1px solid #c3e6cb;
    text-align: center;
}
.result p {
    margin: 8px 0;
}
.radio-group {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 10px;
    margin-bottom: 20px;
    gap: 20px;
}
@media screen and (max-width: 768px) {
    .radio-group{
        flex-direction: column;
    }
}
.radio-group label {
    min-width: unset;
    font-weight: normal;
    cursor: pointer;
    padding-right: 5px;
}
.radio-group input[type="radio"] {
    width: auto;
    margin-left: 5px;
    cursor: pointer;
    transform: scale(1.2);
}
nav {
    margin-bottom: 30px;
    background-color: #f8f9fa;
    padding: 15px 0;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 25px;
}
nav ul li a {
    text-decoration: none;
    color: #007bff;
    font-weight: bold;
    font-size: 1.1em;
    padding: 8px 15px;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}
nav ul li a:hover {
    background-color: #007bff;
    color: white;
}


/* في ملف css/style.css */
html {
    font-size: 16px; /* حجم الخط الأساسي للمستند، يساعد في استخدام وحدات rem */
}

body {
    font-family: 'Zain', sans-serif; /* تم تضمينه بالفعل، وهو جيد */
    line-height: 1.6; /* ارتفاع سطر مريح للقراءة */
    color: #333; /* لون نص أساسي */
}

h1 {
    font-size: 2.5rem; /* مثال لحجم عنوان رئيسي */
}

h2 {
    font-size: 2rem; /* مثال لحجم عنوان فرعي */
}

p {
    font-size: 1rem; /* مثال لحجم الفقرات */
}

/* استعلام الوسائط للشاشات الصغيرة لتعديل أحجام الخطوط */
@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }
    h2 {
        font-size: 1.5rem;
    }
    p {
        font-size: 0.95rem;
    }
}

/* استعلامات وسائط إضافية للشاشات الأصغر */
@media (max-width: 576px) {
    .container {
        padding: 20px; /* تقليل الحشوة */
    }

    h1 {
        font-size: 1.6rem; /* تصغير العنوان الرئيسي أكثر */
        margin-bottom: 20px;
    }

    h2 {
        font-size: 1.4rem; /* تصغير العنوان الفرعي */
        margin-top: 30px;
        margin-bottom: 15px;
    }

    .tool-section {
        padding: 15px; /* تقليل الحشوة الداخلية لقسم الأداة */
    }

    label {
        min-width: 120px; /* تقليل الحد الأدنى لعرض التسميات */
    }

    input[type="date"],
    input[type="number"],
    input[type="text"] {
        width: 100%; /* تعديل عرض حقول الإدخال */
        padding: 10px; /* تقليل الحشوة الداخلية */
        font-size: 0.9em; /* تصغير حجم الخط */
    }
}

/* تنسيقات حاوية إدخال التاريخ الهجري المنفصلة */
.hijri-input-container {
    display: flex;
    flex-wrap: wrap; /* السماح بالالتفاف على الشاشات الصغيرة */
    align-items: center; /* محاذاة العناصر عمودياً */
    gap: 10px; /* مسافة بين التسمية ومجموعة الحقول والزر */
    margin-bottom: 15px; /* نفس المسافة السفلية للفقرات */
}

.hijri-input-container label {
    margin-bottom: 0; /* إزالة الهامش السفلي للتسمية عند استخدام flex */
    /* ترث min-width و padding-left من القاعدة العامة للتسميات */
}

.hijri-date-fields-group {
    display: flex;
    gap: 5px; /* مسافة بين حقول اليوم والشهر والسنة */
    align-items: center;
    flex-grow: 1; /* لجعل مجموعة الحقول تشغل المساحة المتاحة */
}

.hijri-date-fields-group input[type="number"].hijri-date-part {
    width: 70px; /* عرض محدد لحقل اليوم والشهر */
    margin: 0; /* إزالة الهوامش الافتراضية للحقول */
    text-align: center;
    flex-grow: 0; /* عدم السماح بالنمو أكثر من العرض المحدد */
    flex-shrink: 0; /* عدم السماح بالتقلص */
}

.hijri-date-fields-group input[type="number"].hijri-year-part {
    width: 90px; /* عرض أكبر لحقل السنة */
}

/* تعديلات التجاوب لحاوية الإدخال الهجري */
@media (max-width: 768px) {
    .hijri-input-container {
        flex-direction: column; /* تكديس العناصر عمودياً */
        align-items: stretch; /* جعل العناصر تمتد بعرض الحاوية */
        gap: 8px; /* تعديل المسافة للتكديس العمودي */
    }

    .hijri-input-container label {
        text-align: right; /* الحفاظ على محاذاة النص */
        margin-bottom: 0; /* المسافة تأتي من gap الحاوية */
        min-width: auto; /* إلغاء min-width المحدد سابقاً */
        width: 100%;
    }

    .hijri-date-fields-group {
        width: 100%; /* مجموعة الحقول تأخذ العرض الكامل */
        justify-content: space-between; /* توزيع الحقول داخل المجموعة */
    }

    .hijri-date-fields-group input[type="number"].hijri-date-part,
    .hijri-date-fields-group input[type="number"].hijri-year-part {
        flex-grow: 1; /* السماح للحقول بالنمو لملء المساحة */
        width: auto; /* السماح لـ flex-grow بالتحكم في العرض */
        min-width: 50px; /* حد أدنى للعرض لضمان القراءة */
    }

    .hijri-input-container button {
        width: 100%; /* الزر يأخذ العرض الكامل */
        margin-top: 5px; /* مسافة صغيرة فوق الزر */
    }
    
}

.result.error {
    background-color: #f8d7da; /* لون خلفية أحمر فاتح */
    color: #721c24;       /* لون نص أحمر غامق */
    border-color: #f5c6cb;   /* لون إطار محمر */
    font-weight: normal;  /* يمكن تعديل وزن الخط حسب الرغبة */
}

footer{
    background-color: #333;
    color: #e0e0e0;
    padding: 5px 0;
}
footer a{
    color: #e0e0e0;
}
footer p{
    padding: 0;
}
