/* === Modern Navbar Styles === */
.site-navbar {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0.75rem 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  max-width: none;
  margin: 0;
  padding: 0;
  height: auto;
  position: relative; /* Added for mobile menu positioning */
}

/* Logo Styles */
.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.logo-link:hover {
  transform: scale(1.02);
}

.site-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
}

/* Navigation Styles */
.site-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  color: #374151;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  padding: 0.5rem 0;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #10b981, #059669);
  border-radius: 1px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
  color: #10b981;
}

.nav-link:hover::after {
  width: 100%;
}

/* Mobile Menu Toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background-color 0.2s ease;
  z-index: 1001; /* Ensure toggle is above menu */
}

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

.hamburger-line {
  width: 22px;
  height: 2px;
  background-color: #374151;
  border-radius: 1px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

.hamburger-line:not(:last-child) {
  margin-bottom: 4px;
}

/* Animated hamburger to X */
.nav-toggle-active .hamburger-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle-active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scale(0.5);
}

.nav-toggle-active .hamburger-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Fork Button Styles */
.fork-button {
  background-color: #24292e;
  color: #fff !important;
  padding: 6px 12px;
  border-radius: 4px;
  font-weight: bold;
  text-decoration: none;
  transition: background-color 0.3s ease;
  display: inline-flex;
  align-items: center;
}

.fork-button:hover {
  background-color: #444c56;
  color: #fff !important;
}

.nav-icon {
  width: 16px;
  height: 16px;
  margin-right: 8px;
  vertical-align: middle;
  filter: invert(1);
  margin-bottom: 2px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .site-navbar {
    padding: 0.5rem 1rem;
  }
  
  .site-logo {
    height: 36px;
  }

  .nav-toggle {
    display: flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: calc(100% + 0.75rem); /* Account for navbar padding */
    left: -1rem; /* Align with container padding */
    right: -1rem;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    flex-direction: column;
    padding: 1rem;
    gap: 0;
    width: calc(100% + 2rem); /* Account for negative margins */
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    margin: 0;
  }

  .site-nav.nav-open {
    display: flex;
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-link {
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    width: 100%;
    border-radius: 6px;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
  }

  .nav-link:last-child {
    border-bottom: none;
    margin-bottom: 0;
  }

  .nav-link::after {
    display: none;
  }

  .nav-link:hover {
    background-color: rgba(16, 185, 129, 0.08);
    color: #10b981;
  }

  /* Special styling for fork button on mobile */
  .fork-button {
    background-color: #24292e;
    color: #fff !important;
    border-radius: 6px;
    padding: 0.875rem 1rem;
    font-weight: 600;
    justify-content: center;
    margin-top: 0.5rem;
  }

  .fork-button:hover {
    background-color: #444c56;
    color: #fff !important;
  }

  /* Active/current page state on mobile */
  .nav-link.active {
    background-color: rgba(16, 185, 129, 0.12);
    color: #10b981;
    font-weight: 600;
  }
}

/* Desktop styles for active state */
@media (min-width: 769px) {
  .nav-link.active {
    color: #10b981;
  }

  .nav-link.active::after {
    width: 100%;
  }
}

/* Scroll effect for header */
.site-navbar.scrolled {
  background-color: rgba(255, 255, 255, 0.98);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Focus states for accessibility */
.nav-link:focus,
.nav-toggle:focus,
.logo-link:focus {
  outline: 2px solid #10b981;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Prevent body scroll when mobile menu is open */
body.nav-open-body {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* Overlay for mobile menu (optional) */
@media (max-width: 768px) {
  .nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

  .nav-overlay.active {
    opacity: 1;
    visibility: visible;
  }
}