/* Navbar and Side Menu Styling */

/* Mobile menu burger button */
.burger-menu {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 101;
  width: 40px;
  height: 40px;
  background: rgba(10, 10, 20, 0.9);
  border: 1px solid rgba(105, 45, 243, 0.3);
  border-radius: 8px;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.burger-menu:hover {
  background: rgba(105, 45, 243, 0.2);
  border-color: rgba(105, 45, 243, 0.6);
}

.burger-line {
  width: 20px;
  height: 2px;
  background: var(--light-text);
  margin: 2px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.burger-menu.active .burger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.burger-menu.active .burger-line:nth-child(2) {
  opacity: 0;
}

.burger-menu.active .burger-line:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile overlay */
.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-overlay.active {
  opacity: 1;
  visibility: visible;
}

.side-menu {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 70px;
  background-color: rgba(10, 10, 20, 0.8);
  backdrop-filter: blur(10px);
  z-index: 100;
  transition: width 0.4s cubic-bezier(0.5, 0, 0, 1);
  box-shadow: 5px 0 15px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.side-menu:hover {
  width: 240px;
}

.logo-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem 0;
  margin-bottom: 2rem;
}

.logo-container img {
  width: 50px;
  height: auto;
  transition: all 0.3s ease;
}

.side-menu:hover .logo-container img {
  transform: scale(1.1);
}

.menu-items {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding-top: 1rem;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 0.8rem 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0.3rem 0;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.menu-item:before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.menu-item.active:before,
.menu-item:hover:before {
  transform: scaleY(1);
}

.menu-item.active,
.menu-item:hover {
  background: rgba(105, 45, 243, 0.1);
}

.menu-item i {
  font-size: 1.2rem;
  margin-right: 1rem;
  color: var(--secondary-color);
  width: 20px;
  text-align: center;
}

.menu-item span {
  font-family: var(--font-primary);
  font-size: 0.9rem;
  letter-spacing: 1px;
  opacity: 0;
  transform: translateX(10px);
  transition: all 0.3s ease;
}

.side-menu:hover .menu-item span {
  opacity: 1;
  transform: translateX(0);
}

/* Submenu styling */
.submenu {
  position: relative;
  width: 100%;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.4s ease;
  opacity: 0;
}

.submenu.active {
  max-height: 500px; /* Adjust based on content */
  opacity: 1;
}

.submenu-item {
  padding: 0.6rem 1rem 0.6rem 3rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0.2rem 0;
  position: relative;
  white-space: nowrap;
}

.submenu-item:before {
  content: '';
  position: absolute;
  left: 1.5rem;
  top: 50%;
  width: 5px;
  height: 1px;
  background: var(--secondary-color);
}

.submenu-item.active,
.submenu-item:hover {
  color: var(--accent-secondary);
  background: rgba(105, 45, 243, 0.05);
}

/* Menu footer */
.menu-footer {
  margin-top: auto;
  padding: 1rem;
  font-size: 0.8rem;
  color: var(--dim-text);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.side-menu:hover .menu-footer {
  opacity: 1;
}

/* Mobile menu toggle */
.menu-toggle {
  position: absolute;
  top: 20px;
  right: -50px;
  width: 40px;
  height: 40px;
  background-color: var(--primary-color);
  border-radius: 50%;
  display: none;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 101;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.menu-toggle span {
  width: 20px;
  height: 2px;
  background-color: var(--light-text);
  display: block;
  position: relative;
  transition: all 0.3s ease;
}

.menu-toggle span:before,
.menu-toggle span:after {
  content: '';
  position: absolute;
  width: 20px;
  height: 2px;
  background-color: var(--light-text);
  transition: all 0.3s ease;
}

.menu-toggle span:before {
  transform: translateY(-6px);
}

.menu-toggle span:after {
  transform: translateY(6px);
}

.menu-open .menu-toggle span {
  background: transparent;
}

.menu-open .menu-toggle span:before {
  transform: rotate(45deg);
}

.menu-open .menu-toggle span:after {
  transform: rotate(-45deg);
}

/* Responsive adjustments */
@media screen and (max-width: 992px) {
  /* show burger menu on mobile */
  .burger-menu {
    display: flex;
  }
  
  /* hide side menu by default on mobile */
  .side-menu {
    transform: translateX(-100%);
    width: 280px;
    background-color: rgba(5, 5, 8, 0.95);
  }
  
  /* show side menu when active */
  .side-menu.active {
    transform: translateX(0);
  }
  
  /* always show full width on mobile when menu is open */
  .side-menu.active {
    width: 280px;
  }
  
  /* adjust main content padding on mobile */
  main {
    margin-left: 0;
    padding-left: 0;
  }
  
  /* menu items adjustments for mobile */
  .menu-item {
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
  }
  
  .menu-item span {
    opacity: 1;
    transform: translateX(0);
  }
  
  .submenu {
    padding-left: 0;
  }
  
  .submenu-item {
    padding: 0.8rem 2rem;
    font-size: 1rem;
  }
  
  /* logo adjustments */
  .logo-container {
    padding: 2rem 0;
  }
  
  .logo-container img {
    width: 60px;
  }
}

@media screen and (max-width: 768px) {
  .burger-menu {
    top: 15px;
    left: 15px;
    width: 35px;
    height: 35px;
  }
  
  .burger-line {
    width: 18px;
  }
  
  .side-menu {
    width: 260px;
  }
  
  .side-menu.active {
    width: 260px;
  }
}

/* Content adjustment for desktop */
main {
  margin-left: 70px;
  transition: margin-left 0.4s cubic-bezier(0.5, 0, 0, 1);
}

@media screen and (max-width: 992px) {
  main {
    margin-left: 0;
  }
}
