/* Define theme variables based on page theme */
:root {
  --navbar-bg: #fff;
  --navbar-border: #f26b1d;
  --nav-link-color: #333;
  --nav-link-hover-bg: #f26b1d;
  --nav-link-hover-color: #fff;
  --nav-menu-bg: #fff;
}

/* Apply dark theme based on page background */
body[style*="background: #0e0e0e"],
body.dark-theme {
  --navbar-bg: #111;
  --navbar-border: #ff944d;
  --nav-link-color: #eee;
  --nav-link-hover-bg: #ff944d;
  --nav-link-hover-color: #000;
  --nav-menu-bg: #111;
}

/* Navbar base styles */
.navbar {
  background-color: var(--navbar-bg);
  padding: 10px 20px;
  border-bottom: 2px solid var(--navbar-border);
  position: sticky;
  top: 0;
  z-index: 999;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1000px;
  margin: auto;
}

.logo img {
  height: 40px;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 20px;
  align-items: center;
  margin: 0;
  padding: 0;
}

.nav-menu li a {
  text-decoration: none;
  color: var(--nav-link-color);
  font-weight: 500;
  font-size: 16px;
  padding: 6px 8px;
  border-radius: 5px;
  transition: color 0.3s, background-color 0.3s;
}

.nav-menu li a:hover,
.nav-menu li a.active {
  background-color: var(--nav-link-hover-bg);
  color: var(--nav-link-hover-color);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 26px;
  cursor: pointer;
}

/* Mobile Nav */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav-menu {
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    background: var(--nav-menu-bg);
    width: 100%;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease;
  }

  .nav-menu.show {
    max-height: 300px;
    opacity: 1;
  }
}

.new-badge {
  background: red;
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 5px;
  animation: blinkGlow 1.2s infinite;
}

@keyframes blinkGlow {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 8px red, 0 0 15px yellow;
  }
  50% {
    opacity: 0.3;
    box-shadow: 0 0 4px red, 0 0 8px orange;
  }
}

.navbar, .nav-link {
  font-family: "Segoe UI", sans-serif;
  font-size: 18px;
}
