/* ============================================
   MODERN NAVBAR DESIGN
   Glassmorphism with smooth interactions
   ============================================ */

/* Navbar Base */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: rgba(255, 255, 255, 0.85);
  /* Reduced blur from 20px to 10px for better performance */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  /* Hint browser to optimize blur rendering */
  will-change: backdrop-filter;
}

/* Fallback for browsers without backdrop-filter support */
@supports not (backdrop-filter: blur(10px)) {
  .navbar {
    background: rgba(255, 255, 255, 0.95);
  }
}

.navbar.scrolled {
  height: 70px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 6px 32px rgba(0, 0, 0, 0.08);
}

.navbar-container {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 2.5rem;
  position: relative;
}

/* Logo - Enhanced */
.logo {
  justify-self: start;
  z-index: 1001;
}

.logo-text {
  font-family: 'Special Gothic Condensed One', sans-serif;
  text-decoration: none;
  color: #1a202c;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}

.logo-text::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, #D4AF37 0%, #f39c12 100%);
  transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 2px;
}

.logo-text:hover::after {
  width: 100%;
}

.logo-text:hover {
  transform: translateY(-2px);
}

/* Navigation Links Container */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  justify-self: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Navigation Link Styles */
.nav-link,
.dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #4a5568;
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

/* Ensure dropdown-btn works as anchor link */
a.dropdown-btn {
  text-decoration: none;
  color: inherit;
}

a.dropdown-btn:visited {
  color: inherit;
}

/* Current page indicator */
.nav-link[aria-current="page"],
.dropdown-btn[aria-current="page"] {
  color: #D4AF37;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(243, 156, 18, 0.12) 100%);
  font-weight: 700;
}

.nav-link[aria-current="page"]::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 3px;
  background: linear-gradient(90deg, #D4AF37, #f39c12);
  border-radius: 2px;
}

.nav-link::before,
.dropdown-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0%, rgba(243, 156, 18, 0.08) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 12px;
}

.nav-link:hover::before,
.dropdown-btn:hover::before {
  opacity: 1;
}

.nav-link:hover,
.dropdown-btn:hover {
  color: #1a202c;
  transform: translateY(-2px);
}

.nav-link:active,
.dropdown-btn:active {
  transform: translateY(0);
}

/* Dropdown Styles */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-arrow {
  width: 12px;
  height: 8px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 0.6;
}

.dropdown:hover .dropdown-arrow,
.dropdown.active .dropdown-arrow {
  transform: rotate(180deg);
  opacity: 1;
}

/* Dropdown Content - Glassmorphism */
.dropdown-content {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  min-width: 260px;
  border-radius: 16px;
  box-shadow:
    0 12px 48px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: 0.5rem;
  z-index: 100;
}

.dropdown:hover .dropdown-content,
.dropdown.active .dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-content a {
  display: block;
  padding: 0.85rem 1.25rem;
  color: #4a5568;
  text-decoration: none;
  font-size: 0.925rem;
  font-weight: 500;
  border-radius: 10px;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.dropdown-content a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: linear-gradient(to bottom, #D4AF37, #f39c12);
  transition: height 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 0 2px 2px 0;
}

.dropdown-content a:hover::before {
  height: 60%;
}

.dropdown-content a:hover {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0%, rgba(243, 156, 18, 0.08) 100%);
  color: #1a202c;
  padding-left: 1.5rem;
  transform: translateX(4px);
}

/* Current page in dropdown */
.dropdown-content a[aria-current="page"] {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(243, 156, 18, 0.15) 100%);
  color: #D4AF37;
  font-weight: 700;
  border-left: 4px solid #D4AF37;
  padding-left: calc(1.5rem - 4px);
}

.dropdown-content a[aria-current="page"]::before {
  height: 100%;
  width: 4px;
}

/* Mobile-only overview link */
.mobile-only-overview {
  display: none;
  font-weight: 700 !important;
  background: linear-gradient(135deg,
    rgba(212, 175, 55, 0.1) 0%,
    rgba(243, 156, 18, 0.1) 100%) !important;
  border-bottom: 2px solid rgba(212, 175, 55, 0.2);
  margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
  .mobile-only-overview {
    display: block;
  }
}

/* Language Switcher - Modern Design */
.language-switcher {
  justify-self: end;
  position: relative;
  z-index: 1001;
}

.lang-flag-group {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0.35rem;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
}

.lang-flag-group:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  border-color: rgba(212, 175, 55, 0.2);
}

.lang-flag-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 38px;
  border: none;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: 0;
  position: relative;
  overflow: hidden;
}

.lang-flag-btn img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.lang-flag-btn:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-2px);
}

.lang-flag-btn:hover img {
  transform: scale(1.1);
}

.lang-flag-btn.active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(243, 156, 18, 0.15) 100%);
  box-shadow: inset 0 0 0 2px rgba(212, 175, 55, 0.3);
}

.lang-flag-btn.active img {
  transform: scale(1.05);
}

.lang-flag-btn:active {
  transform: scale(0.95);
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 32px;
  height: 28px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1002;
  position: absolute;
  right: 2.5rem;
  transition: all 0.3s ease;
}

.mobile-menu-btn span {
  width: 100%;
  height: 3px;
  background: #1a202c;
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: center;
}

.mobile-menu-btn:hover span {
  background: #D4AF37;
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

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

.mobile-menu-btn.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Overlay */
.nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 998;
}

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

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

@media (max-width: 768px) {
  .navbar {
    height: 65px;
  }

  .navbar-container {
    padding: 0 1.5rem;
    grid-template-columns: 1fr auto;
  }

  .logo-text {
    font-size: 1.6rem;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 65px;
    right: 0;
    width: 320px;
    max-width: 85vw;
    height: calc(100vh - 65px);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 2rem 1.5rem;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
    z-index: 999;
    overflow-y: auto;
  }

  .nav-links.active {
    transform: translateX(0);
  }

  .nav-overlay {
    display: block;
  }

  .nav-link,
  .dropdown-btn {
    width: 100%;
    justify-content: flex-start;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    border-radius: 12px;
  }

  .dropdown {
    width: 100%;
  }

  .dropdown-content {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: none;
    background: rgba(248, 249, 250, 0.5);
    margin-top: 0.5rem;
    margin-left: 1rem;
  }

  .dropdown.active .dropdown-content {
    max-height: 600px;
    padding: 0.5rem;
  }

  .dropdown-content a {
    padding: 0.75rem 1rem;
  }

  .language-switcher {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    justify-self: center;
  }

  .lang-flag-group {
    padding: 0.5rem;
  }

  .lang-flag-btn {
    width: 48px;
    height: 44px;
  }

  .lang-flag-btn img {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 480px) {
  .navbar-container {
    padding: 0 1.25rem;
  }

  .logo-text {
    font-size: 1.4rem;
  }

  .nav-links {
    width: 100%;
    max-width: 100%;
    padding: 1.5rem 1.25rem;
  }

  .mobile-menu-btn {
    right: 1.25rem;
    width: 28px;
    height: 24px;
  }

  .mobile-menu-btn span {
    height: 2.5px;
  }
}

/* Scroll behavior adjustments */
body.menu-open {
  overflow: hidden;
}

/* ============================================
   PERFORMANCE OPTIMIZATION
   ============================================ */

/* Reduce blur on mobile for better performance */
@media (max-width: 768px) {
  .navbar,
  .dropdown-content,
  .nav-links,
  .lang-flag-group {
    /* Reduce blur from 10px to 6px on mobile */
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }

  /* Increase background opacity to compensate */
  .navbar {
    background: rgba(255, 255, 255, 0.92);
  }

  .dropdown-content {
    background: rgba(255, 255, 255, 0.97);
  }
}

/* Disable blur entirely on low-end devices or when GPU acceleration is limited */
@media (max-width: 480px) and (prefers-reduced-motion: reduce) {
  .navbar,
  .dropdown-content,
  .nav-links,
  .lang-flag-group,
  .mobile-menu-overlay {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .navbar {
    background: rgba(255, 255, 255, 0.98);
  }

  .dropdown-content,
  .nav-links {
    background: rgba(255, 255, 255, 1);
  }

  .mobile-menu-overlay {
    background: rgba(0, 0, 0, 0.6);
  }
}

/* ============================================
   ACCESSIBILITY - FOCUS STATES
   ============================================ */

/* Skip to content link */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: #D4AF37;
  color: #fff;
  padding: 8px 16px;
  z-index: 10000;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 600;
}

.skip-to-content:focus {
  top: 0;
}

/* Focus indicators for all interactive elements */
.dropdown-content a:focus,
.dropdown-btn:focus,
.lang-flag-btn:focus,
.nav-link:focus,
.mobile-menu-btn:focus,
.logo-text:focus {
  outline: 3px solid #D4AF37;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.2);
}

/* Focus visible for keyboard navigation only */
.dropdown-content a:focus:not(:focus-visible),
.dropdown-btn:focus:not(:focus-visible),
.lang-flag-btn:focus:not(:focus-visible),
.nav-link:focus:not(:focus-visible),
.mobile-menu-btn:focus:not(:focus-visible),
.logo-text:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

/* ============================================
   ACCESSIBILITY - REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  /* Disable dropdown arrow rotation */
  .dropdown-arrow,
  .dropdown:hover .dropdown-arrow,
  .dropdown.active .dropdown-arrow {
    transform: none !important;
  }

  /* Instant dropdown visibility */
  .dropdown-content {
    transition: opacity 0.01ms, visibility 0.01ms !important;
  }

  /* Keep navigation stable */
  .nav-link:hover,
  .dropdown-btn:hover,
  .logo-text:hover,
  .lang-flag-btn:hover {
    transform: none !important;
  }
}
