/* ============================================
   جامعة بني سويف - كلية علوم ذوي الاحتياجات الخاصة
   الملف: style.css
   الوصف: الأنماط الأساسية المشتركة لجميع الصفحات
   ============================================ */

/* --- استيراد الخط الرسمي --- */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap');

/* --- المتغيرات الأساسية --- */
:root {
  --color-primary:     #0a3d7a;   /* الأزرق الداكن الرسمي */
  --color-primary-mid: #1a5fa8;   /* أزرق متوسط للتمييز */
  --color-primary-light:#e8f0fb;  /* أزرق فاتح جداً للخلفيات */
  --color-gold:        #c9960c;   /* الذهبي للتمييز */
  --color-gold-light:  #fdf3dc;   /* ذهبي فاتح للخلفيات */
  --color-white:       #ffffff;
  --color-bg:          #f5f7fa;   /* خلفية الصفحة الرمادية الفاتحة */
  --color-text:        #1a1a1a;   /* لون النص الأساسي */
  --color-text-muted:  #555555;   /* لون النص الثانوي */
  --color-border:      #dde4ef;   /* لون الحدود */
  --color-footer:      #07285a;   /* أزرق أغمق للفوتر */

  --font-main: 'Cairo', Tahoma, Arial, sans-serif;

  --shadow-sm: 0 1px 4px rgba(0,0,0,0.08);
  --shadow-md: 0 3px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 6px 24px rgba(0,0,0,0.12);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --transition: all 0.25s ease;
}

/* --- إعادة ضبط عامة --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;   /* يمنع السكرول الأفقي الناتج عن RTL */
  height: 100%;
}

body {
  font-family: var(--font-main);
  font-size: 15px;
  line-height: 1.75;
  color: var(--color-text);
  background: var(--color-bg);
  direction: rtl;
  min-height: 100vh;        /* الصفحة تملأ الشاشة دايماً */
  display: flex;
  flex-direction: column;   /* يدفع الفوتر للأسفل */
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  cursor: pointer;
  font-family: var(--font-main);
  border: none;
  background: none;
}

/* ============================================
   تخطيط عام - يملأ الشاشة ويدفع الفوتر للأسفل
   ============================================ */
main,
.contact-page,
.news-page,
.staff-page,
.projects-page,
.about-page {
  flex: 1;
}

/* ============================================
   الشريط العلوي (Top Bar)
   ============================================ */
.topbar {
  background: var(--color-primary);
  color: rgba(255,255,255,0.85);
  font-size: 12px;
  padding: 6px 0;
  border-bottom: 2px solid var(--color-gold);
}

.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.topbar-right span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-left a {
  color: rgba(255,255,255,0.80);
  font-size: 12px;
  padding: 2px 0;
  border-bottom: 1px solid transparent;
}

.topbar-left a:hover {
  color: var(--color-white);
  border-bottom-color: var(--color-gold);
}

/* ============================================
   الهيدر (Header)
   ============================================ */
.header {
  background: var(--color-white);
  padding: 14px 0;
  box-shadow: var(--shadow-sm);
  border-bottom: 3px solid var(--color-gold);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-logo img {
  width: 70px;
  height: 70px;
  object-fit: contain;
}

.header-logo-text {
  line-height: 1.4;
}

.header-logo-text .univ-name {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 600;
}

.header-logo-text .faculty-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.3;
}

.header-logo-text .faculty-name-en {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 400;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-search {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  font-size: 16px;
  transition: var(--transition);
}

.btn-search:hover {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

/* ============================================
   القائمة الرئيسية (Navbar)
   ============================================ */
.navbar {
  background: var(--color-primary);
  position: relative;
  z-index: 999;
}

.navbar .container {
  padding: 0;
}

.nav-list {
  display: flex;
  align-items: stretch;
}

.nav-list > li {
  position: relative;
}

.nav-list > li > a {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 14px 18px;
  color: rgba(255,255,255,0.92);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: var(--transition);
  border-bottom: 3px solid transparent;
}

.nav-list > li > a:hover,
.nav-list > li.active > a {
  background: rgba(255,255,255,0.08);
  color: var(--color-white);
  border-bottom-color: var(--color-gold);
}

.nav-list > li > a .arrow {
  font-size: 10px;
  opacity: 0.7;
  margin-right: 2px;
}

/* القائمة المنسدلة */
.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--color-white);
  min-width: 210px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  border-top: 3px solid var(--color-gold);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.dropdown a {
  display: block;
  padding: 10px 18px;
  font-size: 13px;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  transition: var(--transition);
}

.dropdown a:last-child {
  border-bottom: none;
}

.dropdown a:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
  padding-right: 24px;
}

.nav-list > li:hover .dropdown {
  display: block;
}

/* ============================================
   الحاوية الرئيسية (Container)
   ============================================ */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================
   عنوان القسم (Section Header)
   ============================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-border);
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary);
  position: relative;
  padding-right: 14px;
}

.section-title::before {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 22px;
  background: var(--color-gold);
  border-radius: 2px;
}

.section-more {
  font-size: 13px;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: var(--transition);
}

.section-more:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

/* ============================================
   البطاقات العامة (Cards)
   ============================================ */
.card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--color-primary-light);
}

.card-img-placeholder {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-mid) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-body {
  padding: 16px;
}

.card-date {
  font-size: 11px;
  color: var(--color-gold);
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.6;
  margin-bottom: 8px;
}

.card-text {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.7;
}

.card-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  border-bottom: 1.5px solid transparent;
}

.card-link:hover {
  border-bottom-color: var(--color-primary);
}

/* ============================================
   الشبكات (Grids)
   ============================================ */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* ============================================
   الأزرار (Buttons)
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background: var(--color-primary-mid);
  border-color: var(--color-primary-mid);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

.btn-gold {
  background: var(--color-gold);
  color: var(--color-white);
  border-color: var(--color-gold);
}

.btn-gold:hover {
  background: #a67d0a;
  border-color: #a67d0a;
}

/* ============================================
   عنوان الصفحة الداخلية (Page Hero)
   ============================================ */
.page-hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-mid) 100%);
  color: var(--color-white);
  padding: 36px 0;
  margin-bottom: 36px;
}

.page-hero h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 8px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255,255,255,0.80);
}

.breadcrumb a {
  color: rgba(255,255,255,0.80);
}

.breadcrumb a:hover {
  color: var(--color-white);
}

.breadcrumb .sep {
  font-size: 10px;
  opacity: 0.6;
}

/* ============================================
   الفوتر (Footer)
   ============================================ */
.footer {
  background: var(--color-footer);
  color: rgba(255,255,255,0.80);
  padding: 40px 0 0;
  margin-top: auto;         /* يدفع الفوتر للأسفل دايماً */
  padding-bottom: 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.footer-col h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-gold);
  display: inline-block;
}

.footer-col p {
  font-size: 13px;
  line-height: 1.8;
  color: rgba(255,255,255,0.72);
  margin-bottom: 8px;
}

.footer-col a {
  display: block;
  font-size: 13px;
  color: rgba(255,255,255,0.72);
  margin-bottom: 8px;
  padding-right: 10px;
  position: relative;
  transition: var(--transition);
}

.footer-col a::before {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  background: var(--color-gold);
  border-radius: 50%;
}

.footer-col a:hover {
  color: var(--color-white);
  padding-right: 14px;
}

.footer-bottom {
  padding: 16px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: rgba(255,255,255,0.55);
}

/* ============================================
   مؤشر التحميل (Loading)
   ============================================ */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: var(--color-text-muted);
  font-size: 14px;
  gap: 10px;
}

/* ============================================
   رسالة فارغ (Empty State)
   ============================================ */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--color-text-muted);
}

.empty-state p {
  font-size: 15px;
  margin-top: 10px;
}

/* ============================================
   شريط الإحصائيات (Stats Bar)
   ============================================ */
.stats-bar {
  background: var(--color-primary);
  padding: 28px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

.stat-item {
  text-align: center;
  color: var(--color-white);
  padding: 16px;
  border-left: 1px solid rgba(255,255,255,0.15);
}

.stat-item:last-child {
  border-left: none;
}

.stat-num {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-gold);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  font-weight: 600;
}

/* ============================================
   الاستجابة للشاشات الصغيرة (Responsive)
   ============================================ */
@media (max-width: 992px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .header .container { flex-wrap: wrap; }
  .nav-list { flex-wrap: wrap; }
  .nav-list > li > a { padding: 10px 12px; font-size: 13px; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .topbar .container { flex-direction: column; gap: 6px; }
  .page-hero h1 { font-size: 20px; }
}

@media (max-width: 576px) {
  .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .section-header { flex-direction: column; align-items: flex-start; gap: 10px; }
}