/* ── Languages ── */

.lang-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
}

/* Search */
.lang-search-wrap {
  position: relative;
  margin-bottom: 16px;
}
.lang-clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  padding: 4px;
  cursor: pointer;
}

/* Dropdown — clean styling */
.lang-dropdown {
  position: absolute;
  z-index: 999;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  max-height: 260px;
  overflow-y: auto;
}
.lang-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.1s;
  min-height: 44px;
}
.lang-dropdown-item:last-child {
  border-bottom: none;
}
.lang-dropdown-item:hover {
  background: var(--gray-100);
}
.lang-dropdown-flag {
  font-size: 18px;
  min-width: 24px;
}
.lang-dropdown-name { font-weight: 500; }
.lang-dropdown-code {
  font-size: 11px;
  color: var(--text-muted);
}

/* Preview */
.lang-preview {
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: color-mix(in srgb, var(--accent-primary) 7%, transparent);
  border: none;
}
.lang-preview-flag { font-size: 28px; }
.lang-preview-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.lang-preview-code {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 2px;
}

/* Placeholder */
.lang-placeholder {
  background: var(--gray-100);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* Language items grid */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

/* Language items — good padding, clickable feel */
.lang-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  border: 1px solid transparent;
  min-height: 48px;
  transition: background 0.1s, border-color 0.1s;
}
.lang-item:hover {
  background: var(--gray-200);
  border-color: var(--border);
}
.lang-item-flag { font-size: 18px; }
.lang-item-info { flex: 1; }
.lang-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.lang-item-code {
  font-size: 11px;
  color: var(--accent-primary);
  font-weight: 700;
}
.lang-item-del {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 6px;
  display: flex;
  cursor: pointer;
  border-radius: var(--radius-sm);
  min-width: 28px;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  transition: color 0.1s, background 0.1s;
}
.lang-item-del:hover {
  color: var(--red);
  background: color-mix(in srgb, var(--red) 8%, transparent);
}

/* Empty state */
.lang-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ── Mobile ── */
@media (max-width: 767px) {
  .lang-layout { grid-template-columns: 1fr; gap: 16px; }
  .lang-grid { grid-template-columns: 1fr; }
}
