/* Modern Space-themed Navigation Bar */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 7%;
  position: relative;
  z-index: 100;
}

.logo {
  max-height: 50px;
  width: auto;
}

#nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  transition: all 0.3s ease;
}

#nav-menu li {
  margin: 0 15px;
}

#nav-menu a {
  text-decoration: none;
  color: white;
  font-weight: 500;
  font-size: 16px;
  position: relative;
  padding: 5px 0;
  transition: all 0.3s ease;
}

#nav-menu a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

#nav-menu a:hover::after {
  width: 100%;
}

/* Menu Toggle Button (Hamburger) */
.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1000;
  position: relative;
}

.hamburger {
  width: 30px;
  height: 25px;
  position: relative;
  transform: rotate(0deg);
  transition: 0.5s ease-in-out;
}

.hamburger span {
  display: block;
  position: absolute;
  height: 3px;
  width: 100%;
  background: var(--primary-color);
  border-radius: 3px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: 0.25s ease-in-out;
  box-shadow: 0 0 8px rgba(106, 13, 173, 0.5);
}

.hamburger span:nth-child(1) {
  top: 0px;
}

.hamburger span:nth-child(2) {
  top: 10px;
}

.hamburger span:nth-child(3) {
  top: 20px;
}

/* Animation for hamburger to X */
.menu-toggle.active .hamburger span:nth-child(1) {
  top: 10px;
  transform: rotate(135deg);
}

.menu-toggle.active .hamburger span:nth-child(2) {
  opacity: 0;
  left: -60px;
}

.menu-toggle.active .hamburger span:nth-child(3) {
  top: 10px;
  transform: rotate(-135deg);
}

/* Responsive Styles */
@media (max-width: 991px) {
  .menu-toggle {
    display: block;
  }
  
  #nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 250px;
    height: 100vh;
    background: rgba(10, 3, 20, 0.95);
    /* backdrop-filter: blur(10px); */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 0;
    transition: right 0.4s cubic-bezier(0.77, 0.2, 0.05, 1.0);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.3);
    border-left: 1px solid var(--primary-color-dark);
  }
  
  #nav-menu.active {
    right: 0;
  }
  
  #nav-menu li {
    margin: 15px 0;
  }
  
  #nav-menu a {
    font-size: 18px;
    padding: 10px 20px;
    display: block;
  }
  
  #nav-menu a:hover {
    background: rgba(106, 13, 173, 0.2);
    border-radius: 4px;
  }
  
  /* Prevent scrolling when menu is open */
  body.menu-open {
    overflow: hidden;
  }
}

/* Animation for menu items */
@media (max-width: 991px) {
  #nav-menu.active li {
    animation: fadeInRight 0.5s ease forwards;
    opacity: 0;
  }
  
  #nav-menu.active li:nth-child(1) { animation-delay: 0.1s; }
  #nav-menu.active li:nth-child(2) { animation-delay: 0.2s; }
  #nav-menu.active li:nth-child(3) { animation-delay: 0.3s; }
  #nav-menu.active li:nth-child(4) { animation-delay: 0.4s; }
  #nav-menu.active li:nth-child(5) { animation-delay: 0.5s; }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
