/* ═══════════════════════════════════════════════════════════════
   STRIX EDGE v6 — Language Switcher
   English / Shqip / Italiano / Deutsch
   ═══════════════════════════════════════════════════════════════ */

.lang-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  z-index: 140;
}

.lang-switcher__trigger {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px 7px 10px;
  border: 1px solid rgba(129, 151, 165, .18);
  border-radius: 14px;
  color: var(--text-primary, #111827);
  background: linear-gradient(145deg, rgba(255,255,255,.82), rgba(231,238,242,.88));
  box-shadow: 6px 6px 13px rgba(173,185,193,.42), -6px -6px 13px rgba(255,255,255,.92);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  white-space: nowrap;
}

.lang-switcher__trigger:hover,
.lang-switcher.open .lang-switcher__trigger {
  transform: translateY(-1px);
  border-color: rgba(11,107,83,.24);
  box-shadow: 8px 8px 16px rgba(173,185,193,.48), -7px -7px 16px rgba(255,255,255,.96);
}

.lang-switcher__flag {
  width: 23px;
  height: 16px;
  display: block;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(16,24,40,.14);
  flex: 0 0 auto;
}

.lang-switcher__name {
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: .01em;
}

.lang-switcher__code {
  margin-left: 3px;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted, #7b8993);
  letter-spacing: .08em;
}

.lang-switcher__chevron {
  width: 14px;
  height: 14px;
  opacity: .55;
  transition: transform .18s ease;
}

.lang-switcher.open .lang-switcher__chevron { transform: rotate(180deg); }

.lang-switcher__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 188px;
  padding: 8px;
  border: 1px solid rgba(129,151,165,.16);
  border-radius: 16px;
  background: rgba(244,248,250,.97);
  box-shadow: 12px 14px 30px rgba(110,128,139,.24), -6px -6px 20px rgba(255,255,255,.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(.98);
  transform-origin: top right;
  transition: opacity .16s ease, visibility .16s ease, transform .16s ease;
}

.lang-switcher.open .lang-switcher__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.lang-switcher__option {
  width: 100%;
  display: grid;
  grid-template-columns: 23px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #1d2935;
  cursor: pointer;
  text-align: left;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}

.lang-switcher__option:hover { background: rgba(11,107,83,.075); }
.lang-switcher__option.active {
  background: rgba(11,107,83,.105);
  box-shadow: inset 3px 0 0 #0b6b53;
}
.lang-switcher__option-name { font-size: 13px; font-weight: 700; }
.lang-switcher__option-code {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 10px;
  font-weight: 700;
  color: #85949f;
}

/* Dark theme */
html:not([data-theme="light"]) .lang-switcher__trigger {
  color: var(--text-primary, #edf6f2);
  background: linear-gradient(145deg, #17222d, #101923);
  border-color: rgba(100,232,195,.10);
  box-shadow: 7px 7px 15px rgba(2,6,10,.58), -6px -6px 14px rgba(42,58,70,.22);
}
html:not([data-theme="light"]) .lang-switcher__menu {
  background: rgba(17,25,35,.98);
  border-color: rgba(100,232,195,.10);
  box-shadow: 12px 14px 28px rgba(2,6,10,.62), -5px -5px 18px rgba(42,58,70,.18);
}
html:not([data-theme="light"]) .lang-switcher__option { color: #edf6f2; }
html:not([data-theme="light"]) .lang-switcher__option:hover { background: rgba(21,147,111,.12); }
html:not([data-theme="light"]) .lang-switcher__option.active { background: rgba(21,147,111,.16); }

/* Pages with their own compact header */
.header .lang-switcher { margin-left: auto; }
.header .lang-switcher__trigger { min-height: 36px; border-radius: 10px; padding: 5px 9px; }
.header .lang-switcher__menu { width: 184px; }

@media (max-width: 768px) {
  .lang-switcher__trigger {
    min-height: 38px;
    padding: 6px 9px;
    gap: 7px;
  }
  .lang-switcher__name { display: none; }
  .lang-switcher__code { margin-left: 0; }
  .lang-switcher__menu { right: 0; width: 178px; }
  .lang-switcher__flag { width: 21px; height: 14px; }
}

@media (max-width: 420px) {
  .lang-switcher__code { display: none; }
  .lang-switcher__trigger { padding: 7px 9px; }
}
