.subtitle-language-field {
  position: relative;
}

.subtitle-language-picker-ui {
  position: relative;
}

.subtitle-language-picker-ui[hidden],
.subtitle-language-picker-panel[hidden],
.subtitle-language-field.is-enhanced > select {
  display: none;
}

.subtitle-language-picker-button {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border: 1px solid #475569;
  border-radius: 10px;
  background: #0f172a;
  color: #f8fafc;
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.subtitle-language-picker-button:hover,
.subtitle-language-picker-button:focus-visible,
.subtitle-language-field.is-open .subtitle-language-picker-button {
  border-color: #60a5fa;
  background: #16233a;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.16);
}

.subtitle-language-picker-button i {
  color: #93c5fd;
  transition: transform 160ms ease;
}

.subtitle-language-field.is-open .subtitle-language-picker-button i {
  transform: rotate(180deg);
}

.subtitle-language-picker-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subtitle-language-picker-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 5px);
  left: 0;
  display: flex;
  width: 100%;
  max-height: 350px;
  flex-direction: column;
  padding: 12px;
  border: 2px solid rgba(96, 165, 250, 0.62);
  border-radius: 10px;
  background: #101a2c;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.66);
}

.subtitle-language-field.is-open {
  z-index: 40;
}

.subtitle-language-picker-search {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.subtitle-language-picker-search i {
  color: #94a3b8;
  font-size: 1rem;
  pointer-events: none;
}

.subtitle-language-picker-search input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 11px;
  border: 2px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  font: inherit;
  font-size: 16px;
  outline: 0;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.subtitle-language-picker-search input:focus {
  border-color: #60a5fa;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.16);
}

.subtitle-language-picker-search input::placeholder {
  color: #94a3b8;
}

.subtitle-language-picker-options {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 3px;
  padding: 0;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  list-style: none;
  scrollbar-color: rgba(255, 255, 255, 0.24) rgba(255, 255, 255, 0.05);
  scrollbar-width: thin;
}

.subtitle-language-picker-option {
  width: fit-content;
  max-width: 100%;
  padding: 10px 13px;
  border-radius: 7px;
  color: #e2e8f0;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.subtitle-language-picker-option[hidden] {
  display: none;
}

.subtitle-language-picker-option:hover,
.subtitle-language-picker-option:focus,
.subtitle-language-picker-option.selected,
.subtitle-language-picker-option.kbd-highlight {
  background: rgba(96, 165, 250, 0.16);
  color: #bfdbfe;
  outline: 0;
}

.subtitle-language-picker-option:focus {
  box-shadow: inset 0 0 0 2px rgba(96, 165, 250, 0.42);
}

@media (max-width: 680px) {
  .subtitle-language-picker-panel {
    max-height: min(350px, 55vh);
  }
}
