/* ===========================
   Modern Header Styles
=========================== */

/* Additional animations for header elements */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(20px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Modern Navigation Bar */
nav {
  background-color: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid rgba(224, 224, 224, 0.5);
  position: fixed;
  top: var(--alert-banner-height);
  width: 100%;
  z-index: 900;
  transition: all 0.3s ease, transform 0.4s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

nav.scrolled {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

nav.hide {
  transform: translateY(-100%);
}

nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
  transition: height 0.3s ease;
}

nav.scrolled .container {
  height: 70px;
}

.logo {
  position: relative;
  z-index: 1000;
}

.logo a {
  display: block;
}

.logo a img {
  height: 60px;
  transition: all 0.3s ease;
}

nav.scrolled .logo a img {
  height: 50px;
}

.nav-links {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
}

.nav-links li {
  margin-left: 5px;
  position: relative;
}

.nav-links a {
  font-size: 1em;
  color: var(--dark-text-color);
  padding: 8px 16px;
  border-radius: 6px;
  display: block;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
}

.nav-links a:hover {
  color: var(--primary-color);
  background-color: rgba(139, 90, 43, 0.08);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: all 0.3s ease;
  transform: translateX(-50%);
  opacity: 0;
}

.nav-links a:hover::after {
  width: 30px;
  opacity: 1;
}

.nav-links a.active {
  color: var(--primary-color);
  background-color: rgba(139, 90, 43, 0.1);
}

.nav-links a.active::after {
  width: 30px;
  opacity: 1;
}

/* Menu Icon for Mobile */
.menu-icon {
  display: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: transparent;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  transition: background-color 0.3s ease;
  position: relative;
  z-index: 1000;
}

.menu-icon:hover {
  background-color: rgba(139, 90, 43, 0.08);
}

.menu-icon span {
  height: 2px;
  width: 22px;
  background-color: var(--dark-text-color);
  margin: 2px 0;
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

/* Animate Menu Icon */
.menu-icon.toggle span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

.menu-icon.toggle span:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px);
}

.menu-icon.toggle span:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4px);
}

/* Mobile Navigation */
@media (max-width: 768px) {
  /* Navigation Bar Adjustments */
  nav .container {
    height: 70px;
  }

  .logo a img {
    height: 50px;
  }

  /* Hide Navigation Links and Show Menu Icon */
  .nav-links {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    position: absolute;
    top: 70px;
    left: 0;
    padding: 0;
    margin: 0;
    border-top: 1px solid rgba(224, 224, 224, 0.5);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  .nav-links.nav-active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
  }

  .nav-links li {
    margin: 0;
    text-align: center;
    width: 100%;
    opacity: 0;
    transform: translateY(-10px);
    animation: fadeInDown 0.3s forwards;
    animation-delay: calc(0.05s * var(--item-index, 0));
  }

  .nav-links li:nth-child(1) { --item-index: 1; }
  .nav-links li:nth-child(2) { --item-index: 2; }
  .nav-links li:nth-child(3) { --item-index: 3; }
  .nav-links li:nth-child(4) { --item-index: 4; }
  .nav-links li:nth-child(5) { --item-index: 5; }

  .nav-links li a {
    padding: 15px 0;
    display: block;
    width: 100%;
    border-radius: 0;
  }

  .nav-links a::after {
    bottom: 5px;
  }

  /* Show Menu Icon */
  .menu-icon {
    display: flex;
  }
}

/* Small Devices (Mobile Phones) */
@media (max-width: 480px) {
  nav .container {
    height: 60px;
  }

  .logo a img {
    height: 40px;
  }
}
