/* Поиск */
.toolbar .search-input {
  --search-input-bg: transparent;
  --search-input-text-color: #edf2fb;
  --search-input-border-color: rgba(255, 255, 255, 0.15);
  --search-input-autofill-bg: #14191f;
  width: 100%;
  height: 32px;
  background: var(--search-input-bg);
  color: var(--search-input-text-color);
  border: 1px solid var(--search-input-border-color);
  border-radius: 8px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14.5px;
  font-weight: 300;
  letter-spacing: 0.4px;
  text-shadow: none !important;
  filter: none !important;
  opacity: 1 !important;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.toolbar .search-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  opacity: 1;
}

.toolbar .search-input:focus,
.toolbar .search-input:active {
  background: var(--search-input-bg);
  color: var(--search-input-text-color);
  border-color: var(--search-input-border-color);
  outline: none;
  -webkit-text-fill-color: var(--search-input-text-color);
}

.toolbar .search-input:-webkit-autofill,
.toolbar .search-input:-webkit-autofill:hover,
.toolbar .search-input:-webkit-autofill:focus,
.toolbar .search-input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--search-input-text-color);
  -webkit-box-shadow: 0 0 0 1000px var(--search-input-autofill-bg) inset;
  box-shadow: 0 0 0 1000px var(--search-input-autofill-bg) inset;
  transition: background-color 9999s ease-out 0s;
}

/* Выбор года */
.year-filter {
  position: relative;
}

.year-trigger {
  position: relative;
  height: 32px;
  padding: 0 28px 0 12px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14.5px;
  font-weight: 300;
  letter-spacing: 0.4px;
  text-shadow: none !important;
  filter: none !important;
  opacity: 1 !important;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  box-sizing: border-box;
  cursor: pointer;
  white-space: nowrap;
}

.year-trigger::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 0;
  height: 0;
  transform: translateY(-35%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
  opacity: 0.7;
  pointer-events: none;
}

.year-trigger:hover::after,
.year-filter.is-open .year-trigger::after {
  opacity: 1;
}

.year-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  min-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  overflow-x: hidden;
  z-index: 2000;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: transparent;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  padding: 8px 12px;
}

.year-dropdown-list {
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.year-dropdown-list::-webkit-scrollbar {
  width: 8px;
}

.year-dropdown-list::-webkit-scrollbar-track {
  background: transparent;
}

.year-dropdown-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

.year-option {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
}

.year-option--all,
.year-option.is-all {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  border-radius: 8px;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  min-height: 36px;
  padding: 0 8px;
  margin-bottom: 8px;
}

.year-option:hover {
  background: rgba(255, 255, 255, 0.08);
}

.year-option.is-all:hover {
  background: rgba(255, 255, 255, 0.08);
}

.year-option.is-active {
  justify-content: center;
  text-align: center;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.year-option.is-all.is-active {
  background: transparent;
}

.year-option--all:hover,
.year-option.is-all:hover,
.year-option--all.is-active:hover,
.year-option.is-all.is-active:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Будущие блоки фильтров */
.filter-ru,
.filter-russian,
.filter-en,
.filter-english,
.filter-subcategories,
.filter-subcategory {
  background: transparent;
  border: 1px solid #3a4552;
  border-radius: 8px;
  padding: 8px 10px;
  color: #d6deea;
}

/* Точечное выравнивание поиска с алфавитом */
.toolbar .search-box {
  padding-left: 0;
  flex: 1 1 0;
  min-width: 0;
}

/* Единая группа фильтров рядом с поиском */
.toolbar {
  width: var(--catalog-content-width, var(--content-grid-width, var(--content-track-width, calc(100% - 245px))));
  max-width: var(--catalog-content-width, var(--content-grid-width, var(--content-track-width, calc(100% - 245px))));
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
  justify-self: start;
  position: relative;
}

/* TEMP: filter UI disabled only, render pipeline untouched */
.filters-ui-disabled > .legacy-filter-ui {
  visibility: hidden;
  pointer-events: none;
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.filters-ui-disabled .legacy-filter-ui .year-dropdown {
  display: none !important;
}

.filter-ui-shell {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.filter-ui-nav-controls {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  flex: 0 0 138px;
  min-width: 0;
}

.nav-control {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 2px;
  cursor: pointer;
  transition: color 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  font-weight: 300;
  letter-spacing: 0.2px;
}

.nav-control:not(.nav-reset) {
  font-size: 35px;
  line-height: 1;
  transform: translateY(-3px);
}

.nav-reset {
  padding: 0 4px;
  font-size: 16px;
  font-weight: 200;
  letter-spacing: normal;
  color: rgba(240, 240, 240, 0.78);
  line-height: 1;
  transform: translateY(-1.5px);
}

.nav-control:hover {
  color: #ffffff;
  transform: translateY(-1px);
}

.nav-control:disabled {
  opacity: 0.3;
  pointer-events: none;
}

.filter-ui-search-box {
  padding-left: 0;
  flex: 1 1 0;
  max-width: calc(100% - 120px);
  min-width: 0;
}

.filter-ui-search-input {
  width: 100%;
}

.filter-ui-type-btn {
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
}

/* Player visibility button near media filters; not a media type filter */
.player-toggle-btn {
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
}

.filter-ui-type-btn.dimmed {
  opacity: 0.45 !important;
}

.filter-ui-shell .btn-video.active,
.filter-ui-shell .btn-audio.active,
.filter-ui-shell .btn-text.active,
.filter-ui-shell .btn-photo.active,
.filter-ui-shell .btn-files.active,
.filter-ui-shell .player-toggle-btn.active {
  border-color: #4a5664;
  background: #1d2630;
  color: #ffffff;
}

/* Видео / Аудио / Текст: отдельные селекторы */
.toolbar .btn-video,
.toolbar .btn-audio,
.toolbar .btn-text,
.toolbar .btn-photo,
.toolbar .btn-files,
.toolbar .player-toggle-btn {
  height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14.5px;
  font-weight: 300;
  letter-spacing: 0.4px;
  text-shadow: none !important;
  filter: none !important;
  opacity: 1 !important;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  flex: 0 0 auto;
}

.year-trigger-label {
  color: rgba(255, 255, 255, 0.6);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14.5px;
  font-weight: 300;
  letter-spacing: 0.4px;
  text-shadow: none !important;
  filter: none !important;
  opacity: 1 !important;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.toolbar .search-input:hover,
.toolbar .btn-video:hover,
.toolbar .btn-audio:hover,
.toolbar .btn-text:hover,
.toolbar .btn-photo:hover,
.toolbar .btn-files:hover,
.toolbar .player-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Все годы: отдельный селектор */
.toolbar > .btn-year {
  background: transparent;
  color: #edf2fb;
  border-radius: 10px;
  min-height: 32px;
  padding: 0;
  box-sizing: border-box;
  flex: 0 0 auto;
  min-width: 0;
}

.toolbar .year-trigger {
  width: 100%;
}

.toolbar .btn-video:hover,
.toolbar .btn-audio:hover,
.toolbar .btn-text:hover,
.toolbar .btn-photo:hover,
.toolbar .btn-files:hover,
.toolbar .player-toggle-btn:hover,
.toolbar .btn-year:hover,
.toolbar .year-trigger:hover {
  border-color: #4a5664;
}

.toolbar .year-trigger:hover {
  background: rgba(255, 255, 255, 0.05);
}











.toolbar .btn-video.active,
.toolbar .btn-audio.active,
.toolbar .btn-text.active,
.toolbar .btn-photo.active,
.toolbar .btn-files.active,
.toolbar .player-toggle-btn.active {
  border-color: #4a5664;
  background: #1d2630;
  color: #ffffff;
}

@media (max-width: 999px) {
  .toolbar {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 6px;
  }

  .toolbar .search-box {
    order: 1;
    flex: 1 1 100%;
    min-width: 0;
  }

  .filter-ui-shell {
    width: 100%;
    flex-wrap: nowrap;
    align-items: center;
  }

  .filter-ui-nav-controls {
    order: 1;
    flex: 0 0 138px;
  }

  .filter-ui-search-box {
    order: 2;
    flex: 1 1 110px;
    min-width: 110px;
  }

  .toolbar .btn-video,
  .toolbar .btn-audio,
  .toolbar .btn-text,
  .toolbar .btn-photo,
  .toolbar .btn-files {
    order: 2;
    flex: 1 1 calc(20% - 5px);
    min-width: 0;
  }

  .filter-ui-shell .btn-video,
  .filter-ui-shell .btn-audio,
  .filter-ui-shell .btn-text,
  .filter-ui-shell .btn-photo,
  .filter-ui-shell .btn-files,
  .filter-ui-shell .player-toggle-btn {
    order: 3;
    flex: 0 0 auto;
    min-width: 0;
  }

  .toolbar .btn-year,
  .year-trigger,
  .year-trigger-label {
    order: 3;
    flex: 1 1 100%;
    min-width: 0;
  }
}

@media (min-width: 1000px) and (max-width: 1400px) {
  .toolbar {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
  }

  .toolbar .search-box {
    order: 1;
    flex: 1 1 180px;
    min-width: 120px;
  }

  .filter-ui-shell {
    width: 100%;
    flex-wrap: nowrap;
    align-items: center;
  }

  .filter-ui-nav-controls {
    order: 1;
    flex: 0 0 138px;
  }

  .filter-ui-search-box {
    order: 2;
    flex: 1 1 120px;
    min-width: 120px;
  }

  .toolbar .btn-video,
  .toolbar .btn-audio,
  .toolbar .btn-text,
  .toolbar .btn-photo,
  .toolbar .btn-files {
    order: 2;
    flex: 0 1 auto;
    min-width: 58px;
  }

  .filter-ui-shell .btn-video,
  .filter-ui-shell .btn-audio,
  .filter-ui-shell .btn-text,
  .filter-ui-shell .btn-photo,
  .filter-ui-shell .btn-files,
  .filter-ui-shell .player-toggle-btn {
    order: 3;
    flex: 0 0 auto;
    min-width: 0;
  }

  .toolbar .btn-year,
  .year-trigger,
  .year-trigger-label {
    order: 3;
    flex: 0 1 120px;
    min-width: 100px;
  }
}
