/* ═══════════════════════════════════════════════════════
   Language Switcher – Dark premium design
   Matches the dark navbar of W6 Engineering
   ═══════════════════════════════════════════════════════ */

.lang-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 1001;
}

/* ── Trigger button ── */
.lang-switcher-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(6px);
}

.lang-switcher-btn:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

/* Flag image */
.lang-flag {
  width: 24px;
  height: 18px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

/* Language code text */
.lang-code {
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  color: #fff;
}

/* Dropdown arrow */
.lang-arrow {
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.55);
  transition: transform 0.3s ease;
  margin-left: -2px;
}

.lang-dropdown.open ~ .lang-switcher-btn .lang-arrow,
.lang-switcher-btn:focus .lang-arrow {
  transform: rotate(180deg);
}

/* ── Dropdown panel ── */
.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: #1a1f2e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.lang-dropdown.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ── Individual option ── */
.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: rgba(255, 255, 255, 0.75);
  font-family: "Inter", sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
}

.lang-option:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.lang-option.active {
  background: rgba(61, 122, 53, 0.2);
  color: #5aaa42;
}

.lang-option.active::after {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.75rem;
  margin-left: auto;
  color: #5aaa42;
}

.lang-option + .lang-option {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.lang-option .lang-flag {
  width: 26px;
  height: 19px;
}

/* ── When navbar is scrolled (lighter bg) ── */
.navbar.scrolled .lang-switcher-btn {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
}

.navbar.scrolled .lang-switcher-btn:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .lang-switcher {
    order: -1;
    margin-right: 12px;
  }
}

@media (max-width: 768px) {
  .lang-switcher-btn {
    padding: 5px 10px;
    gap: 6px;
  }

  .lang-flag {
    width: 20px;
    height: 15px;
  }

  .lang-code {
    font-size: 0.78rem;
  }

  .lang-dropdown {
    right: -12px;
    min-width: 145px;
  }
}

/* ── Subtle entrance animation ── */
@keyframes langPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(90, 170, 66, 0);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(90, 170, 66, 0.15);
  }
}

.lang-switcher-btn:focus-visible {
  outline: none;
  animation: langPulse 1.5s ease infinite;
  border-color: #5aaa42;
}
