/* Modern Mobile-Responsive Navbar Styles */

/* ==================== BASE NAVBAR ==================== */
/* White header on all pages.  Set a subtle shadow and remove
   gradients to better contrast with dark text. */
.modern-navbar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  padding: 0;
}

.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  gap: 20px;
}

/* ==================== LOGO ==================== */
.navbar-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.navbar-logo a {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.navbar-logo img {
  height: 50px;
  width: auto;
  transition: transform 0.3s ease;
}

.navbar-logo img:hover {
  transform: scale(1.05);
}

/* ==================== DESKTOP NAVIGATION ==================== */
.navbar-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
}

/* Navigation link styles: dark text on light backgrounds. */
.nav-link {
  color: #1f2937;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 10px;
  transition: all 0.3s ease;
  background: #f3f4f6;
  backdrop-filter: none;
  white-space: nowrap;
}

/* Hover state: subtle grey background and brand colour text */
.nav-link:hover {
  background: #e5e7eb;
  color: #6d28d9;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

/* ==================== NAVBAR CONTROLS ==================== */
.navbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Theme Button */
/* Theme button: light background and dark text */
.navbar-theme-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  color: #1f2937;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: none;
}

/* Hover: lighten background and colour text */
.navbar-theme-btn:hover {
  background: #e5e7eb;
  color: #6d28d9;
  transform: rotate(90deg);
}

/* Language Selector */
.navbar-lang-wrap {
  position: relative;
}

/* Language selector button: light background/dark text */
.navbar-lang-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  color: #1f2937;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: none;
}

/* Hover: subtle grey and maintain dark text */
.navbar-lang-btn:hover {
  background: #e5e7eb;
  transform: translateY(-2px);
}

.navbar-lang-btn .dropdown-icon {
  transition: transform 0.3s ease;
}

.navbar-lang-wrap.open .navbar-lang-btn .dropdown-icon {
  transform: rotate(180deg);
}

/* Language Dropdown */
.navbar-lang-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 280px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-left: 6px solid #ec4899;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 1100;
  max-height: 400px;
  overflow-y: auto;
}

.navbar-lang-wrap.open .navbar-lang-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.navbar-lang-dropdown[hidden] {
  display: none;
}

.lang-list {
  list-style: none;
  padding: 8px;
  margin: 0;
}

.lang-list li {
  margin: 0;
}

.lang-option {
  display: block;
  padding: 12px 16px;
  color: #1f2937;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.lang-option:hover {
  background: linear-gradient(135deg, #6d28d9 0%, #ec4899 100%);
  color: #ffffff;
  transform: translateX(5px);
}

/* ==================== HAMBURGER MENU ==================== */
/*
 * Hamburger button styling.  The previous implementation used
 * translucent white backgrounds and white bars which disappeared
 * against our new light header.  Update the colours to suit the
 * white navbar: give the button a subtle light grey background and
 * border and render the hamburger bars in dark ink.  Remove the
 * backdrop blur so the control looks crisp on the white header.
 */
.navbar-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 42px;
  height: 42px;
  padding: 10px;
  border-radius: 10px;
  /* Light grey border instead of semi‑transparent white */
  border: 1px solid #e5e7eb;
  /* Light grey background instead of translucent white */
  background: #f3f4f6;
  cursor: pointer;
  transition: all 0.3s ease;
  /* Remove blur to avoid ghosting on white header */
  backdrop-filter: none;
}

.navbar-hamburger span {
  width: 100%;
  height: 3px;
  /* Dark bars for contrast on white header */
  background: #1f2937;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.navbar-hamburger:hover {
  /* Slightly darker grey on hover */
  background: #e5e7eb;
}

.navbar-hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.navbar-hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.navbar-hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* ==================== MOBILE MENU ==================== */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-menu-overlay[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 85%;
  max-width: 400px;
  height: 100%;
  background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 50%, #ec4899 100%);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  padding: 20px;
}

.mobile-menu-overlay[aria-hidden="false"] .mobile-menu-content {
  transform: translateX(0);
}

.mobile-menu-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.mobile-menu-close:hover {
  background: #ffffff;
  color: #6d28d9;
  transform: rotate(90deg);
}

.mobile-menu-links {
  list-style: none;
  padding: 0;
  margin-top: 80px;
}

.mobile-menu-links li {
  margin-bottom: 12px;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  color: #ffffff;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
}

.mobile-nav-link:hover,
.mobile-nav-link:active {
  background: #ffffff;
  color: #6d28d9;
  transform: translateX(8px);
}

.mobile-nav-link svg {
  transition: transform 0.3s ease;
}

.mobile-nav-link:hover svg {
  transform: translateX(5px);
}

/* ==================== RESPONSIVE BREAKPOINTS ==================== */

/* Show desktop-only navigation links on large screens.  These links
   complement the primary tools and remain centred between the logo
   and the controls.  Hide them on smaller viewports via a media
   query below. */
.navbar-links.desktop-only {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
}

@media (max-width: 1024px) {
  .navbar-links.desktop-only {
    display: none;
  }
}

/* Hamburger visible everywhere */
.navbar-hamburger {
  display: flex;
}

/* Tablet adjustments */
@media (max-width: 768px) {
  .navbar-container {
    padding: 10px 16px;
  }

  .navbar-logo img {
    height: 40px;
  }

  .navbar-lang-btn span {
    display: none;
  }

  .navbar-lang-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    /*
     * On tablet/mobile we want the language button to look like a single round icon.  In
     * the default desktop styles the button contains a globe SVG, a language label
     * (<span>) and a chevron (<svg class="dropdown-icon">).  When the span is hidden
     * below 768px the remaining two icons still leave an unwanted gap and cause the
     * globe to appear off‑centre.  To fix this we explicitly remove any internal gap
     * and center the contents.  The dropdown chevron is also hidden completely in
     * these viewports so only the globe icon remains visible.
     */
    justify-content: center;
    gap: 0;
  }

  /* Hide the dropdown arrow on smaller screens so the globe stays centered */
  .navbar-lang-btn .dropdown-icon {
    display: none;
  }

  .navbar-lang-dropdown {
    width: 260px;
  }
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .navbar-container {
    padding: 8px 12px;
  }

  .navbar-logo img {
    height: 36px;
  }

  .navbar-lang-btn {
    width: 36px;
    height: 36px;
  }

  .navbar-hamburger {
    width: 36px;
    height: 36px;
    padding: 8px;
  }

  .mobile-menu-content {
    width: 90%;
  }

  .navbar-lang-dropdown {
    width: calc(100vw - 30px);
    right: -10px;
  }
}

/* Ensuring mobile overlay works on all screens */
@media (min-width: 1025px) {
  .mobile-menu-overlay {
    display: block;
    /* Allow overlay on desktop */
  }
}

/* Dark theme support */
[data-theme="dark"] .navbar-lang-dropdown {
  background: #1f2937;
  border-color: #374151;
}

[data-theme="dark"] .lang-option {
  color: #f3f4f6;
}

[data-theme="dark"] .lang-option:hover {
  background: linear-gradient(135deg, #6d28d9 0%, #ec4899 100%);
  color: #ffffff;
}

/* Smooth scrollbar for language dropdown */
.navbar-lang-dropdown::-webkit-scrollbar {
  width: 8px;
}

.navbar-lang-dropdown::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.navbar-lang-dropdown::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #6d28d9, #ec4899);
  border-radius: 10px;
}

.navbar-lang-dropdown::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #5b21b6, #db2777);
}