/**
 * Mega Menu Grid Styles
 * The District Nurses CMS
 */

/* Global Mega Menu */
.global-mega-menu {
  position: fixed;
  top: 110px; /* Adjust based on header height */
  left: 0;
  right: 0;
  width: 100vw;
  background-color: #003b91;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  border-top: 3px solid #021841;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  transform: translateY(-10px);
}

/* Mobile menu close button */
.mobile-menu-close {
  display: none;
  text-align: right;
  padding: 10px 15px 0;
}

.close-mega-menu {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.close-mega-menu:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.global-mega-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Adjust for sticky header */
.header-scrolled + .global-mega-menu,
.header-sticky + .global-mega-menu {
  top: 80px; /* Adjust based on scrolled header height */
}

/* Highlight active nav item */
.nav-trigger:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Ensure proper z-index stacking */
.primary-navigation {
  position: relative;
  z-index: 1000;
}

/* Mega Menu Grid Layout */
.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px;
}

/* Mega Menu Column */
.mega-menu-column {
  display: flex;
  flex-direction: column;
  padding: 10px 20px;
  transition: all 0.3s ease;
  border-radius: 8px;
}

/* Highlighted column */
.mega-menu-column.highlight {
  background-color: #002d70; /* Darker blue background */
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

/* Mega Menu Title */
.mega-menu-title {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 15px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.mega-menu-title a {
  color: #ffffff;
  text-decoration: none;
  transition: color 0.2s ease;
}

.mega-menu-title a:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* Mega Menu Items */
.mega-menu-items {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mega-menu-item {
  margin-bottom: 10px;
}

.mega-menu-item:last-child {
  margin-bottom: 0;
}

.mega-menu-item a {
  color: #ffffff;
  text-decoration: none;
  font-size: 15px;
  display: block;
  padding: 5px 0;
  transition: all 0.2s ease;
  opacity: 0.9;
}

.mega-menu-item a:hover {
  opacity: 1;
  transform: translateX(5px);
  text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .mega-menu-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 20px;
  }
  
  .global-mega-menu {
    top: 80px; /* Adjust for smaller header on tablets */
  }
}

/* Completely disable mega menu on mobile devices */
@media (max-width: 1024px) {
  /* Hide the mega menu completely on mobile */
  .global-mega-menu {
    display: none !important;
  }
  
  /* Disable hover effects on nav items */
  .nav-trigger:hover {
    background-color: transparent !important;
  }
  
  /* Make sure links work normally */
  .nav-trigger > a {
    pointer-events: auto;
  }
  
  /* Ensure mobile menu button works */
  .menu-mobile-nav-button {
    cursor: pointer !important;
    pointer-events: auto !important;
  }
  
  /* Don't interfere with mobile menu */
  html.mobile-nav-active {
    overflow: hidden !important;
  }
}