/* =========================================
   1. إعدادات عامة ومتغيرات الألوان
   ========================================= */
:root {
    --primary-color: #0d6efd;      /* أزرق أساسي */
    --secondary-color: #2c3e50;    /* كحلي غامق للنصوص */
    --accent-color: #ffc107;       /* ذهبي للتميز */
    --success-color: #198754;      /* أخضر للنجاح */
    --light-bg: #f8f9fa;           /* خلفية فاتحة */
    --border-radius: 10px;         /* تدوير الحواف الموحد */
}

body {
    font-family: 'Tajawal', sans-serif; /* تأكد من استدعاء الخط العربي */
    background-color: #fcfcfc;
    color: var(--secondary-color);
    line-height: 1.6;
}

.page-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 10px;
}
/* --- شريط الإعلانات المتحرك --- */
.news-ticker-wrap {
    width: 100%;
    background: #fff3cd;
    color: #856404;
    overflow: hidden;
    height: 42px;
    line-height: 42px;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    border-bottom: 1px solid #ffeeba;
}

.ticker-title {
    background: #ffc107;
    color: #000;
    padding: 0 20px;
    height: 100%;
    font-weight: bold;
    z-index: 2;
    display: flex;
    align-items: center;
}

.ticker-content {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.ticker-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: inline-block;
    animation: ticker 25s linear infinite;
    white-space: nowrap;
}

.ticker-list li {
    display: inline-block;
    padding-left: 50px;
    font-size: 14px;
    font-weight: 500;
}

.ticker-list li::before {
    content: "📢";
    margin-left: 10px;
}

@keyframes ticker {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* إيقاف الحركة عند المرور بالماوس */
.ticker-list:hover {
    animation-play-state: paused;
}
/* =========================================
   2. صفحة الرئيسية (Hero & Services)
   ========================================= */
.hero-section {
    background: linear-gradient(rgba(44, 62, 80, 0.85), rgba(44, 62, 80, 0.85)), url('../images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    padding: 120px 20px;
    border-bottom: 5px solid var(--accent-color);
}

.hero-content h1 { 
    font-size: 3.5em; 
    margin-bottom: 20px; 
    font-weight: 800;
}

.hero-buttons .btn {
    display: inline-block;
    padding: 12px 35px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    margin: 0 10px;
    transition: all 0.3s ease;
}

.btn-primary-custom { background: var(--primary-color); color: white; border: 2px solid var(--primary-color); }
.btn-primary-custom:hover { background: transparent; color: white; }

.btn-outline-custom { border: 2px solid white; color: white; }
.btn-outline-custom:hover { background: white; color: var(--secondary-color); }

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: -50px; /* تداخل بسيط مع الهيرو */
    position: relative;
    z-index: 10;
}

.service-card {
    background: white;
    padding: 40px 30px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    transition: transform 0.3s;
    border-top: 4px solid var(--primary-color);
}

.service-card:hover { transform: translateY(-10px); }
.service-card i { font-size: 3em; color: var(--primary-color); margin-bottom: 20px; }

/* =========================================
   3. صفحة الإعلانات (تنسيقات مدمجة)
   ========================================= */
.announcement-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-right: 4px solid var(--primary-color); /* شريط أيمن للعربية */
    background: #fff;
    border-radius: var(--border-radius);
}

.announcement-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1) !important;
}

.date-badge {
    background-color: var(--light-bg);
    color: #6c757d;
    font-size: 0.85rem;
    border: 1px solid #e9ecef;
    border-radius: 50px;
}

.empty-state-box {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px dashed #dee2e6;
    border-radius: var(--border-radius);
}

/* =========================================
   4. صفحة المعلمين والمكتبة
   ========================================= */
.teachers-grid, .books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.teacher-card, .book-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}

.teacher-card:hover { transform: translateY(-5px); }
.teacher-photo { width: 100%; height: 250px; object-fit: cover; }
.teacher-info { padding: 20px; }
.specialization { color: var(--success-color); font-weight: bold; display: block; margin-bottom: 10px; }

.book-cover img { width: 100px; height: 140px; object-fit: contain; margin: 20px auto; display: block; }
.download-btn {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 8px 20px;
    border-radius: 5px;
    text-decoration: none;
    margin-top: 10px;
    transition: background 0.3s;
}
.download-btn:hover { background: #0b5ed7; }

/* =========================================
   /* 5. صفحة النتائج والإحصائيات
   ========================================= */
.result-card {
    background: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    max-width: 800px;
    margin: 0 auto; /* هذا السطر يوسّط الكرت نفسه في منتصف الصفحة */
    border-top: 5px solid var(--success-color);
    
    text-align: center; /* 👈 أضف هذا السطر لتوسيط كل ما بداخل الكرت (العناوين والنموذج) */
}
/* كلاس خاص بالنموذج أو عناصر البحث */
.search-form {
    display: flex;
    justify-content: center; /* توسيط الخانة والزر أفقياً */
    align-items: center;     /* محاذاة الخانة والزر رأسياً */
    gap: 10px;               /* مسافة صغيرة بين الخانة والزر */
    margin: 20px auto 0;     /* إضافة مسافة علوية وتوسيط الحاوية */
} */
 .grades-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.grades-table th, .grades-table td { padding: 15px; text-align: center; border-bottom: 1px solid #eee; }
.grades-table th { background: var(--light-bg); color: var(--secondary-color); font-weight: 700; }

.stats-banner {
    background: var(--secondary-color);
    color: white;
    padding: 60px 0;
    margin-top: 50px;
}
.stat-item i { font-size: 2.5em; margin-bottom: 15px; color: var(--accent-color); }
.stat-item h3 { font-size: 2.5em; margin: 0; font-weight: 800; } 

/* =========================================
   6. شريط الأخبار المتحرك
   ========================================= */
.news-ticker-wrap {
    width: 100%;
    background-color: #fff3cd;
    color: #856404;
    overflow: hidden;
    height: 45px;
    line-height: 45px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #ffeeba;
}

.ticker-title {
    background-color: var(--accent-color);
    color: #000;
    padding: 0 25px;
    height: 100%;
    font-weight: bold;
    z-index: 2;
}

.ticker-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: inline-block;
    animation: ticker 25s linear infinite;
    white-space: nowrap;
}
.ticker-list li { display: inline-block; padding-left: 50px; font-size: 15px; }
.ticker-list li::before { content: "📢"; margin-left: 10px; }

@keyframes ticker {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}
.ticker-list:hover { animation-play-state: paused; }

/* =========================================
   7. التجاوب مع الشاشات الصغيرة
   ========================================= */
@media (max-width: 768px) {
    .hero-content h1 { font-size: 2em; }
    .services-grid { margin-top: 20px; }
    .stats-container { flex-direction: column; gap: 30px; }
    .ticker-title { font-size: 12px; padding: 0 10px; }
    .result-card { padding: 20px; }
}

/* إعدادات الطباعة */
@media print {
    header, footer, .search-box, .print-btn, nav, .news-ticker-wrap { display: none !important; }
    body { background: white; }
    .result-card { box-shadow: none; border: 2px solid #c0bcbc; }
}

