:root {
  --navlink-height: 80px;
  --drawer-size: 50vw;
}

/* Styling so header/navbar is always on screen and blurs everything behind it */
header {
  position: sticky;
  top: 0;
  z-index: 5;
}

.header-blur {
  position: fixed;
  top: 0;
  left: 0;
  height: 60px;
  width: 100vw;
  background: transparent;
  z-index: 1;
  backdrop-filter: blur(4px);
}

/* Navigation bar styling */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
}

nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Left navbar items */
.left-nav {
  display: flex;
  align-items: center;
  gap: 0.05px;
  position: relative;
  z-index: 1;
}

.navbar .left-nav a {
  display: flex;
  align-items: center;
  padding: 1rem;
}

.navbar button {
  background: transparent;
}

.navbar .logo {
  color: var(--primary);
  width: 25px;
  height: 25px;
}

.icon {
  color: var(--primary);
  width: 20px;
  height: 20px;
}

button:hover .icon,
a:hover .logo,
a:hover .icon {
  color: var(--highlight);
}

body #dark-icon {
  display: flex;
}

body #light-icon {
  display: none;
}

body.dark-mode #light-icon {
  display: flex;
}

body.dark-mode #dark-icon {
  display: none;
}

/* Right navbar items */
.right-nav {
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1;
}

.right-nav li {
  padding: 0.25rem;
}

.right-nav li a {
  display: block;
  padding: 1rem;
  text-decoration: none;
  color: var(--primary);
}

.right-nav li a:hover {
  color: var(--highlight);
}

/* Menu toggle (for mobile users) */
.menu-toggle {
  display: none;
  background: transparent;
  cursor: pointer;
  border: none;
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
}

.right-drawer {
  display: none;
}

.blur {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* Right navbar specifically for mobile users */
@media (min-width: 320px) and (max-width: 767px) {
  .right-nav {
    position: relative;
    z-index: 4;
  }

  .menu-toggle {
    display: inline-flex;
    color: var(--primary);
  }

  .menu-toggle:hover {
    color: var(--highlight);
  }

  .right-nav .right-nav-links {
    position: fixed;
    top: 80px;
    right: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    width: 50vw;
    align-items: center;
    opacity: 0;
    transform: translateX(100%);
    transition:
      transform 0.4s ease-in-out,
      opacity 0.4s ease-in-out;
    pointer-events: none;
    z-index: 4;
  }

  .right-drawer {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    width: var(--drawer-size);
    height: 100vh;
    z-index: 3;
    background-color: var(--drawer-color);
    transform: translateX(100%);
    transition: transform 0.4s ease-in-out;
  }

  /* Styling for opening the menu */
  body.menu-open {
    overflow: hidden;
  }

  body.menu-open .header-blur {
    display: none;
  }

  body.menu-open .right-nav-links {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  body.menu-open .right-drawer {
    transform: translateX(0);
  }

  body.menu-open .blur {
    display: block;
    pointer-events: auto;
    backdrop-filter: blur(4px);
  }
}
