/* hamburger options*/
.off-screen-menu {
  background: url("https://static.igem.wiki/teams/5149/menu/spill-new-6.png") no-repeat top left;
  background-size: min(750px, 75vw) auto; 
  background-position: min(13px, 1.3vw) min(17px, 1.7vh);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* Change from center to flex-start */
  align-items: flex-start; /* Change from center to flex-start */
  font-size: 1rem;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  box-sizing: border-box;
  z-index: 1000;
  padding: 40px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
}

.off-screen-menu.active {
  opacity: 1;
  visibility: visible;
}

.menu-categories {
  display: grid;
  grid-template-columns: repeat(3, minmax(200px, 1fr));
  grid-template-rows: auto auto;
  transform: translateX(140px) translateY(-5px);
  gap: 60px 40px;
  list-style-type: none;
  padding: 5;
  margin: 5;
  width: 100%;
  justify-content: start; /* Add this line */
}


.menu-category {
  margin-bottom: 20px;
  width: 100%;
  text-align: center;
}

.menu-category h3 {
  font-size: 1.2rem;
  margin-bottom: 5px;
  color: #333;
  margin: 0 0 15px 0; /* Adjust margin as needed */
}

.menu-category ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
  list-style-type: none;
}

.menu-category li {
  margin-bottom: 5px;
}

.menu-category a {
  text-decoration: none;
  color: #666;
  transition: color 0.2s ease;
}

.menu-category a:hover {
  color: #000;
}


/* hamburger icon*/
.hamburger-icon,
.lift-logo {
  width: 100%;
  height: auto;
  object-fit: contain;
  position: absolute;
  top: 0%; /* Adjust these values as needed */
  left: -5%;
  transition: opacity 0.3s ease;
}

.ham-menu {
  position: fixed;
  top: 0px;
  left: 0px;
  cursor: pointer;
  z-index: 1002;
  width: 225px; /* Adjust as needed */
  height: auto;
}

.lift-logo {
  opacity: 0;
}

.ham-menu:hover .hamburger-icon {
  opacity: 0;
}

.ham-menu:hover .lift-logo {
  opacity: 1;
}

.off-screen-menu.active {
  left: 0;
}

.off-screen-menu > ul {
  display: grid;
  grid-template-columns: auto auto auto;
  grid-template-rows: repeat(2, auto);
  gap: 13px;
  list-style-type: none;
  padding: 0;
  margin: 0;
  width: 35%;
}

.off-screen-menu > ul > li {
  display: flex;
  flex-direction: column;
}

/* child special features */
.menu-category:nth-child(-n+2) {
  justify-content: flex-end; /* Aligns content to the bottom */
}

/* Style for bottom row items (last 3) */
.menu-category:nth-child(n+3) {
  grid-column: span 1;
  justify-content: flex-start; /* Aligns content to the top */
}

.off-screen-menu.active > ul > li:nth-child(1) { transition-delay: 0.1s; }
.off-screen-menu.active > ul > li:nth-child(2) { transition-delay: 0.15s; }
.off-screen-menu.active > ul > li:nth-child(3) { transition-delay: 0.2s; }
.off-screen-menu.active > ul > li:nth-child(4) { transition-delay: 0.25s; }
.off-screen-menu.active > ul > li:nth-child(5) { transition-delay: 0.3s; }
.off-screen-menu.active > ul > li:nth-child(6) { transition-delay: 0.35s; }
.off-screen-menu.active > ul > li:nth-child(7) { transition-delay: 0.4s; }
.off-screen-menu.active > ul > li:nth-child(8) { transition-delay: 0.45s; }
.off-screen-menu.active > ul > li:nth-child(9) { transition-delay: 0.5s; }
.off-screen-menu.active > ul > li:nth-child(10) { transition-delay: 0.55s; }
.off-screen-menu.active > ul > li:nth-child(11) { transition-delay: 0.6s; }
.off-screen-menu.active > ul > li:nth-child(12) { transition-delay: 0.65s; }
.off-screen-menu.active > ul > li:nth-child(13) { transition-delay: 0.70s; }
.off-screen-menu.active > ul > li:nth-child(14) { transition-delay: 0.75s; }
.off-screen-menu.active > ul > li:nth-child(15) { transition-delay: 0.80s; }
.off-screen-menu.active > ul > li:nth-child(16) { transition-delay: 0.85s; }
.off-screen-menu.active > ul > li:nth-child(17) { transition-delay: 0.90s; }
.off-screen-menu.active > ul > li:nth-child(18) { transition-delay: 0.95s; }
.off-screen-menu.active > ul > li:nth-child(19) { transition-delay: 1.00s; }
.off-screen-menu.active > ul > li:nth-child(20) { transition-delay: 1.05s; }
.off-screen-menu.active > ul > li:nth-child(21) { transition-delay: 1.10s; }
.off-screen-menu.active > ul > li:nth-child(22) { transition-delay: 1.15s; }
/* Add more if you have more items */

.off-screen-menu:not(.active) > ul > li {
  opacity: 0;
  transform: translateY(20px);
  transition: none;
}

/* handle different screen size */
@media screen and (max-width: 1060px) {
  .off-screen-menu {
    background: #f0f0f0;
    background-image: none;
    justify-content: center; /* Center vertically on smaller screens */
    align-items: center; /* Center horizontally on smaller screens */
  }

  .menu-categories {
    grid-template-columns: 1fr;
    transform: none;
    width: 100%;
    justify-content: center; /* Center grid items on smaller screens */
  }

  .menu-category {
    margin-bottom: 15px;
    text-align: center; /* Center text within each category */
  }


  /* close button styles */
  .close-menu {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 30px;
    height: 30px;
    cursor: pointer;
  }

  .close-menu::before,
  .close-menu::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: #333;
    top: 50%;
    left: 0;
  }

  .close-menu::before {
    transform: rotate(45deg);
  }

  .close-menu::after {
    transform: rotate(-45deg);
  }
}