/* =====================================================
   🔄 Reset & Base Styles
   - إزالة الهوامش الافتراضية
   - ضبط حجم الصندوق
   - تنسيق الصفحة الأساسية
   ===================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: #0b1c3e; /* الخلفية الرئيسية */
  color: #ffffff;
  overflow-x: hidden; /* منع التمرير الأفقي */
}


/* ================= Navbar ================= */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  background: linear-gradient(90deg, #0b1c3e, #10294f);
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.navbar .logo h2 {
  color: #4da6ff;
}

.navbar .nav-links {
  display: flex;
  list-style: none;
}

.navbar .nav-links li {
  margin-left: 20px;
}

.navbar .nav-links li a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  transition: 0.3s;
}

.navbar .nav-links li a:hover {
  color: #4da6ff;
}

/* Burger */
.burger {
  display: none;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
  width: 25px;
  height: 18px;
}

.burger div {
  width: 100%;
  height: 3px;
  background-color: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Responsive */
@media screen and (max-width: 768px) {
  .nav-links {
    position: fixed;
    right: 0;
    height: 100vh;
    top: 0;
    background: linear-gradient(180deg, #0b1c3e, #10294f);
    flex-direction: column;
    align-items: center;
    width: 60%;
    transform: translateX(100%);
    transition: transform 0.5s ease-in;
    padding-top: 100px;
  }

  .nav-links li {
    margin: 20px 0;
  }

  .nav-links.active {
    transform: translateX(0);
  }

  .burger {
    display: flex;
  }

  /* Animate burger into X */
  .burger.toggle .line1 {
    transform: rotate(-45deg) translate(-5px, 6px);
  }
  .burger.toggle .line2 {
    opacity: 0;
  }
  .burger.toggle .line3 {
    transform: rotate(45deg) translate(-5px, -6px);
  }
}

/* =====================================================
   🏠 Header (القسم العلوي)
   ===================================================== */
header {
  position: relative;
  text-align: center;
  padding: 60px 20px;
  background: linear-gradient(90deg, #0b1c3e, #10294f);
  overflow: hidden;

  /* Animation */
  opacity: 0;
  transform: translateY(-50px);
  animation: fadeInDown 1s forwards 0.3s;
}

/* Keyframes للـ Header */
@keyframes fadeInDown {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* شعاع خلف النص في الهيدر */
header::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(77,166,255,0.5) 0%, transparent 70%);
  transform: translate(-50%, -50%) rotate(0deg);
  filter: blur(50px);
  animation: rotateGlow 6s linear infinite;
  z-index: 0;
}

/* النص فوق الشعاع */
header h1, header p {
  position: relative;
  z-index: 1;
}

header h1 {
  font-size: 48px;
  margin-bottom: 10px;
}

header p {
  font-size: 20px;
  color: #a0c4ff;
}

/* =====================================================
   🧩 Main Sections
   ===================================================== */
.section {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  opacity: 0; /* مخفية قبل الظهور */
  transform: translateX(50px);
  transition: all 1s ease-out;
}

.section.right {
  flex-direction: row-reverse;
  transform: translateX(-50px);
}

/* ----- النصوص ----- */
.section .content {
  max-width: 500px;
  margin: 20px;
}

.section h2 {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 32px;
  color: #4da6ff;
}

.section p {
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.6;
  color: #cce0ff;
}

/* =====================================================
   🔚 Footer
   ===================================================== */
footer {
  text-align: center;
  padding: 40px 20px;
  background-color: #081b33;
  color: #7dafff;
}

/* =====================================================
   🎞️ Animation عند التمرير
   ===================================================== */
.section.visible {
  opacity: 1;
  transform: translateX(0);
}

/* =====================================================
   🔥 Join Us Button
   ===================================================== */
.join-btn {
  display: inline-block;
  padding: 12px 28px;
  background-color: #4da6ff;
  color: #0b1c3e;
  font-weight: bold;
  border-radius: 8px;
  text-decoration: none;
  transition: 0.3s ease;
}

.join-btn:hover {
  background-color: #66b8ff;
  box-shadow: 0 0 15px rgba(77, 166, 255, 0.5);
}

/* =====================================================
   Modal Background Overlay
   ===================================================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

/* =====================================================
   Modal Box
   ===================================================== */
.modal-content {
  background: #10294f;
  padding: 30px;
  border-radius: 12px;
  width: 350px;
  text-align: center;
  color: white;
  box-shadow: 0 8px 22px rgba(0,0,0,0.5);
  transform: scale(0.7);
  opacity: 0;
  transition: 0.3s ease;
}

.modal.active {
  display: flex;
}

.modal.active .modal-content {
  transform: scale(1);
  opacity: 1;
}

/* =====================================================
   Social Icons
   ===================================================== */
.icons a {
  display: block;
  background: #4da6ff;
  color: #0b1c3e;
  padding: 12px;
  margin: 10px 0;
  border-radius: 8px;
  font-weight: bold;
  text-decoration: none;
  transition: 0.3s;
}

.icons a i {
  margin-right: 8px;
  font-size: 20px;
}

.icons a:hover {
  background: #66b8ff;
  box-shadow: 0 0 12px rgba(77,166,255,0.7);
}

.close-btn {
  margin-top: 20px;
  display: inline-block;
  cursor: pointer;
  color: #ff8080;
  font-size: 18px;
}

/* زر الإغلاق */
.close-btn {
  display: inline-block;
  margin-top: 20px;
  cursor: pointer;
  color: #ff8080;
  font-size: 18px;
  text-align: center;
  transition: color 0.3s ease;
}

.close-btn:hover {
  color: #ff4d4d;
}

/* =====================================================
   📱 Responsive: Mobile Layout
   ===================================================== */
@media (max-width: 768px) {
  .section {
    flex-direction: column !important;
    align-items: flex-start;
    text-align: left;
    padding: 50px 15px;
    gap: 20px;
  }

  .section.right {
    flex-direction: column !important;
  }

  .section .content {
    max-width: 100%;
    margin-bottom: 20px;
  }

  .section h2 {
    font-size: 26px;
  }

  .section p {
    font-size: 16px;
    line-height: 1.6;
  }

  .section img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
  }

  .join-btn {
    padding: 12px 24px;
    font-size: 16px;
  }

  .icons a {
    font-size: 16px;
    padding: 10px;
  }

  .icons a i {
    font-size: 18px;
  }
}

/* =====================================================
   🌟 Image Glow Effect
   - حاوية الصور مع شعاع خلف كل صورة
   ===================================================== */
.img-container {
  position: relative; /* مهم لجعل الشعاع خلف الصورة */
  display: inline-block;
}

/* شعاع فاتح خلف الصورة */
.img-container::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;

  /* حجم أكبر بكثير من الصورة */
  width: 650px;
  height: 650px;

  /* شعاع فاتح جداً */
  background: radial-gradient(circle, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0.15) 40%, transparent 80%);

  transform: translate(-50%, -50%);
  filter: blur(80px); /* زيادة النعومة */
  z-index: 0;
  animation: rotateGlow 10s linear infinite;
}


/* الصورة فوق الشعاع */
.img-container img {
  display: block;
  width: 350px;
  height: 350px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.5);
  position: relative; /* لتكون فوق الشعاع */
  z-index: 1;
}

/* حركة الشعاع */
@keyframes rotateGlow {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}


/* Center the header */
.hero-header {
  text-align: center;
  margin-top: 60px;
}

/* Title typing animation */
.typing {
  width: 0;
  overflow: hidden;
  white-space: nowrap;
  animation: typing 1.3s steps(20) forwards; /* أسرع */
  font-size: 3rem;
  font-weight: bold;
  color: #fff;
  margin: 0 auto; /* حتى يكون في الوسط */
}

/* Animation */
@keyframes typing {
  from { width: 0; }
  to { width: 250px; } /* عدّليها حسب طول العنوان */
}

/* Subtext styling */
.subtext {
  font-size: 1.2rem;
  color: #ddd;
  margin-top: 10px;
}

/* ======================================== */
/* Title typing animation for all <h2> */
/* ======================================== */
.section h2 {
  overflow: hidden;
  white-space: nowrap;
  display: inline-block;
  font-size: 2rem;
  font-weight: bold;
  color: #4da6ff;
  width: 0; /* يبدأ من الصفر */
}

/* Keyframes للكتابة */
@keyframes typingTitle {
  from { width: 0; }
  to { width: 100%; }
}
