/* ═══════════════════════════════════════════
   Modern Navigation — Glass Header + Dropdowns
   ═══════════════════════════════════════════ */

/* Glass header */
.portal-header {
  position: sticky;
  top: 0;
  z-index: 99999;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(15, 23, 42, 0.78);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 8px 32px rgba(0,0,0,0.28);
}
.portal-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
}
.portal-header__left {
  display: flex;
  align-items: center;
  gap: 24px;
}
.portal-header__center {
  display: flex;
  align-items: center;
}
.portal-header__right {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Brand */
.portal-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  letter-spacing: -0.3px;
}
.portal-brand__accent {
  color: var(--p-blue, #3b82f6);
}

/* Nav links */
.portal-header__nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: -10px;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--p-text-muted, #94a3b8);
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  font-family: inherit;
}
.nav-link:hover, .nav-link.active {
  color: #fff;
  background: rgba(255,255,255,0.07);
}
.nav-link.active {
  color: #fff;
}

/* Dropdowns */
.nav-dropdown {
  position: relative;
  z-index: 99999;
}
.nav-dropdown__menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 200px;
  background: #0f172a;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
  padding: 6px;
  z-index: 9999999;
  animation: navDropIn 0.15s ease;
}
@keyframes navDropIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-4px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.nav-dropdown.open > .nav-dropdown__menu {
  display: block;
}
.nav-dropdown__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--p-text, #cbd5e1);
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.12s, color 0.12s;
}
.nav-dropdown__item:hover {
  background: rgba(59, 130, 246, 0.1);
  color: #fff;
}
.nav-dropdown__divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 4px 0;
}

/* Mega menu */
.nav-dropdown__menu--mega {
  min-width: 580px;
  left: auto;
  right: 0;
  transform: none;
  padding: 12px;
}
@keyframes navDropIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.nav-mega__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 4px;
}
.nav-mega__col {
  padding: 4px;
}
.nav-mega__title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--p-text-muted, #64748b);
  padding: 4px 12px 6px;
}

/* Admin sub-nav */
.portal-admin-nav {
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.portal-admin-nav .portal-header__inner {
  height: 42px;
  justify-content: center;
}

/* Icon buttons (notifications, theme, etc.) */
.nav-icon-btn {
  background: transparent;
  border: 0;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--p-text-muted, #94a3b8);
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.nav-icon-btn:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
}
.nav-icon-btn__badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--p-red, #ef4444);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 50px;
  min-width: 14px;
  text-align: center;
}

/* User avatar */
.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--p-blue, #3b82f6), var(--p-purple, #8b5cf6));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s;
}
.nav-avatar:hover {
  transform: scale(1.05);
}

/* Hide old sidebar */
.admin-sidebar { display: none !important; }
.admin-sidebar__toggle { display: none !important; }
.portal-main--with-sidebar {
  margin-left: 0 !important;
  padding: 24px !important;
  max-width: 1440px;
  margin-left: auto !important;
  margin-right: auto !important;
}
/* Ensure portal-nav stays above content */
.portal-nav {
  position: relative;
  z-index: 99999;
}

/* Responsive */
@media (max-width: 1024px) {
  .nav-link span { display: none; }
  .nav-mega__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .portal-header__center { display: none; }
  .portal-header__nav { display: none; }
  .nav-mega__grid { grid-template-columns: 1fr; min-width: 240px; }
}
