/* ============================================
   PREMIUM NEXUS HEADER & NAV
   Features: Glassmorphism, Mega Menu, Smooth Transitions
   ============================================ */

.header-nexus {
  padding: 25px 0;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  background: transparent;
  z-index: 1000;
}

/* Scrolled State (Transparent to Solid/Glass) */
.header-nexus.header-scrolled {
  padding: 15px 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(15px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.header-wrapper {
  position: relative;
}

/* --- Logo Styling --- */
.header-logo {
  text-decoration: none;
}

.logo-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-img {
  height: 42px;
  width: auto;
}

.logo-text {
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  /* White by default on Hero */
  letter-spacing: -0.5px;
  transition: color 0.3s;
}

.logo-text span {
  color: var(--sn-primary);
}

.header-scrolled .logo-text {
  color: #111827;
  /* Dark on scroll */
}

/* --- Desktop Nav List --- */
.nav-menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 35px;
}

.nav-menu-list a {
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  /* Light on Hero */
  transition: all 0.3s;
  position: relative;
  padding: 10px 0;
}

.nav-menu-list a:hover,
.nav-menu-list a.active {
  color: #ffffff;
}

.header-scrolled .nav-menu-list a {
  color: #4b5563;
}

.header-scrolled .nav-menu-list a:hover,
.header-scrolled .nav-menu-list a.active {
  color: var(--sn-primary);
}

/* Active Indicator */
.nav-menu-list a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--sn-primary);
  transition: width 0.3s;
}

.nav-menu-list a:hover::after,
.nav-menu-list a.active::after {
  width: 100%;
}

/* --- Mega Menu Logic --- */
.has-mega-menu {
  position: relative;
}

.mega-menu-panel {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  width: 850px;
  background: #ffffff;
  border-radius: 16px;
  padding: 35px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  margin-top: 15px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.has-mega-menu:hover .mega-menu-panel {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.mega-item {
  display: flex;
  gap: 15px;
  padding: 15px;
  border-radius: 12px;
  text-decoration: none !important;
  transition: background 0.3s;
}

.mega-item:hover {
  background: #f8fafc;
}

.mega-icon {
  width: 45px;
  height: 45px;
  background: #f0f7ff;
  color: var(--sn-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.mega-info h6 {
  margin: 0 0 4px;
  font-weight: 700;
  color: #111827;
  font-size: 0.95rem;
}

.mega-info p {
  margin: 0;
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.4;
}

.mega-item--all .mega-icon {
  background: var(--sn-primary);
  color: #ffffff;
}

/* --- Actions Area --- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.action-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.2rem;
  text-decoration: none;
  transition: all 0.3s;
}

.header-scrolled .action-icon {
  color: #4b5563;
}

.action-icon:hover {
  color: var(--sn-primary);
  transform: translateY(-2px);
}

.btn-header-audit {
  padding: 10px 24px;
  background: var(--sn-primary);
  color: #ffffff !important;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.3s;
  box-shadow: 0 5px 15px rgba(26, 115, 232, 0.2);
}

.btn-header-audit:hover {
  background: #0d47a1;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(26, 115, 232, 0.3);
}

/* --- Mobile Toggle Button --- */
.mobile-nav-toggle {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  cursor: pointer;
}

.toggle-line {
  display: block;
  width: 28px;
  height: 2px;
  background: #ffffff;
  transition: all 0.3s;
}

.toggle-line.short {
  width: 18px;
  align-self: flex-end;
}

.header-scrolled .toggle-line {
  background: #111827;
}

/* --- Mobile Navigation Drawer (Optional Implementation) --- */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: #ffffff;
  z-index: 1001;
  padding: 30px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s;
  display: flex;
  flex-direction: column;
}

.mobile-nav-active .mobile-overlay {
  opacity: 1;
  visibility: visible;
}

.mobile-menu-links {
  list-style: none;
  padding: 0;
  margin: 40px 0;
}

.mobile-menu-links li {
  margin-bottom: 25px;
}

.mobile-menu-links a {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  text-decoration: none;
}

/* Responsive */
@media (max-width: 991px) {
  .header-nexus {
    padding: 15px 0;
  }
}

@media (max-width: 1200px) {
  .mega-menu-panel {
    width: 100vw;
    max-width: 900px;
  }
}