/* EnlyAI language switcher */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-header .logo {
  flex: 1 1 auto;
  min-width: 0;
}

.lang-switch {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  z-index: 60;
  font-family: inherit;
}

.lang-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid var(--border-default, rgba(0, 0, 0, 0.12));
  border-radius: 999px;
  background: var(--bg-glass, rgba(255, 255, 255, 0.75));
  color: var(--text-secondary, #6e6e73);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.lang-switch-btn:hover {
  background: var(--bg-elevated, #f5f5f7);
  color: var(--text-primary, #1d1d1f);
  border-color: var(--border-strong, rgba(0, 0, 0, 0.18));
}

.lang-switch-btn:focus-visible {
  outline: 2px solid var(--color-primary, #0071e3);
  outline-offset: 2px;
}

.lang-switch-caret {
  opacity: 0.6;
  transition: transform 0.18s ease;
}

.lang-switch.open .lang-switch-caret {
  transform: rotate(180deg);
}

.lang-switch-code {
  letter-spacing: 0.02em;
}

.lang-switch-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 136px;
  padding: 4px;
  border: 1px solid var(--border-default, rgba(0, 0, 0, 0.1));
  border-radius: 12px;
  background: var(--bg-surface, #fff);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
  display: none;
  z-index: 1200;
}

.lang-switch.open .lang-switch-menu {
  display: block;
}

.lang-switch-menu button {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary, #6e6e73);
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}

.lang-switch-menu button:hover {
  background: var(--bg-elevated, #f5f5f7);
  color: var(--text-primary, #1d1d1f);
}

.lang-switch-menu button.active {
  background: var(--bg-elevated, #f5f5f7);
  color: var(--text-primary, #1d1d1f);
  font-weight: 600;
}

.lang-switch-compact .lang-switch-btn {
  padding: 6px 7px;
}

.lang-switch-compact .lang-switch-menu {
  right: 0;
}

@media (max-width: 768px) {
  .mobile-topbar .lang-switch {
    margin-left: auto;
  }

  .mobile-topbar .lang-switch + .mobile-quick-create {
    margin-left: 6px;
  }
}
