/* إعدادات عامة */
body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f8f9fa;
}

/* تنسيق الهيدر */
.main-header {
  background-color: #1a252f;
  color: #ffffff;
  padding: 20px 0;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.header-container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.company-info {
  text-align: right;
}

.company-name {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  color: #ffc107;
}

.company-desc {
  margin: 5px 0 0 0;
  font-size: 14px;
  color: #dddddd;
}

.nav-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 20px;
}

.nav-menu a {
  color: #ffffff;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-menu a:hover, .nav-menu a.active {
  color: #ffc107;
}

/* ========================================== */
/*  تنسيق شبكة معرض المشروعات الثابتة          */
/* ========================================== */
.projects-section {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}

.section-title {
  text-align: center;
  color: #1a252f;
  margin-bottom: 35px;
  font-size: 24px;
  font-weight: 600;
}

.projects-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 25px;
  justify-content: center; /* يضمن توسيط الصور إذا كان العدد في السطر الأخير فردياً */
}

/* بطاقة المشروع الواحد */
.project-card {
  width: 350px; /* حجم ثابت ومناسب جداً للكمبيوتر */
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  background: #ffffff;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

/* شريط اسم المشروع أسفل الصورة */
.project-label {
  display: block;
  background: #1a252f;
  color: #ffffff;
  padding: 12px;
  font-size: 15px;
  text-align: center;
  font-weight: 500;
  border-top: 3px solid #ffc107; /* خط ذهبي رفيع يفصل الصورة عن الاسم */
}

/* تأثير تفاعلي خفيف وفخم عند تمرير الماوس فوق البطاقة */
.project-card:hover {
  transform: translateY(-5px); /* ترتفع البطاقة قليلاً لأعلى */
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* ========================================== */
/*  التجاوب الكامل مع الموبايل والشاشات الصغيرة */
/* ========================================== */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }
  
  .company-info {
    text-align: center;
  }
  
  .company-name {
    font-size: 22px;
  }
  
  .nav-menu ul {
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
  }

  .section-title {
    font-size: 18px;
    line-height: 1.6;
  }

  /* جعل عرض بطاقة الصورة يتمدد ليناسب عرض شاشة الموبايل تماماً */
  .project-card {
    width: 100%; 
    max-width: 400px; /* يمنع تمدد الصورة بشكل مفرط في الهواتف الكبيرة */
  }
  
  .project-card img {
    height: 180px; /* تقليل الارتفاع قليلاً ليناسب شاشة الهاتف */
  }
}
/* ========================================== */
/*  تفعيل ميزة التمرير الانسيابي للموقع بالكامل  */
/* ========================================== */
html {
  scroll-behavior: smooth; /* تجعل الصعود للأعلى يتحرك بنعومة بدلاً من القفز المفاجئ */
}

/* ========================================== */
/*  تنسيق زر الصعود للأعلى (بترولي غامق)       */
/* ========================================== */
.scroll-to-top {
  position: fixed;
  bottom: 30px;
  left: 30px; /* يظهر في الجهة اليسرى لأن الموقع باللغة العربية (RTL) */
  width: 50px;
  height: 50px;
  background-color: #142d32; /* لون بترولي غامق فخم وأنيق */
  color: #ffffff;
  text-align: center;
  line-height: 46px; /* لتوسط السهم داخل الدائرة */
  font-size: 24px;
  font-weight: bold;
  border-radius: 50px; /* شكل دائري بالكامل */
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  z-index: 9999; /* لضمان ظهوره فوق جميع الصور والعناصر */
  transition: all 0.3s ease;
}

/* التأثير الجمالي عند تمرير الماوس فوق الزر */
.scroll-to-top:hover {
  background-color: #ffc107; /* يتحول للون الذهبي المتناسق مع الهيدر */
  color: #1a252f;
  transform: translateY(-5px); /* يرتفع قليلاً ليعطي إيحاء بالضغط */
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* تعديل بسيط ليتناسب مكان الزر مع الهواتف الذكية لئلا يغطي المحتوى */
@media (max-width: 768px) {
  .scroll-to-top {
    bottom: 20px;
    left: 20px;
    width: 45px;
    height: 45px;
    line-height: 42px;
    font-size: 20px;
  }
}
