/* ============================================
   NAVBAR STYLES
   ============================================ */

/* Navigation Container */
nav {
  width: 100%;
  position: relative;
  z-index: 1000;
}

nav ul {
  display: flex;
  justify-content: right;
  padding: 30px;
  margin: 0;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1001;
}

nav ul li {
  display: flex;
  align-items: center;
  margin-right: 30px;
  margin-left: 20px;
}

nav ul li a {
  display: flex;
  text-decoration: none;
  font-size: 20px;
  font-family: 'roboto';
  font-weight: 700;
  color: #212529;
  flex-direction: flex-start;
  position: relative;
}

/* Nav Link Underline Animation */
nav ul li a::after {
  content: '';
  position: absolute;
  width: 100%;
  transform: scaleX(0);
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: blue;
  transform-origin: bottom right;
  transition: transform 0.25s ease-out;
}

nav ul li a:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

/* Nav Brand/Name */
a.navcolinpouw {
  color: blue;
  font-size: 25px;
  display: flex;
  flex-direction: flex-start;
}

/* ============================================
   HAMBURGER MENU
   ============================================ */

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  cursor: pointer;
  z-index: 2001;
  position: absolute;
  top: 18px;
  right: 30px;
}

.hamburger span {
  display: block;
  width: 28px;
  height: 4px;
  margin: 4px 0;
  background: #1a1aff;
  border-radius: 2px;
  transition: all 0.4s cubic-bezier(.68, -0.55, .27, 1.55);
}

/* Hamburger Active State */
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* ============================================
   NAVBAR ANIMATIONS (CSS Fallback)
   ============================================ */

/* Nav slide-in animation (fallback if GSAP not available) */
#nav-list li {
  opacity: 0;
  transform: translateY(-30px);
  transition: opacity 0.7s cubic-bezier(.68, -0.55, .27, 1.55), transform 0.7s cubic-bezier(.68, -0.55, .27, 1.55);
}

/* Only use CSS animations if GSAP is not available */
body.loaded:not(.gsap-loaded) #nav-list li {
  opacity: 1;
  transform: translateY(0);
}

body.loaded:not(.gsap-loaded) #nav-list li:nth-child(1) { transition-delay: 0.2s; }
body.loaded:not(.gsap-loaded) #nav-list li:nth-child(2) { transition-delay: 0.3s; }
body.loaded:not(.gsap-loaded) #nav-list li:nth-child(3) { transition-delay: 0.4s; }
body.loaded:not(.gsap-loaded) #nav-list li:nth-child(4) { transition-delay: 0.5s; }
body.loaded:not(.gsap-loaded) #nav-list li:nth-child(5) { transition-delay: 0.6s; }

/* ============================================
   MOBILE NAVIGATION
   ============================================ */

@media (max-width: 900px) {
  nav {
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2000;
    background: #fff;
  }

  nav ul {
    flex-direction: column;
    position: fixed;
    top: 0;
    right: -100vw;
    width: 70vw;
    height: 100vh;
    background: #fff;
    box-shadow: -2px 0 16px rgba(0, 0, 0, 0.08);
    padding: 80px 0 0 0;
    align-items: flex-start;
    transition: right 0.3s cubic-bezier(0.77, 0.2, 0.05, 1.0);
    z-index: 2001;
    overflow-y: auto;
  }

  nav ul.open {
    right: 0;
  }

  .hamburger {
    display: flex;
    top: 20px;
    right: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 6px 8px;
    z-index: 2002;
  }

  nav ul li {
    margin: 20px 0 0 30px;
    width: 100%;
  }

  nav ul li a {
    right: 0;
    font-size: 22px;
  }

  a.navcolinpouw {
    right: 0;
    font-size: 25px;
    margin-bottom: 30px;
  }
}

/* ============================================
   DARK MODE NAVBAR STYLES
   ============================================ */

[data-theme="dark"] nav {
  background-color: var(--nav-background);
}

[data-theme="dark"] nav ul {
  background-color: var(--nav-background);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] nav ul li a {
  color: var(--text-color);
}

[data-theme="dark"] .hamburger {
  background: var(--nav-background);
}

