.navbar {
  display: flex;
  overflow-y: visible;
  white-space: nowrap;
  background-color: #333;
  padding: 10px;
  position: relative; /* Important */
  z-index: 1000; /* Makes sure it's above page content */
}

.navbar::-webkit-scrollbar {
  display: none;
}

.nav-item {
  position: relative;
  padding: 10px 20px;
  color: white;
  cursor: pointer;
  user-select: none;
  flex: 0 0 auto;
  white-space: nowrap;
  z-index: 1000;
}

.nav-item:hover,
.nav-item.active {
  background-color: #444;
}

.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: white;
  min-width: 160px;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.15);
  z-index: 9999; /* Key: shows above everything */
}

.dropdown a {
  display: block;
  padding: 10px;
  text-decoration: none;
  color: #333;
  z-index: 9999; /* Key: shows above everything */
}

.dropdown a:hover {
  background-color: #f2f2f2;
}

/* Show on hover or JS toggle */
.nav-item:hover .dropdown,
.nav-item.show .dropdown {
  display: block;
}
