/* ============================================
   NAVBAR STYLES
   Apple / GitLab inspired — compact, frosted, minimal
   ============================================ */

/* ---- Base bar ---- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: rgba(88, 55, 163, 0.97);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: background-color 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

/* Scroll state */
.navbar-scrolled {
  background-color: rgba(88, 55, 163, 0.97);
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.12);
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

/* ---- Container ---- */
.navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  height: 52px;
}

/* ---- Logo ---- */
.navbar-logo {
  display: flex;
  align-items: center;
  transition: opacity 0.2s ease;
}

.navbar-logo:hover {
  opacity: 0.85;
}

.navbar-logo img {
  height: 26px;
  width: auto;
}

/* ---- Nav links ---- */
.navbar-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.navbar-links li {
  position: relative;
}

.navbar-links a {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  padding: 6px 14px;
  border-radius: 6px;
  transition: color 0.2s ease, background-color 0.2s ease;
  letter-spacing: 0.1px;
  position: relative;
  cursor: pointer;
}

/* Hover — subtle frosted pill */
.navbar-links a:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
}

/* Active link */
.active-link {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.12) !important;
}

.active-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 2px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 2px;
}

/* ---- Right side wrapper ---- */
.navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---- Language Switch ---- */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 3px 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.lang-switch:hover {
  background: rgba(255, 255, 255, 0.14);
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 5px;
  opacity: 0.5;
  transition: opacity 0.2s ease, background-color 0.2s ease;
}

.lang-active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.12);
}

.lang-flag {
  width: 16px;
  height: 12px;
  border-radius: 2px;
  overflow: hidden;
}

.lang-code {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.5px;
}

.lang-divider {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 2px;
}

/* ---- Hamburger button (mobile) ---- */
.navbar-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

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

.navbar-hamburger span {
  display: block;
  width: 18px;
  height: 1.5px;
  background-color: rgba(255, 255, 255, 0.85);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Hamburger -> X animation */
.hamburger-active span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.hamburger-active span:nth-child(2) {
  opacity: 0;
}

.hamburger-active span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ---- Mobile overlay ---- */
.navbar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.navbar-overlay-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media screen and (max-width: 768px) {
  .navbar-container {
    padding: 0 20px;
    height: 48px;
  }

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

  /* Show hamburger and lang switch side by side */
  .navbar-right {
    display: contents;
  }

  .lang-switch {
    order: 1;
  }

  .navbar-hamburger {
    display: flex;
    order: 2;
  }

  /* Mobile slide-down menu */
  .navbar-links {
    position: fixed;
    top: 48px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background-color: rgba(88, 55, 163, 0.97);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 20px 12px;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 1000;
  }

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

  .navbar-links a {
    font-size: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    width: 100%;
  }

  .active-link::after {
    display: none;
  }

  .navbar-overlay {
    display: block;
  }
}
