/* Mega Menu Styles for OpsHunt website */

/* Mega Menu Wrapper */
.mega-menu-wrapper {
  position: relative;
  display: inline-block;
}

/* Mega Menu Trigger */
.mega-menu-trigger {
  position: relative;
  cursor: pointer;
  display: inline-block;
  padding: 0.5rem 0;
  transition: color 0.3s ease;
}

.mega-menu-trigger::after {
  content: '';
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  margin-left: 0.5rem;
  transform: rotate(45deg);
  transition: transform 0.3s ease;
  vertical-align: middle;
  position: relative;
  top: -2px;
}

.mega-menu-wrapper:hover .mega-menu-trigger::after {
  transform: rotate(-135deg);
}

/* Mega Menu Content */
.mega-menu-content {
  position: absolute;
  top: calc(100% + 0.75rem);
  left: 50%;
  transform: translateX(-50%);
  min-width: 500px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  transform-origin: top center;
  z-index: 50;
}

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

/* Mega Menu Item */
.mega-menu-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  border-radius: 0.5rem;
  transition: background-color 0.3s ease;
}

.mega-menu-item:hover {
  background-color: rgba(79, 70, 229, 0.05);
}

.mega-menu-item i {
  margin-right: 1.25rem;
  min-width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1.25rem;
  background-color: rgba(79, 70, 229, 0.1);
  border-radius: 0.75rem;
  color: #4f46e5;
  transition: all 0.3s ease;
}

.mega-menu-item h3 {
  margin-bottom: 0.25rem;
  transition: color 0.3s ease;
}

.mega-menu-item:hover h3 {
  color: #4f46e5; /* indigo-600 */
}

.mega-menu-item:hover i {
  background-color: #4f46e5;
  color: #ffffff;
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

/* Mobile Menu */
#mobile-menu {
  transition: max-height 0.3s ease;
  overflow: hidden;
}

.mobile-submenu-trigger {
  transition: color 0.3s ease;
}

.mobile-submenu {
  transition: max-height 0.3s ease, opacity 0.3s ease;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

.mobile-submenu.active {
  max-height: 500px;
  opacity: 1;
}

.mobile-submenu-trigger[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .mega-menu-content {
    min-width: 100%;
    width: 100vw;
    left: 0;
    transform: translateX(0);
  }
  
  .mega-menu-wrapper:hover .mega-menu-content {
    transform: translateX(0) translateY(0);
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .mega-menu-content {
    min-width: 450px;
  }
}

/* Arrow indicator */
.mega-menu-content::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 16px;
  height: 16px;
  background-color: white;
  border-left: 1px solid rgba(229, 231, 235, 1); /* gray-200 */
  border-top: 1px solid rgba(229, 231, 235, 1); /* gray-200 */
  z-index: -1;
}
