/* navbar.css */
/* ========== NAVBAR BASE ========== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  z-index: 1000;
  transition: box-shadow 0.3s ease, background-color 0.3s ease;

  /* Navbar Entrance Animation*/
  transform: translateY(-100%);
  opacity: 0;
  animation: navbarEnter 0.8s ease 0.2s forwards;
}

/* Animation keyframes */
@keyframes navbarEnter {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.navbar.scrolled {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  backdrop-filter: var(--blur);
}

/* Glass Effect */
.glass {
  background: rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

/* Dark Mode Glass Effect */
body.dark .glass {
  background: rgba(15, 23, 42, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

/* ========== LAYOUT ========== */
.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0.4rem 0;
}

.logo img {
  width: 50px;
  height: auto;
  max-height: 50px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.logo img:hover {
  transform: scale(1.05);
}

/* Logo theme switching */
/* ===== Default (Light Mode) ===== */
.logo-light {
  display: block;
}

.logo-dark {
  display: none;
}

/* ===== Dark Mode ===== */
body.dark .logo-light {
  display: none;
}

body.dark .logo-dark {
  display: block;
}


/* ========== NAVIGATION LINKS ========== */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  flex: 1;
  justify-content: center;
}

.nav-links a {
  position: relative;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.3s ease;
  white-space: nowrap;
  border-radius: 4px;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

/* Underline Effect */
.nav-links a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 60%;
}

/* ========== NAV ACTIONS CONTAINER ========== */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-shrink: 0;
}

/* ========== THEME TOGGLE ========== */
.theme-toggle {
  background: none;
  border: 2px solid var(--primary);
  color: var(--primary);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.85rem;
  padding: 0;
  min-width: 38px;
  min-height: 38px;
}

.theme-toggle i {
  transition: transform 0.4s ease;
}

body.dark .theme-toggle i {
  transform: rotate(180deg);
}

.theme-toggle:hover {
  background: var(--primary);
  color: white;
  transform: rotate(-40deg) scale(1.08);
}

.theme-toggle:active {
  transform: rotate(-40deg) scale(0.95);
}

/* ========== HAMBURGER MENU ========== */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
  z-index: 1002;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.hamburger:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

body.dark .hamburger:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.hamburger span {
  width: 20px;
  height: 2.5px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  transform-origin: center;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}

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

.hamburger.active span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* ========== RESPONSIVE DESIGN ========== */

/* Desktop (1200px and above) */
@media (min-width: 1200px) {
  .nav-container {
    padding: 0 2rem;
    gap: 2rem;
  }

  .nav-links {
    gap: 1rem;
  }

  .nav-links a {
    padding: 10px 14px;
    font-size: 0.95rem;
  }
}

/* Tablets and Medium Devices (768px to 992px) */
@media (max-width: 992px) {
  .nav-container {
    padding: 0 1rem;
    gap: 1rem;
  }

  .hamburger {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    right: -100%;
    width: min(320px, 85%);
    max-width: 100%;
    height: calc(100vh - var(--nav-height));
    background: rgba(255, 255, 255, 0.99);
    backdrop-filter: var(--nav-blur);
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 2.5rem;
    gap: 1.5rem;
    list-style: none;
    transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    z-index: 999;
  }

  body.dark .nav-links {
    background: rgba(15, 23, 42, 0.99);
  }

  .nav-links.active {
    right: 0;
  }

  .nav-links a {
    width: 90%;
    text-align: center;
    padding: 12px 16px;
    font-size: 1rem;
    border-radius: 6px;
  }

  .nav-links a::after {
    display: none;
  }

  .nav-links a.active {
    background: rgba(45, 160, 168, 0.15);
    border-radius: 6px;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
    font-size: 0.8rem;
  }

  .logo img {
    width: 45px;
  }
}

/* Small Tablets (600px to 768px) */
@media (max-width: 768px) {
  .nav-container {
    padding: 0 0.8rem;
    gap: 0.8rem;
  }

  .nav-links {
    width: min(300px, 80%);
    padding-top: 2rem;
    gap: 1.2rem;
  }

  .nav-links a {
    padding: 11px 14px;
    font-size: 0.95rem;
  }

  .theme-toggle {
    width: 34px;
    height: 34px;
    font-size: 0.75rem;
  }

  .hamburger {
    width: 28px;
    height: 28px;
    padding: 6px;
  }

  .hamburger span {
    width: 18px;
  }

  .logo img {
    width: 42px;
  }
}

/* Mobile (480px to 600px) */
@media (max-width: 600px) {
  .nav-container {
    padding: 0 0.7rem;
    gap: 0.6rem;
  }

  .nav-links {
    width: min(250px, 90%);
    padding-top: 1.8rem;
    gap: 1rem;
  }

  .nav-links a {
    padding: 10px 12px;
    font-size: 0.9rem;
  }

  .theme-toggle {
    width: 32px;
    height: 32px;
    border-width: 1.5px;
    font-size: 0.7rem;
  }

  .hamburger {
    width: 26px;
    height: 26px;
    padding: 5px;
  }

  .hamburger span {
    width: 16px;
    height: 2px;
  }

  .logo img {
    width: 38px;
  }
}

/* Small Mobile (Less than 480px) */
@media (max-width: 480px) {
  .nav-container {
    padding: 0 0.6rem;
    gap: 0.4rem;
    height: 60px;
  }

  .navbar {
    height: 60px;
  }

  .nav-links {
    top: 60px;
    width: min(200px, 80%);
    right: -100%;
    border-radius: 0;
    padding-top: 1.5rem;
    gap: 0.8rem;
  }

  .nav-links a {
    padding: 9px 10px;
    font-size: 0.85rem;
  }

  .theme-toggle {
    width: 30px;
    height: 30px;
    border-width: 1px;
    font-size: 0.65rem;
  }

  .hamburger {
    width: 24px;
    height: 24px;
    padding: 4px;
    gap: 3px;
  }

  .hamburger span {
    width: 14px;
    height: 1.5px;
  }

  .logo img {
    width: 35px;
  }
}

/* ========== ACCESSIBILITY ========== */
@media (prefers-reduced-motion: reduce) {
  .navbar {
    animation: none;
    transform: none;
    opacity: 1;
  }

  .nav-links,
  .nav-links a,
  .theme-toggle,
  .hamburger span {
    animation: none !important;
    transition: none !important;
  }
}

/* Focus Visible Styles */
.nav-links a:focus-visible,
.theme-toggle:focus-visible,
.hamburger:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ========== MOBILE MENU SCROLL LOCK ========== */
body.menu-open {
  overflow: hidden;
}