:root {
  --lang-bg: #09090b;
  --lang-border: #333333;
  --lang-text: #f8fafc;
  --lang-muted: #a1a1aa;
  --lang-hover: rgba(255, 255, 255, 0.08);
  --lang-selected: #ffffff;
  --lang-selected-accent: #22c55e;
}

.language-switcher-backdrop {
  background: rgba(0, 0, 0, 0.8) !important;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.language-switcher-dialog__paper {
  background: var(--lang-bg);
  color: var(--lang-text);
  border: 1px solid var(--lang-border);
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  width: min(94vw, 1280px);
  max-width: 1280px;
  font-family: "Inter", "Roboto", "Segoe UI", system-ui, sans-serif;
}

.language-switcher-modal {
  display: flex;
  flex-direction: column;
  padding: 12px 14px 14px;
  max-height: 86vh;
}

.language-switcher-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}

.language-switcher-modal__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.01em;
}

.language-switcher-modal__subtitle {
  margin: 2px 0 0;
  color: var(--lang-muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.language-switcher-modal__close {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: #0b0f16;
  background: #f8fafc;
  border: 1px solid #cbd5f5;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.language-switcher-modal__close:hover {
  background: #ffffff;
  border-color: #94a3b8;
}

.language-switcher-modal__search {
  width: 100%;
  margin-bottom: 6px;
}

.language-switcher-modal__search .MuiOutlinedInput-root {
  border-radius: 10px;
  background: #0f0f12;
  color: var(--lang-text);
  font-size: 0.85rem;
}

.language-switcher-modal__search .MuiOutlinedInput-notchedOutline {
  border-color: var(--lang-border);
}

.language-switcher-modal__search .MuiInputLabel-root {
  color: var(--lang-muted);
}

.language-switcher-modal__list {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.language-switcher-modal__list::-webkit-scrollbar {
  width: 6px;
}

.language-switcher-modal__list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}

.language-switcher-modal__list::-webkit-scrollbar-track {
  background: transparent;
}

.language-switcher-modal__list {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

.language-switcher-group {
  margin-bottom: 6px;
}

.language-switcher-group__title {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--lang-muted);
  margin: 0 0 2px;
}

.language-switcher-group__grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  column-gap: 6px;
  row-gap: 5px;
}

.language-switcher-option-item {
  list-style: none;
}

.language-switcher-option {
  width: 100%;
  height: 30px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 5px;
  border: 0;
  background: transparent;
  color: var(--lang-muted);
  font-size: 0.78rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.language-switcher-option:hover {
  background: var(--lang-hover);
  color: #ffffff;
}

.language-switcher-option.is-active {
  color: var(--lang-selected);
}

.language-switcher-option:focus-visible {
  outline: 2px solid #94a3b8;
  outline-offset: 2px;
}

.language-switcher-option__flag {
  width: 18px;
  height: 18px;
  border-radius: 3px;
}

.language-switcher-option__label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.language-switcher-option__check {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--lang-selected-accent);
  margin-left: auto;
}

.language-switcher-option__check svg {
  font-size: 18px;
}

.language-switcher-option__check.is-empty {
  opacity: 0;
}

.language-switcher-empty {
  padding: 12px 0;
  color: var(--lang-muted);
  font-size: 0.85rem;
}

@media (max-width: 1200px) {
  .language-switcher-group__grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .language-switcher-group__grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .language-switcher-dialog__paper {
    width: min(94vw, 980px);
  }

  .language-switcher-group__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .language-switcher-group__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.language-switcher-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 148px;
  min-width: 148px;
  height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.85);
  color: #e5e7eb;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.language-switcher-trigger:hover {
  border-color: rgba(148, 163, 184, 0.7);
  background: rgba(30, 41, 59, 0.9);
  transform: translateY(-1px);
}

.language-switcher-trigger__flag {
  width: 18px;
  height: 18px;
  border-radius: 4px;
}

.language-switcher-trigger__label {
  max-width: 78px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.language-switcher-trigger__code {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-left: auto;
}

@media (max-width: 768px) {
  .language-switcher-trigger {
    width: 40px;
    min-width: 40px;
    height: 32px;
    padding: 0;
    border-radius: 10px;
    justify-content: center;
    gap: 0;
  }

  .language-switcher-trigger__label,
  .language-switcher-trigger__code {
    display: none;
  }
}
