header.site-header {
  width: 100%;
  background: linear-gradient(135deg, rgba(4, 6, 18, 0.92) 0%, rgba(9, 18, 36, 0.9) 48%, rgba(18, 32, 52, 0.88) 100%) !important;
  background-color: rgba(4, 6, 18, 0.92);
  padding: 15px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  backdrop-filter: blur(8px);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
  box-sizing: border-box;
}
.scroll-progress {
  position: absolute;
  left: 0;
  bottom: -2px;
  height: 4px;
  width: 0%;
  background: linear-gradient(90deg, #00526e 0%, #2b3587 40%, #4e208a 70%, #1f7f64 100%);
  box-shadow: 0 0 10px rgba(31, 127, 100, 0.45);
  border-radius: 999px;
  pointer-events: none;
  transition: width 0.08s ease-out;
}

  
header h1 {
  font-size: 22px;
  color: #fff;
}

nav a {
  color: #ccc;
  margin: 0 15px;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s, background 0.3s;
  padding: 6px 12px;
  border-radius: 6px;
}

nav a:link,
nav a:visited {
  color: #ccc;
}

nav a:hover {
  color: #9ad1ff;
}

nav a:link:hover,
nav a:visited:hover {
  color: #9ad1ff;
}

nav a.current-page {
  background: linear-gradient(135deg, #2563eb, #60a5fa, #a78bfa);
  color: #0a0a0a;
  font-weight: 700;
}

nav a.current-page:hover {
  color: #0a0a0a;
  background: linear-gradient(135deg, #3b82f6, #7c9eff, #b794f6);
}

/* Dropdown Menu Styling */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropbtn {
  background: none !important;
  border: none !important;
  color: #ccc !important;
  font-family: inherit;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  padding: 10px 15px;
  margin: 0 15px;
  transition: color 0.3s, background 0.3s;
  border-radius: 6px;
}

.dropbtn:hover {
  color: #9ad1ff;
}

.dropbtn.current-page {
  background: linear-gradient(135deg, #2563eb, #60a5fa, #a78bfa) !important;
  color: #0a0a0a !important;
  font-weight: 700;
}

.dropbtn.current-page:hover {
  color: #0a0a0a !important;
  background: linear-gradient(135deg, #3b82f6, #7c9eff, #b794f6) !important;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: rgba(20, 20, 40, 0.95);
  min-width: 180px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.4);
  border-radius: 8px;
  z-index: 10001;
  top: 100%;
  left: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.dropdown-content a {
  color: white;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  transition: background 0.3s, color 0.3s;
}

.dropdown-content a:link,
.dropdown-content a:visited {
  color: white;
}

.dropdown-content a:hover {
  background-color: rgba(255,255,255,0.1);
  color: #9ad1ff;
}

.dropdown-content a:link:hover,
.dropdown-content a:visited:hover {
  background-color: rgba(255,255,255,0.1);
  color: #9ad1ff;
}

.dropdown:hover .dropdown-content {
  display: block;
}

@media (max-width: 768px) {
  header.site-header {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 12px 20px;
    gap: 12px;
    position: fixed; /* Ensure fixed on mobile */
    width: 100%;
    left: 0;
    right: 0;
  }

  header.site-header h1 {
    font-size: 20px;
    margin-bottom: 0;
  }

  header.site-header nav {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
    position: relative;
  }

  nav a {
    margin: 0;
    padding: 8px 12px;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .dropbtn {
    margin: 0;
    padding: 8px 12px;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  /* Position dropdowns to prevent overflow on mobile */
  .dropdown {
    position: relative;
  }
  
  .dropdown-content {
    position: absolute;
    left: auto;
    right: 0;
    max-width: calc(100vw - 40px);
    /* On very narrow screens, prioritize max-width over min-width to prevent overflow */
    min-width: min(180px, calc(100vw - 40px));
  }
  
  /* For the last dropdown (Gallery), ensure it doesn't overflow off right edge */
  nav .dropdown:last-child .dropdown-content {
    /* Position dropdown extending left from button's right edge */
    right: 0;
    left: auto;
    /* Constrain width to prevent overflow - use smaller max-width for safety */
    max-width: min(180px, calc(100vw - 60px));
    /* Ensure min-width doesn't exceed max-width on narrow screens */
    min-width: min(150px, calc(100vw - 60px));
    /* Shift slightly left to ensure it stays within viewport */
    transform: translateX(0);
  }
  
  /* If the dropdown would still overflow, we can detect and adjust */
  /* For very small screens, make dropdown even narrower */
  @media (max-width: 400px) {
    nav .dropdown:last-child .dropdown-content {
      max-width: min(160px, calc(100vw - 40px));
      /* Ensure min-width doesn't exceed max-width on very narrow screens */
      min-width: min(140px, calc(100vw - 40px));
    }
  }
}

@media (max-width: 480px) {
  header.site-header {
    padding: 10px 15px;
    gap: 10px;
    position: fixed; /* Ensure fixed on small mobile */
    width: 100%;
    left: 0;
    right: 0;
  }

  header.site-header h1 {
    font-size: 18px;
  }

  header.site-header nav {
    gap: 6px;
    justify-content: center;
  }

  nav a {
    padding: 6px 10px;
    font-size: 0.85rem;
  }

  .dropbtn {
    padding: 6px 10px;
    font-size: 0.85rem;
  }
  
  /* Adjust dropdown positioning on very small screens */
  .dropdown-content {
    max-width: calc(100vw - 30px);
    /* Ensure min-width doesn't exceed max-width on narrow screens */
    min-width: min(150px, calc(100vw - 30px));
  }
  
  /* Gallery dropdown - ensure it fits on very small screens */
  nav .dropdown:last-child .dropdown-content {
    right: 0;
    left: auto;
    max-width: min(160px, calc(100vw - 40px));
    /* Ensure min-width doesn't exceed max-width on narrow screens */
    min-width: min(140px, calc(100vw - 40px));
  }
}

