/* ═══════════════════════════════════════════
   navbar.css — النافبار + بلوك الشعار navy
   قاعدة: الشعار دائماً في .nav-logo بخلفية var(--logo-bg) = #0a1628
   ═══════════════════════════════════════════ */

.nav-outer {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 16px 0;
  background: transparent;
}

.nav {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 12px 0 24px;
  background: rgba(7, 16, 31, 0.6);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--line-2);
  border-radius: var(--r-full);
}
[data-theme="light"] .nav-inner {
  background: rgba(255, 255, 255, 0.75);
}

/* ── شمال النافبار (RTL: اليمين) ── */
.nav-left {
  display: flex;
  align-items: center;
  gap: 36px;
}

/* ══ بلوك الشعار navy — القاعدة الصارمة ══
   الشعار يُعرض دائماً هنا بخلفية #0a1628
   في الوضعين الفاتح والداكن بلا استثناء    */
.nav-logo {
  background: var(--logo-bg);   /* #0a1628 — ثابت */
  border-radius: 40px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  height: 42px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  box-shadow:
    0 0 20px rgba(56, 189, 248, 0.12),
    inset 0 0 20px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
  text-decoration: none;
}
.nav-logo img {
  height: 22px;
  width: auto;
  display: block;
}

/* ── روابط النافبار ── */
.nav-links {
  display: flex;
  gap: 4px;
}

.nav-link {
  position: relative;
  padding: 8px 14px;
  font-size: 13.5px;
  color: var(--text-2);
  font-weight: 400;
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: color var(--t-fast), background var(--t-fast);
  text-decoration: none;
  font-family: var(--font-ar);
  white-space: nowrap;
}
.nav-link:hover { color: var(--text-0); background: var(--line-1); }
.nav-link.active { color: var(--text-0); }

/* ── يسار النافبار (RTL: اليسار) ── */
.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-signin {
  font-size: 13px;
  color: var(--text-2);
  padding: 8px 14px;
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: color var(--t-fast), background var(--t-fast);
  font-weight: 400;
  font-family: var(--font-ar);
  border: none;
  background: none;
}
.nav-signin:hover { color: var(--text-0); background: var(--line-1); }

/* ── Mobile: إخفاء روابط ── */
.nav-mobile-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--t-fast);
}
.nav-mobile-toggle:hover { border-color: var(--line-3); color: var(--text-0); }

.nav-mobile-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  inset-inline: 0;
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  padding: 16px;
  flex-direction: column;
  gap: 4px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}
.nav-mobile-menu.open { display: flex; }

.nav-mobile-link {
  padding: 12px 16px;
  font-size: 15px;
  color: var(--text-2);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--t-fast);
  text-decoration: none;
  font-family: var(--font-ar);
}
.nav-mobile-link:hover { color: var(--text-0); background: var(--line-1); }

.nav-mobile-divider {
  height: 1px;
  background: var(--line-2);
  margin: 8px 0;
}

@media (max-width: 768px) {
  .nav-links, .nav-signin, .btn-cta { display: none; }
  .nav-mobile-toggle { display: flex; }
  .nav-outer { position: relative; }
  .nav { position: relative; }
  .nav-inner { height: 52px; padding: 0 8px 0 16px; }
}

/* ══════════════════════════════════════════════════
   النافبار الموحد — .navbar
   يُستخدم في كل الصفحات الفرعية + SSR (worker.js)
   نفس المظهر البصري لـ .nav-outer في الصفحة الرئيسية
   ══════════════════════════════════════════════════ */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 12px var(--container-px);
  background: transparent;
}

.navbar-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 12px 0 24px;
  background: rgba(7, 16, 31, 0.6);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--line-2);
  border-radius: var(--r-full);
}
[data-theme="light"] .navbar-inner {
  background: rgba(255, 255, 255, 0.75);
}

/* ══ بلوك الشعار navy — القاعدة الصارمة ══ */
.navbar-logo {
  text-decoration: none;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

/* بلوك navy يُحيط الشعار — ثابت في الوضعين */
.logo-block {
  background: var(--logo-bg);
  border-radius: 36px;
  padding: 6px 14px;
  display: inline-flex;
  align-items: center;
  height: 42px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  box-shadow:
    0 0 20px rgba(56, 189, 248, 0.12),
    inset 0 0 20px rgba(0, 0, 0, 0.3);
  text-decoration: none;
}
.logo-block img {
  height: 22px;
  width: auto;
  display: block;
}

/* نسخة صغيرة للفوتر */
.logo-block--sm {
  background: var(--logo-bg);
  border-radius: 20px;
  padding: 5px 12px;
  display: inline-flex;
  align-items: center;
  height: 34px;
  border: 1px solid rgba(56, 189, 248, 0.15);
}
.logo-block--sm img {
  height: 18px;
  width: auto;
  display: block;
}

/* ── الجانب الأيمن من النافبار ── */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── أزرار Auth في النافبار ── */
.nav-auth {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── زر الهمبرغر (موبايل فقط) ── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: all var(--t-fast);
}
.nav-hamburger span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--text-2);
  border-radius: 2px;
  transition: all var(--t-fast);
}
.nav-hamburger:hover { border-color: var(--line-3); }
.nav-hamburger:hover span { background: var(--text-0); }

/* أزرار صغيرة للـ navbar */
.btn-sm {
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: var(--r-full);
  font-family: var(--font-ar);
  font-weight: 400;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--t-fast);
  text-decoration: none;
  cursor: pointer;
}
.btn.btn-ghost.btn-sm {
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text-2);
}
.btn.btn-ghost.btn-sm:hover { background: var(--line-1); color: var(--text-0); border-color: var(--line-3); }
.btn.btn-primary.btn-sm {
  border: none;
  background: var(--text-0);
  color: var(--bg-0);
}
.btn.btn-primary.btn-sm:hover { opacity: 0.9; }

/* Theme toggle (sub-pages يستخدمون .theme-toggle أيضاً) */
.theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text-2);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
  font-family: inherit;
}
.theme-toggle:hover { border-color: var(--line-3); color: var(--text-0); }

@media (max-width: 768px) {
  .navbar { padding: 10px 20px; }
  .navbar-inner { height: 52px; padding: 0 8px 0 16px; }
  .navbar-inner .nav-links,
  .navbar-inner .nav-auth { display: none; }
  .nav-hamburger { display: flex; }
}
