/* Header & Navigation */
header {
  position: fixed;
  top: 0;
  width: 100%;
  /* background-color: white;
  border-bottom: 1px solid #f0f0f0; */
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

header.scrolled {
  background: #ffffff; /* White background on scroll */
  border-bottom: 3px solid #f0f0f0;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 3rem;
  max-width: 1800px;
  margin: 0 auto;
}

.logo {
  text-decoration: none;
  font-size: 1.75rem;
  font-weight: 800;
  color: #0f0f0f;
  letter-spacing: -0.025em;
}

.nav-center {
  display: flex;
  list-style: none;
  gap: 0;
}

.nav-center li {
  position: relative;
}

.nav-center a {
  text-decoration: none;
  color: black;
  font-weight: 500;
  font-size: 14px;
  padding: 0.8rem 1.5rem;
  border-radius: 500px;
  display: block;
  transition: all 0.2s ease;
}

.nav-center a:hover {
  background: #f8f8f8;
  color: #0f0f0f;
}

.donate-btn {
  background: #0f0f0f;
  color: white;
  padding: 0.75rem 1.75rem;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  letter-spacing: 0.005em;
}

.donate-btn:hover {
  background: #2d2d2d;
  transform: translateY(-1px);
}

/* Full Width Mega Menu */
.mega-menu {
  position: fixed;
  top: 73px;
  left: 0;
  right: 0;
  width: 100%;
  background-color: white;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-20px);
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  z-index: 999;
}

.nav-center li:hover .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mega-menu-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0rem 3rem 3.5rem;
}

.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0px 2.5rem;
}

.mega-menu-column {
  margin-top: 35px;
}

.mega-menu-column h3 {
  color: #0f0f0f;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f0f0f0;
}

.mega-menu-column ul {
  list-style: none;
  display: grid;
}

.mega-menu-column ul li a {
  color: #525252;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 0.5rem 0rem;
  display: block;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  border-radius: 10px;
  position: relative;
}

.mega-menu-column ul li a:hover {
  color: #0f0f0f;
  background: transparent;
  font-weight: 600;
  padding-left: 0.5rem;
}

/* Mobile Menu Toggle */
.mobile-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 4px;
  z-index: 1001;
}

.mobile-toggle span {
  width: 22px;
  height: 2px;
  background: #0f0f0f;
  transition: all 0.3s ease;
}

/* Mobile Styles */
@media (max-width: 768px) {
  nav {
    padding: 1rem 2rem;
  }

  .mobile-toggle {
    display: flex;
  }

  .nav-center {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: white;
    flex-direction: column;
    padding: 5rem 0 2rem;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
  }

  .nav-center.mobile-active {
    transform: translateX(0);
  }

  .nav-center li {
    width: 100%;
    border-bottom: 1px solid #f0f0f0;
  }

  .nav-center > li > a {
    padding: 1.25rem 2rem;
    border-radius: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  /* Mobile mega menu styling */
  .mega-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: #f8f8f8;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .mega-menu.mobile-menu-open {
    max-height: 2000px;
  }

  .mega-menu-container {
    padding: 1rem 2rem 2rem;
    max-width: none;
  }

  .mega-menu-grid {
    display: block;
  }

  .mega-menu-column {
    margin-top: 1.5rem;
    margin-bottom: 2rem;
  }

  .mega-menu-column:first-child {
    margin-top: 1rem;
  }

  .mega-menu-column h3 {
    font-size: 14px;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    color: #0f0f0f;
  }

  .mega-menu-column ul li a {
    padding: 0.75rem 0;
    font-size: 15px;
    color: #666;
  }

  .mega-menu-column ul li a:hover {
    color: #0f0f0f;
    padding-left: 0;
    background: transparent;
  }

  /* Hide desktop hover behavior */
  .nav-center li:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  /* Mobile toggle animation */
  .mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .mobile-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }

  /* Prevent body scroll when menu is open */
  body.menu-open {
    overflow: hidden;
  }

  .donate-btn {
    display: none;
  }

  /* Add dropdown arrow for mobile */
  .nav-center > li:has(.mega-menu) > a::after {
    content: "▼";
    font-size: 12px;
    transition: transform 0.3s ease;
  }

  .nav-center > li.dropdown-open > a::after {
    transform: rotate(180deg);
  }
}

/* Tablet adjustments */
@media (max-width: 1024px) and (min-width: 769px) {
  .mega-menu-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .mega-menu-container {
    padding: 0rem 2rem 3.5rem;
  }
}
