* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

.navbar {
  background-color: #565396;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  color: white;
  font-size: 24px;
  font-weight: bold;
}

.nav-links {
  list-style: none;
  display: flex;
}

.nav-links li {
  margin-left: 20px;
  position: relative; /* For positioning sub-menu */
}

/* Top-level links */
.nav-links > li > a {
  color: white;
  text-decoration: none; /* No underline for top-level links */
  border: none;
  font-size: 18px;
  transition: all 0.3s ease; /* Easing for hover effects */
}

.nav-links > li > a:hover {
  color: #ff9900; /* Change color on hover */
  transform: translateY(-2px); /* Slight lift effect */
  text-decoration: none; /* Ensure no underline on hover */
}

/* Dropdown Styles */
.dropdown {
  position: relative;
}

.sub-menu {
  display: block; /* For max-height transition */
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #565396;
  list-style: none;
  min-width: 200px; /* Width for longer sub-menu items */
  padding: 0; /* No padding when closed */
  max-height: 0; /* Start collapsed */
  overflow: hidden; /* Hide content when collapsed */
  opacity: 0; /* Start invisible */
  transform: translateY(10px); /* Start slightly below */
  transition: max-height 0.4s ease, opacity 0.4s ease, transform 0.4s ease; /* Easing for dropdown */
  z-index: 1;
}

.dropdown:hover .sub-menu {
  max-height: 300px; /* Fit three sub-links */
  opacity: 1;
  transform: translateY(0); /* Slide into place */
  padding: 10px 0; /* Restore padding when open */
}

.sub-menu li {
  margin: 0;
  border: none; /* Ensure no borders between sub-menu items */
}

.sub-menu a {
  display: block;
  padding: 10px 20px;
  font-size: 16px;
  color: white;
  text-decoration: none; /* No underline for sub-menu links */
  background-color: transparent; /* Ensure no background artifacts */
  border: none; /* No borders */
  transition: all 0.3s ease;
}

.sub-menu a:hover {
  background-color: #565396;
  color: #ff9900;
  transform: translateY(0); /* Override parent hover lift */
  text-decoration: none; /* No underline on hover */
}

/* Hamburger Styles */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.hamburger span {
  background: white;
  height: 3px;
  width: 25px;
  margin: 4px 0;
  transition: all 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    position: absolute;
    top: 60px;
    left: 0;
    background-color: #565396;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links li {
    margin: 10px 0;
    text-align: center;
  }

  .nav-links a {
    display: block;
    padding: 10px;
  }

  /* Mobile Dropdown */
  .sub-menu {
    position: static;
    background-color: #444;
    max-height: 0; /* Start collapsed */
    opacity: 0;
    transform: translateY(0); /* No transform in mobile */
    transition: max-height 0.4s ease, opacity 0.4s ease; /* Easing for mobile */
  }

  .dropdown.active .sub-menu {
    max-height: 300px; /* Fit three sub-links */
    opacity: 1;
    padding: 10px 0; /* Restore padding when open */
  }
}