/* =========================
   🔷 1. Header Container
========================= */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  padding: 0 20px;
  background: radial-gradient(circle, rgba(5, 18, 45, 0.8) 0%, rgba(1, 3, 11, 0.8) 100%);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* =========================
   🔷 2. Hamburger Buttons
========================= */
.menu-toggle {
  width: 40px;
  height: 40px;
  margin: 0 20px;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-toggle.left {
  order: 0;
  margin-left: 0;
}

.menu-toggle.right {
  order: 2;
  margin-right: 40px;
  margin-left: 0;
}

/* =========================
   🔷 3. Branding
========================= */
.header-branding {
  order: 1;
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 160px);
}

.header-branding .site-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  color: #fff;
  letter-spacing: 0.05em;
  text-shadow: 1px 1px 2px black;
  animation: titlePulse 5s infinite;
  transition: all 0.3s ease;
}

.header-branding .site-title:hover {
  color: #00ffcc;
  text-shadow: 0 0 7px #00ffcc;
}

@media (min-width: 768px) {
  .header-branding .site-title {
    font-size: 1.2rem;
  }
}

@keyframes titlePulse {
  0%, 100% {
    text-shadow: 0 0 4px #00ffcc, 0 0 8px #00ffcc;
  }
  50% {
    text-shadow: 0 0 12px #00ffcc, 0 0 20px #00ffcc;
  }
}

.header-branding .site-logo {
  height: 65px;
  width: auto;
  filter: drop-shadow(0 0 2px #00ffcc);
}

/* =========================
   🔷 4. Hamburger Lines (Thin + Cut Pieces + Light Glow + Pulse)
========================= */
.hamburger,
.hamburger::before,
.hamburger::after {
  content: '';
  display: block;
  width: 25px;
  height: 1.4px; /* أنحف */
  background: white;
  position: absolute;
  left: 0;
  right: 0;
  margin: auto;
  border-radius: 2px;
  transition: transform 0.25s ease, box-shadow 0.15s ease, background-color 0.3s ease;
  
  /* subtle constant glow when idle */
  box-shadow: 0 0 8px rgba(0, 255, 255, 0.6);
  
  animation: heartbeat-pulse 10s infinite;
  transform-origin: center center;
}

/* خطوط قبل وبعد */
.hamburger::before {
  top: -8px;
  position: absolute;
}

.hamburger::after {
  bottom: -8px;
  position: absolute;
}

/* ===== نبض القلب "dok dok" مع تكبير ووميض أبيض ===== */
@keyframes heartbeat-pulse {
  0%, 40%, 100% {
    transform: scale(1);
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.6); /* subtle glow */
    background-color: white;
    opacity: 1;
  }
  42% {
    transform: scale(1.3);
    box-shadow: 0 0 30px rgba(255, 255, 255, 1); /* white flash */
    background-color: white;
    opacity: 1;
  }
  44% {
    transform: scale(1);
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.6);
    background-color: white;
    opacity: 1;
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.6);
  }
  72% {
    transform: scale(1.25);
    box-shadow: 0 0 25px rgba(255, 255, 255, 1);
  }
  74% {
    transform: scale(1);
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.6);
  }
}

/* تعطيل النبض عند فتح القائمة + توهج ثابت أقوى */
.menu-toggle[aria-expanded="true"] .hamburger,
.menu-toggle[aria-expanded="true"] .hamburger::before,
.menu-toggle[aria-expanded="true"] .hamburger::after {
  animation: none !important;
  box-shadow: 0 0 18px rgba(0, 255, 255, 0.8) !important;
  background-color: white !important;
}


/* حالة التحول إلى X عند فتح القائمة */
.menu-toggle[aria-expanded="true"] .hamburger {
  transform: rotate(45deg);
  background: white;
  box-shadow: 0 0 25px rgba(0, 255, 255, 0.9);
}

.menu-toggle[aria-expanded="true"] .hamburger::before {
  transform: rotate(90deg);
  top: 0;
  background: white;
  box-shadow: 0 0 25px rgba(0, 255, 255, 0.9);
}

.menu-toggle[aria-expanded="true"] .hamburger::after {
  transform: rotate(90deg);
  bottom: 0;
  background: white;
  box-shadow: 0 0 25px rgba(0, 255, 255, 0.9);
}
/* =========================
   🔷 5. Fullscreen Navigation
========================= */
.main-navigation {
  top: 0;
  position: fixed;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(1, 3, 11, 0.95);
  opacity: 0;
  visibility: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  z-index: 1050;
  padding: 20px;
  box-sizing: border-box;
  text-align: center;
}

.main-navigation.open {
  opacity: 1;
  visibility: visible;
}

/* =========================
   🔷 6. Navigation List
========================= */
.main-navigation ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  margin: 0;
  max-width: 90vw;
  width: 320px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #2ecc71 transparent;
}

.main-navigation ul::-webkit-scrollbar {
  width: 6px;
}

.main-navigation ul::-webkit-scrollbar-thumb {
  background-color: #2ecc71;
  border-radius: 3px;
}

/* =========================
   🔷 7. Navigation Items
========================= */
/* القايمة تنزلق من اليسار (مثلاً .nav-left) *//* =========================
   🔷 7. Navigation Items
========================= */
/* =========================
   🔷 7. Navigation Items
========================= */

/* Off-canvas by default */
.main-navigation.nav-left {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: rgba(1, 3, 11, 0.95);
  transform: translateX(-100%);
  transition: transform 0.4s ease;
  z-index: 1050;
}

.main-navigation.nav-right {
  position: fixed;
  top: 0;
  right: 0;
  left: auto;            /* ← override any generic left:0 */
  width: 280px;
  height: 100vh;
  background: rgba(1, 3, 11, 0.95);
  transform: translateX(100%);
  transition: transform 0.4s ease;
  z-index: 1050;
}

/* When .open is toggled, slide into view */
.main-navigation.nav-left.open,
.main-navigation.nav-right.open {
  transform: translateX(0);
}

/* Navigation list styling */
.main-navigation ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 60px 20px 20px; /* leave room for header */
  margin: 0;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}

/* =========================
   🔷 8. Nav-Link Typography & Hover
========================= */
/* Off-canvas by default */
.main-navigation.nav-left,
.main-navigation.nav-right {
  position: fixed;
  top: 0;
  /* .nav-left يستخدم left:0  و .nav-right يستخدم right:0 */
  width: 240px;                      /* عرض مخفّف للتركيز على الوسط */
  height: 100vh;

  /* الشفافية والطمس */
  background: rgba(1, 3, 11, 0.6);   /* شفافية 60% */
  backdrop-filter: blur(4px);        /* طمس خفيف للخلفية */
  box-shadow: inset 0 0 12px rgba(255,255,255,0.1);

  /* تحريك وتلاشي */
  transform: translateX(var(--off)); /* var(--off) = -100% أو +100% */
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.3s ease;
  z-index: 1050;

  /* ترتيب داخلي مركزي أفقياً، وبدء عمودي من الأعلى */
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 15%;                  /* رفع العناصر 15% من الأعلى */
}

/* نحدد قيم المتغيّر للانزلاق */
.main-navigation.nav-left { --off: -100%; left: 0; }
.main-navigation.nav-right { --off: 100%; right: 0; }

/* عند الفتح: نعيد الترجمة والتلاشي + نضيف الهالة */
.main-navigation.nav-left.open,
.main-navigation.nav-right.open {
  transform: translateX(0);
  opacity: 1;

  /* ✨ هالة توهج بالسيان */
  box-shadow: 0 0 25px rgba(0, 255, 204, 0.4),
              inset 0 0 12px rgba(255, 255, 255, 0.1);
}

/* تنسيق قائمة ul */
.main-navigation ul {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 28px;                         /* تباعد أوسع بين الروابط */
  padding: 0;
  margin: 0;
  list-style: none;
}

/* تنسيق الروابط مع خط تحتي بسيط يظهر عند hover */
.main-navigation ul li a {
  text-decoration: none;
  border-bottom: 1px solid transparent; /* شفاف افتراضياً */
  color: #ffffff;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  padding: 0;
  transition: color 0.3s ease,
              text-shadow 0.3s ease,
              border-color 0.3s ease;
}

.main-navigation ul li a:hover,
.main-navigation ul li a:focus {
  color: #00ffcc;
  text-shadow: 0 0 8px #00ffcc;
  border-bottom-color: #00ffcc;       /* يظهر خط تحتي بالسيان */
}
