/* =========================================
   1. المتغيرات والأساسيات (مأخوذة من index.css)
   ========================================= */
:root {
    --primary-color: #0056b3; 
    --primary-dark: #004494;
    --secondary-color: #c5a059; 
    --text-dark: #2c3e50;
    --text-light: #6c757d;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --font-main: 'Cairo', sans-serif;
    --section-padding: 90px 0;
    --border-radius: 12px;
    --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 15px 35px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: var(--font-main);
    color: var(--text-dark);
    line-height: 1.7;
    background-color: var(--bg-light); /* خلفية الصفحة كاملة */
    overflow-x: hidden;
}
ul { list-style: none; }
a { text-decoration: none; color: inherit; transition: var(--transition); }
img { max-width: 100%; height: auto; display: block; }
.container { width: 90%; max-width: 1200px; margin: 0 auto; padding: 0 15px; }
.section-padding { padding: var(--section-padding); }
.animate-fade-up { animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards; opacity: 0; transform: translateY(40px); }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

/* =========================================
   2. القائمة العلوية (Header) مطابقة للرئيسية
   ========================================= */
header {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
    padding: 15px 0; transition: var(--transition);
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px); box-shadow: var(--shadow-sm);
}
header.scrolled { padding: 8px 0; box-shadow: var(--shadow-md); background-color: rgba(255, 255, 255, 0.98); }
header .container { max-width: 95%; }
.navbar { display: flex; justify-content: space-between; align-items: center; width: 100%; }

.logo { display: flex; align-items: center; gap: 12px; font-weight: 900; font-size: 1.5rem; color: var(--primary-color); z-index: 1002; }
.logo img { height: 45px; width: auto; transition: transform 0.3s; }
.logo:hover img { transform: scale(1.05); }

.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a:not(.btn-nav):not(.staff-login-btn) {
    font-weight: 700; color: var(--text-dark); position: relative;
    padding: 5px 0; font-size: 1rem;
}
.nav-links a:not(.btn-nav):not(.staff-login-btn)::after {
    content: ''; position: absolute; bottom: -2px; right: 0; width: 0; height: 3px;
    background-color: var(--secondary-color); transition: var(--transition); border-radius: 2px;
}
.nav-links a:hover, .nav-links a.active { color: var(--primary-color); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.btn-nav {
    background-color: var(--primary-color); color: var(--white) !important;
    padding: 10px 24px; border-radius: 50px; font-size: 0.95rem; font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 86, 179, 0.25); border: 2px solid var(--primary-color);
}
.btn-nav:hover { background-color: transparent; color: var(--primary-color) !important; transform: translateY(-2px); }

.staff-login-btn {
    width: 42px; height: 42px; border-radius: 50%; background-color: #f1f3f5;
    color: var(--text-light) !important; display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; border: 1px solid #e9ecef;
}
.staff-login-btn:hover {
    background-color: var(--secondary-color); color: var(--white) !important;
    border-color: var(--secondary-color); transform: rotate(15deg);
}

.menu-toggle { display: none; font-size: 1.8rem; background: none; border: none; color: var(--primary-color); z-index: 1002; cursor: pointer; }

/* =========================================
   3. تصميم قسم الإعلانات الخاص (احترافي)
   ========================================= */
/* قسم العنوان (الهيرو الداخلي) */
.announcements-hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    padding: 160px 0 80px; /* المسافة العلوية لتعويض الهيدر الثابت */
    text-align: center;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

/* إضافة نمط زخرفي للخلفية */
.announcements-hero::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 60%);
    z-index: 1;
}

.announcements-hero .container { position: relative; z-index: 2; }
.announcements-hero h1 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 20px;
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.announcements-hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
}

/* شبكة البطاقات */
.announcements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 35px;
}

/* تصميم البطاقة */
.ann-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
}

.ann-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--secondary-color);
}

.ann-img-wrapper {
    height: 240px;
    overflow: hidden;
    position: relative;
    border-bottom: 3px solid var(--secondary-color);
}

.ann-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.ann-card:hover .ann-img-wrapper img { transform: scale(1.08); }

.ann-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--secondary-color);
    color: var(--white);
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.ann-body { padding: 30px 25px 20px; flex-grow: 1; }

.ann-date {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--primary-color);
    background: rgba(0, 86, 179, 0.08);
    padding: 5px 12px;
    border-radius: 15px;
    margin-bottom: 15px;
    font-weight: 700;
}

.ann-body h3 {
    font-size: 1.4rem;
    color: var(--text-dark);
    margin-bottom: 15px;
    font-weight: 800;
    line-height: 1.5;
}

.ann-body p {
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 0;
    /* إخفاء النص الزائد بثلاثة أسطر */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ann-footer {
    padding: 0 25px 25px;
    border-top: 1px solid #f8f9fa;
    padding-top: 20px;
    margin-top: auto;
}

.btn-read {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-weight: 800;
    font-size: 1.05rem;
    transition: var(--transition);
}

.btn-read:hover {
    color: var(--secondary-color);
    gap: 15px;
}

/* شاشة التحميل والرسائل */
.loader-wrapper {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: var(--primary-color);
}
.loader-wrapper i { font-size: 3rem; margin-bottom: 15px; }
.loader-wrapper p { font-size: 1.2rem; font-weight: 700; }

/* =========================================
   7. الفوتر 
   ========================================= */
footer { background-color: #0a0e14; color: #a0aab5; padding: 70px 0 20px; font-size: 0.95rem; }
.footer-content {
    display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 50px;
    margin-bottom: 50px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); padding-bottom: 50px;
}
.footer-logo { display: flex; align-items: center; gap: 15px; color: var(--white); font-size: 1.8rem; font-weight: 900; margin-bottom: 25px; }
.footer-col h3 { color: var(--white); margin-bottom: 25px; font-size: 1.2rem; font-weight: 800; position: relative; padding-bottom: 10px;}
.footer-col h3::after { content: ''; position: absolute; bottom: 0; right: 0; width: 40px; height: 3px; background: var(--secondary-color); border-radius: 2px;}
.footer-links li { margin-bottom: 15px; }
.footer-links a:hover { color: var(--secondary-color); padding-right: 8px; }

.social-links { display: flex; gap: 15px; }
.social-icon {
    width: 45px; height: 45px; background: rgba(255, 255, 255, 0.05); color: #fff;
    display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 1.2rem; transition: var(--transition);
}
.social-icon:hover { transform: translateY(-5px); background: var(--secondary-color); }
.copyright { text-align: center; font-size: 0.95rem; color: #666;}

/* =========================================
   5. التجاوب باحترافية (Media Queries)
   ========================================= */
@media (max-width: 1200px) {
    .menu-toggle { display: block; }
    .nav-links {
        position: fixed; top: 0; right: -100%; width: 300px; height: 100vh;
        background-color: var(--white); flex-direction: column; align-items: flex-start;
        padding: 90px 25px 30px; gap: 20px; box-shadow: -5px 0 20px rgba(0,0,0,0.15);
        transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); z-index: 1000; overflow-y: auto;
    }
    .nav-links.active { right: 0; }
    .nav-links a:not(.btn-nav):not(.staff-login-btn) { width: 100%; padding: 12px 0; border-bottom: 1px solid #f1f3f5; font-size: 1.1rem;}
    .nav-links a::after { display: none; }
    .btn-nav { width: 100%; text-align: center; margin-top: 15px; }
    .staff-login-btn { width: 100%; border-radius: 8px; justify-content: flex-start; padding: 12px 20px; gap: 10px; }
    .staff-login-btn::after { content: 'دخول الموظفين'; font-family: 'Cairo'; font-size: 1rem; font-weight: bold;}
}

@media (max-width: 992px) {
    .footer-content { grid-template-columns: 1fr 1fr; gap: 40px; }
    .announcements-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}

@media (max-width: 768px) {
    .announcements-hero { padding: 130px 0 60px; }
    .announcements-hero h1 { font-size: 2.2rem; }
    .announcements-hero p { font-size: 1.1rem; }
    
    .footer-content { grid-template-columns: 1fr; text-align: center; }
    .footer-col h3::after { left: 50%; transform: translateX(-50%); right: auto; }
    .social-links { justify-content: center; }
    .footer-logo { justify-content: center; }
}

@media (max-width: 480px) {
    .announcements-grid { grid-template-columns: 1fr; }
    .announcements-hero h1 { font-size: 1.8rem; }
}