/* Language selector — landing, login, register, and AdminLTE dashboards */

[data-i18n-src-text]::before,
[data-i18n-src-text]::after,
[data-i18n-src-ph]::before,
[data-i18n-src-ph]::after {
  content: none !important;
}

.sam-lang-select,
.sam-lang-toggle {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 6px 22px 6px 10px;
  cursor: pointer;
  min-width: 0;
  width: auto;
  background: rgba(255, 255, 255, 0.12);
}

.sam-lang-select:focus,
.sam-lang-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.25);
  border-color: #4caf50;
}

.sam-lang-select option {
  color: #1b2b22 !important;
  background: #fff !important;
}

.navbar .sam-lang-select,
.navbar .sam-lang-toggle,
body.landing-page .sam-lang-toggle {
  color: #fff;
}

body.landing-page .navbar.scrolled .sam-lang-toggle {
  color: #1b2b22;
  background: #f3f6f4;
  border-color: rgba(27, 43, 34, 0.16);
}

.right-header .sam-lang-toggle,
.reg-header .sam-lang-toggle,
.login-toolbar .sam-lang-toggle {
  color: #1b2b22;
  background: #f3f6f4;
  border-color: #e0e0e0;
}

body.dark .right-header .sam-lang-toggle,
body.dark .reg-header .sam-lang-toggle {
  color: #f3f6f4;
  background: #2a2a2a;
  border-color: rgba(255, 255, 255, 0.14);
}

.sam-lang-picker {
  position: relative;
  display: inline-block;
}

.sam-lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: auto;
}

.sam-lang-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.75;
  flex-shrink: 0;
}

.sam-lang-picker.is-open .sam-lang-caret {
  transform: rotate(180deg);
}

.sam-lang-panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: max-content;
  min-width: 124px;
  max-width: 160px;
  padding: 4px;
  background: #fff;
  color: #1b2b22;
  border: 1px solid rgba(27, 43, 34, 0.12);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15, 40, 30, 0.16);
  z-index: 4000;
}

.sam-lang-picker.is-open .sam-lang-panel {
  display: block;
}

.sam-lang-option {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: #1b2b22;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 8px;
  border-radius: 7px;
  cursor: pointer;
}

.sam-lang-option:hover {
  background: #f3f6f4;
}

.sam-lang-option.is-active,
.sam-lang-menu .dropdown-item.is-active {
  background: rgba(40, 167, 69, 0.12);
  color: #1e7e34;
  font-weight: 700;
}

body.landing-page .nav-links .sam-lang-nav-public {
  list-style: none;
  margin-left: 6px;
}

.sam-lang-nav .nav-link {
  display: inline-flex;
  align-items: center;
}

.sam-lang-header-tools {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 768px) {
  body.landing-page .nav-tools .sam-lang-nav-public {
    margin: 0;
    width: auto;
  }
  body.landing-page .nav-tools .sam-lang-picker,
  body.landing-page .nav-tools .sam-lang-toggle {
    width: auto;
  }
}
