/* ============================================
   Preferences Bar - Desktop Only
   Fixed to the right edge, opposite the sidebar
   ============================================ */
.preferences-bar {
  display: none;
  position: fixed;
  top: 8px;
  right: 0;
  z-index: 2100;
  flex-direction: column;
  gap: 4px;
  border-radius: var(--app-radius, 8px);
  border: 1px solid hsl(var(--border));
  padding: 4px;

  will-change: backdrop-filter;
  transform: translateZ(0);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

@media (min-width: 993px) {
  .preferences-bar {
    display: flex;
  }
}

/* ============================================
   Compact Language Selector (36×36 button)
   ============================================ */
.preferences-bar__lang-select {
  width: 36px !important;
}

.preferences-bar__lang-select .mantine-Select-wrapper {
  width: 36px !important;
  min-width: 36px !important;
}

.preferences-bar__lang-select .mantine-Select-input,
.preferences-bar__lang-select .mantine-Input-input {
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  width: 36px !important;
  min-width: 36px !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  cursor: pointer;
  border-radius: var(--app-radius, 8px) !important;
  color: transparent !important;
  font-size: 0 !important;
  caret-color: transparent !important;
  overflow: hidden;
}

.preferences-bar__lang-select .mantine-Select-input:hover,
.preferences-bar__lang-select .mantine-Input-input:hover {
  background: hsl(var(--accent)) !important;
}

.preferences-bar__lang-select .mantine-Select-input:focus,
.preferences-bar__lang-select .mantine-Select-input:focus-visible,
.preferences-bar__lang-select .mantine-Input-input:focus,
.preferences-bar__lang-select .mantine-Input-input:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}

/* Left section: fill input, show centered language code */
.preferences-bar__lang-select [data-position="left"] {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  position: absolute !important;
  inset: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  pointer-events: none;
}

/* Hide the chevron */
.preferences-bar__lang-select [data-position="right"] {
  display: none !important;
}

/* Language code badge */
.preferences-bar__lang-code {
  font-size: var(--font-size-xs, 12px);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: hsl(var(--foreground));
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Dropdown: wider than the 36px trigger */
.preferences-bar__lang-dropdown {
  min-width: 180px !important;
  width: auto !important;
}
