/* GOD-MODE NAV BAR */
.topnav {
  position: sticky;
  top: 0;
  z-index: 999;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 34px;
  background: linear-gradient(135deg, rgba(255,255,255,0.6), rgba(255,255,255,0.4));
  backdrop-filter: blur(24px) saturate(220%);
  border-bottom: 1px solid rgba(255,255,255,0.45);
  box-shadow: 0 8px 26px rgba(0,0,0,0.18);
  transition: padding 0.3s, background 0.4s, box-shadow 0.4s;
}

/* Scroll shrink */
.topnav.shrink {
  padding: 10px 28px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.25);
}

body.dark .topnav {
  background: linear-gradient(135deg, rgba(13,17,23,0.6), rgba(13,17,23,0.4));
  border-bottom: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 8px 26px rgba(255,255,255,0.08);
}

/* Logo with shimmer */
.nav-logo {
  font-size: 32px;
  font-weight: bold;
  background: linear-gradient(90deg, #0078ff, #00a6ff, #0078ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 4s infinite linear;
}

@keyframes shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

body.dark .nav-logo {
  background: linear-gradient(90deg, #58a6ff, #79b8ff, #58a6ff);
}

/* Search bar */
.nav-search {
  padding: 8px 14px;
  border-radius: 10px;
  border: none;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(12px);
  width: 240px;
  font-size: 14px;
  transition: 0.25s;
}

.nav-search:focus {
  outline: none;
  background: rgba(255,255,255,0.95);
  box-shadow: 0 0 12px rgba(0,120,255,0.4);
}

body.dark .nav-search {
  background: rgba(22,27,34,0.75);
  color: #e6edf3;
}

/* Desktop links */
.nav-links {
  display: flex;
  gap: 24px;
}

.nav-item {
  position: relative;
  text-decoration: none;
  font-weight: bold;
  color: #0078ff;
  padding: 6px 4px;
  transition: 0.25s;
}

body.dark .nav-item {
  color: #58a6ff;
}

/* Magnetic hover */
.nav-item:hover {
  transform: translateY(-3px) scale(1.08);
}

/* Ripple pulse underline */
.nav-item::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 0%;
  height: 3px;
  background: #0078ff;
  border-radius: 2px;
  transition: width 0.25s;
  transform: translateX(-50%);
}

body.dark .nav-item::after {
  background: #58a6ff;
}

.nav-item:hover::after {
  width: 100%;
}

/* Active page */
.nav-item.active {
  color: #005fcc;
}

body.dark .nav-item.active {
  color: #79b8ff;
}

.nav-item.active::after {
  width: 100%;
}

/* MOBILE MENU */
.hamburger {
  display: none;
  font-size: 32px;
  cursor: pointer;
  color: #0078ff;
}

body.dark .hamburger {
  color: #58a6ff;
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  right: -100%;
  width: 75%;
  height: 100%;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(28px);
  box-shadow: -8px 0 26px rgba(0,0,0,0.25);
  padding: 60px 30px;
  transition: right 0.4s ease;
  z-index: 998;
}

body.dark .mobile-menu {
  background: rgba(13,17,23,0.9);
}

.mobile-menu.open {
  right: 0;
}

.mobile-menu a {
  display: block;
  margin: 24px 0;
  font-size: 22px;
  font-weight: bold;
  color: #0078ff;
  text-decoration: none;
}

body.dark .mobile-menu a {
  color: #58a6ff;
}

/* MOBILE RESPONSIVE */
@media (max-width: 900px) {
  .nav-links {
    display: none;
  }
  .nav-search {
    display: none;
  }
  .hamburger {
    display: block;
  }
}
