/* ========================================================
   RAYAAN UNIFIED NAVIGATION SYSTEM
   Shared across Homepage (عن ريآن), System Page (نظام ريآن),
   and Contact Page (تواصل معنا).
   ======================================================== */

:root {
  --nav-green-deep: #0b4d2c;
  --nav-green-mid: #1b6d3e;
  --nav-green-light: #2d8a50;
  --nav-green-soft: rgba(11, 77, 44, 0.08);
  --nav-text-dark: #1a261f;
  --nav-text-muted: #64748b;
  --nav-glass-bg: rgba(255, 255, 255, 0.88);
  --nav-glass-border: rgba(255, 255, 255, 0.95);
  --nav-glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --nav-glass-mobile: rgba(255, 255, 255, 0.94);
  --nav-radius-pill: 9999px;
  --nav-trans-fast: 0.18s ease;
  --nav-trans-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ========================================================
   DESKTOP FLOATING GLASS HEADER
   (Logo on Left, Nav & Pills on Right matching Reference)
   ======================================================== */
.desktop-glass-header {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1080px, 94%);
  z-index: 1000;
  pointer-events: auto;
  transition: transform var(--nav-trans-smooth), background var(--nav-trans-smooth), box-shadow var(--nav-trans-smooth);
}

.desktop-glass-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  padding: 0 14px 0 20px;
  background: var(--nav-glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--nav-glass-border);
  border-radius: var(--nav-radius-pill);
  box-shadow: var(--nav-glass-shadow);
  direction: ltr; /* Keeps logo on left and nav pills on right */
}

/* Brand Link (Left) */
.desktop-glass-header .brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  direction: rtl;
}

/* Official mark used by the approved About page header. */
.header-official-logo {
  height: 42px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(7, 63, 36, 0.08));
}

.desktop-glass-header .brand-logo-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.desktop-glass-header .palm-svg-logo {
  width: 32px;
  height: 32px;
}

.desktop-glass-header .brand-titles {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.desktop-glass-header .brand-ar {
  font-size: 20px;
  font-weight: 900;
  color: var(--nav-green-deep);
  letter-spacing: -0.5px;
}

.desktop-glass-header .brand-en {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--nav-green-light);
  margin-top: 1px;
}

/* Nav Links (Right) */
.desktop-glass-header .desktop-nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  direction: rtl;
}

.desktop-glass-header .nav-anchor {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  color: var(--nav-text-dark);
  text-decoration: none;
  border-radius: var(--nav-radius-pill);
  box-sizing: border-box;
  transition: color var(--nav-trans-fast), background var(--nav-trans-fast);
}

.desktop-glass-header .nav-anchor:hover,
.desktop-glass-header .nav-anchor.active {
  color: var(--nav-green-deep);
  background: var(--nav-green-soft);
}

.desktop-glass-header .nav-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
  color: #ffffff;
  background: var(--nav-green-deep);
  text-decoration: none;
  border-radius: var(--nav-radius-pill);
  transition: background var(--nav-trans-fast), transform var(--nav-trans-fast), box-shadow var(--nav-trans-fast);
  border: 1.5px solid transparent;
  box-sizing: border-box;
}

.desktop-glass-header .nav-pill-btn:hover {
  background: var(--nav-green-mid);
  transform: translateY(-1px);
}

.desktop-glass-header .nav-pill-btn.active {
  background: var(--nav-green-deep);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(11, 77, 44, 0.28);
}

/* If system page is active, anchor for hero can be outline */
.desktop-glass-header .nav-pill-btn.outline {
  background: var(--nav-green-soft);
  color: var(--nav-green-deep);
  border-color: var(--nav-green-deep);
}

.desktop-glass-header .nav-pill-btn.outline:hover {
  background: var(--nav-green-deep);
  color: #ffffff;
}

.desktop-glass-header .nav-pill-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
  color: var(--nav-green-deep);
  background: #ffffff;
  text-decoration: none;
  border: 1.5px solid var(--nav-green-deep);
  border-radius: var(--nav-radius-pill);
  box-sizing: border-box;
  transition: all var(--nav-trans-fast);
}

.desktop-glass-header .nav-pill-cta i,
.desktop-glass-header .nav-pill-cta svg {
  width: 17px;
  height: 17px;
  font-size: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #25d366;
  fill: currentColor;
  stroke: none;
  line-height: 1;
}

.desktop-glass-header .nav-pill-cta:hover,
.desktop-glass-header .nav-pill-cta.active {
  background: var(--nav-green-deep);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(11, 77, 44, 0.2);
}

.desktop-glass-header .nav-pill-cta:hover i,
.desktop-glass-header .nav-pill-cta:hover svg {
  color: #ffffff;
}

/* ========================================================
   MOBILE TOP BAR
   (Logo on Left, Notification/Bell on Right)
   ======================================================== */
.mobile-top-bar {
  display: none;
}

/* ========================================================
   MOBILE GLASS BOTTOM NAV
   ======================================================== */
.mobile-glass-bottom-nav {
  display: none;
}

/* ========================================================
   RESPONSIVE BREAKPOINTS (Mobile <= 768px)
   ======================================================== */
@media (max-width: 768px) {
  .desktop-glass-header {
    display: none !important;
  }

  .mobile-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    padding: 0 16px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(11, 77, 44, 0.08);
    z-index: 999;
    direction: ltr; /* Keeps logo on left and notification on right */
  }

  .mobile-top-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    direction: rtl;
  }

  .mobile-header-official-logo {
    height: 42px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 2px 6px rgba(7, 63, 36, 0.08));
  }

  .palm-svg-logo-sm {
    width: 26px;
    height: 26px;
  }

  .mobile-top-titles {
    display: flex;
    flex-direction: column;
    line-height: 1;
  }

  .m-brand-ar {
    font-size: 17px;
    font-weight: 900;
    color: var(--nav-green-deep);
  }

  .m-brand-en {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--nav-green-light);
    margin-top: 1px;
  }

  .mobile-top-notify {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--nav-green-soft);
    color: var(--nav-green-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    text-decoration: none;
    position: relative;
    transition: background var(--nav-trans-fast);
  }

  .mobile-top-notify::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 7px;
    height: 7px;
    background: #e53e3e;
    border-radius: 50%;
    border: 1.5px solid #ffffff;
  }

  .mobile-glass-bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    position: fixed;
    bottom: 18px;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    width: min(340px, calc(100% - 32px));
    height: 58px;
    background: var(--nav-glass-mobile);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--nav-glass-border);
    border-radius: var(--nav-radius-pill);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16);
    z-index: 1000;
    padding: 0 8px;
    direction: ltr; /* Keeps تواصل معنا on left, عن ريآن center, نظام ريآن on right */
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
    color: var(--nav-text-muted);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    transition: all var(--nav-trans-fast);
  }

  .mobile-nav-item .nav-icon-wrap {
    font-size: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 26px;
    border-radius: var(--nav-radius-pill);
    transition: all var(--nav-trans-fast);
  }

  .mobile-nav-item.active {
    color: var(--nav-green-deep);
  }

  .mobile-nav-item.active .nav-icon-wrap {
    color: var(--nav-green-deep);
    background: rgba(11, 77, 44, 0.12);
  }

  /* Bottom clearance helper for pages with floating nav */
  .has-floating-nav {
    padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)) !important;
  }
}
