/* 1. إعدادات الصفحة الأساسية - لضمان ثبات الفوتر أسفل الشاشة */
html, body {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    font-family: 'Tajawal', sans-serif;
    background-color: #fdf2f0;
}

.main-content {
    flex: 1 0 auto; /* السر في دفع الفوتر للأسفل */
}

/* 2. تنسيق الهيدر الموحد والنحيف جداً */
header {
    background: linear-gradient(90deg, #ff7043, #0d47a1);
    color: white;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* الشريط العلوي - أيقونة القائمة (تظهر في الجوال فقط) */
.top-bar {
    width: 100%;
    display: flex;
    justify-content: flex-start; 
    padding: 8px 15px; 
    box-sizing: border-box;
}

.menu-toggle {
    font-size: 26px;
    cursor: pointer;
    line-height: 1;
}

/* منطقة العنوان - تم إضافة 20px كقيمة افتراضية للحاسوب */
.header-content {
    text-align: center;
    padding: 20px 15px 15px 15px; 
}

.header-content h1 {
    margin: 0;
    font-size: 1.4rem;
    line-height: 1.1;
}

.header-content p {
    margin: 4px 0 0 0;
    font-size: 0.85rem;
    opacity: 0.9;
}

/* 3. تنسيق القائمة (nav) والروابط */
nav {
    width: 100%;
    background: #0d47a1;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
}

nav ul li a {
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    display: block;
    font-size: 0.9rem;
}

nav ul li a.active {
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 2px solid #ff7043;
}

/* 4. تنسيق المحتوى (Section) */
section {
    padding: 30px 20px;
    max-width: 1000px;
    margin: 0 auto;
    line-height: 1.7;
}

/* 5. الفوتر */
footer {
    flex-shrink: 0;
    background: #0d47a1;
    color: white;
    text-align: center;
    padding: 15px 0;
    border-top: 2px solid #ff7043;
}

/* 6. تعديلات الشاشات */

/* إعدادات الجوال (شاشات أصغر من 768px) */
@media (max-width: 768px) {
    /* إلغاء المسافة العلوية في الجوال لأن الـ top-bar موجود */
    .header-content {
        padding: 0 15px 15px 15px; 
    }

    nav { 
        display: none; 
    }
    nav.active { 
        display: block; 
    }
    nav ul {
        flex-direction: column;
    }
    nav ul li {
        border-top: 1px solid rgba(255,255,255,0.1);
    }
}

/* إعدادات الحاسوب (شاشات أكبر من 769px) */
@media (min-width: 769px) {
    .top-bar { 
        display: none; 
    }
    /* لمسة جمالية لتكبير الاسم قليلاً في المتصفح الكبير */
    .header-content h1 {
        font-size: 1.7rem;
    }
}