/* Navbar styles */

:root {
  --gold-gradient: linear-gradient(
    45deg,
    #ae8625,
    #f7ef8a,
    #d2ac47,
    #edc967,
    #ae8625,
    #f7ef8a,
    #d2ac47,
    #edc967,
    #ae8625,
    #f7ef8a
  );
  --gold-gradient-hover: linear-gradient(
    45deg,
    #d2ac47,
    #f7ef8a,
    #ae8625,
    #edc967,
    #d2ac47,
    #f7ef8a,
    #ae8625,
    #edc967,
    #d2ac47,
    #f7ef8a
  );
}

.navbar {
  font-size: 23px;
  z-index: 1000;
  background-color: #1f4c7a;
  padding-bottom: 12px;
  font-family: var(--font-primary);
  font-weight: var(--font-weight-medium);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid #c8a24a;
  box-shadow: 0 12px 32px rgba(17, 42, 68, 0.2);
  transition: box-shadow 0.3s ease, background-color 0.3s ease,
    border-color 0.3s ease;
}

.navbar.navbar-elevated {
  background-color: #1f4c7a;
  box-shadow: 0 12px 32px rgba(17, 42, 68, 0.2);
  border-bottom-color: #c8a24a;
}

.nav-link {
  background: var(--gold-gradient);
  background-size: 400% 100%;
  background-position: 0 0;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: #ae8625; /* Fallback for browsers that don't support background-clip */
  position: relative;
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 600;
  font-family: var(--font-primary);
  animation: goldShimmer 8s linear infinite;
  cursor: pointer;
  transform: translateY(0);
}

.nav-link:hover {
  background: var(--gold-gradient-hover);
  background-size: 400% 100%;
  background-position: 0 0;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: #d2ac47; /* Fallback for browsers that don't support background-clip */
  animation: goldShimmerHover 6s linear infinite;
  transform: translateY(-2px);
}

.nav-link:focus-visible {
  outline: 3px solid rgba(237, 201, 103, 0.45);
  outline-offset: 4px;
  transform: translateY(-2px);
}

.nav-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  background: var(--gold-gradient);
  background-size: 400% 100%;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  transition: width 0.3s ease;
  animation: goldShimmer 8s linear infinite;
}

@keyframes goldShimmer {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 100% 0%;
  }
}

@keyframes goldShimmerHover {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 100% 0%;
  }
}

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

.navbar-nav {
  align-items: center;
  column-gap: clamp(16px, 2vw, 28px);
}

.nav-item {
  display: flex;
  align-items: center;
}

.nav-link h1,
.nav-link h2,
.nav-link h3,
.nav-link h4,
.nav-link h5,
.nav-link h6 {
  font-size: inherit;
  line-height: inherit;
  margin: 0;
  font-weight: inherit;
}

.navbar-brand img {
  transition: transform 0.3s ease, filter 0.3s ease;
}

.navbar-brand:hover img {
  transform: scale(1.05);
  filter: brightness(1.05);
}

/* Mobile navbar styles */
.navbar-toggler {
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.navbar-toggler:focus {
  box-shadow: none;
  outline: none;
}

.navbar-toggler:active {
  transform: scale(0.95);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  width: 1.5em;
  height: 1.5em;
  display: block;
}

/* Mobile menu improvements */
.navbar-collapse {
  transition: all 0.3s ease-in-out;
}

.navbar-collapse.show {
  display: block !important;
}

/* Ensure mobile menu is properly styled */
@media (max-width: 991.98px) {
  .navbar-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
  }

  .navbar-collapse {
    background-color: rgba(31, 76, 122, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    margin-top: 10px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  }

  .navbar-nav .nav-item {
    margin: 0;
  }

  .navbar-nav .nav-link {
    padding: 12px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
    display: block;
    width: 100%;
    text-align: center;
  }

  .navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
  }
}

/* Touch device enhancements */
.touch-device .nav-link {
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
  touch-action: manipulation;
}

.touch-device .navbar-toggler {
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .navbar {
    font-size: 18px;
    padding-bottom: 8px;
  }

  .navbar-brand img {
    height: 60px;
  }

  .navbar-toggler {
    padding: 10px 15px;
    min-width: 44px;
    min-height: 44px;
  }
}

@media (max-width: 480px) {
  .navbar {
    font-size: 16px;
  }

  .navbar-brand img {
    height: 50px;
  }
}
