/**
 * Character list / tier list filter bar (`.characterfilter` + `#filterSystem`).
 * Used by CharacterList.astro and shared list UIs. Depends on `public/css/base.css` tokens.
 */

/* ── Filter bar (replaces .employees-filter-bar.lost) ── */
.characterfilter {
  border-radius: var(--ty-radius, 2px);
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 24px;
}

.filter-bar-element {
  display: flex;
  align-items: center;
}

.filter-bar-element.search {
  position: relative;
  margin-right: 4px;
}

.filter-bar-element.search input.form-control {
  background-color: var(--ty-ink-2);
  border: 1px solid var(--ty-stroke);
  border-radius: 2px;
  padding: 0 30px 0 10px;
  font-size: 0.9rem;
  height: 38px;
  width: 200px;
  transition: border-color 150ms ease-out;
  box-sizing: border-box;
  line-height: 38px;
  color: var(--ty-text);
}

.filter-bar-element.search input.form-control:focus {
  outline: none;
  border-color: var(--ty-accent-solid);
}

.filter-bar-element.search .clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  display: none;
  user-select: none;
}

.filter-bar-element.search input:not(:placeholder-shown) + .clear {
  display: block;
}

.btn-group {
  display: inline-flex;
  flex-wrap: wrap;
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid var(--ty-stroke);
}

.characterfilter .btn,
#filterSystem .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--uibluegray);
  border: none;
  padding: 0 16px;
  height: 38px;
  min-width: 38px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  margin: 0;
  border-radius: 0;
}

#filterSystem .rarity-filter-btn,
#filterSystem .category-filter-btn,
#filterSystem .region-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background-color: var(--uibluegray) !important;
  border: none !important;
  border-right: 1px solid #32323e !important;
  padding: 0 16px !important;
  height: 38px !important;
  min-width: 38px !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  text-decoration: none !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

.characterfilter .btn:first-child,
#filterSystem .btn:first-child,
#filterSystem .rarity-filter-btn:first-child,
#filterSystem .category-filter-btn:first-child,
#filterSystem .region-btn:first-child {
  border-top-left-radius: 2px !important;
  border-bottom-left-radius: 2px !important;
}

.characterfilter .btn:last-child,
#filterSystem .btn:last-child,
#filterSystem .rarity-filter-btn:last-child,
#filterSystem .category-filter-btn:last-child,
#filterSystem .region-btn:last-child {
  border-right: none !important;
  border-top-right-radius: 2px !important;
  border-bottom-right-radius: 2px !important;
}

.characterfilter .btn:hover,
#filterSystem .btn:hover,
#filterSystem .rarity-filter-btn:hover,
#filterSystem .category-filter-btn:hover,
#filterSystem .region-btn:hover {
  background-color: var(--uibluegray) !important;
  color: #fff !important;
}

.characterfilter .btn.active,
#filterSystem .btn.active,
#filterSystem .rarity-filter-btn.active,
#filterSystem .category-filter-btn.active,
#filterSystem .region-btn.active {
  background-color: var(--ty-accent) !important;
  color: #fff !important;
  box-shadow: none !important;
  border-color: var(--ty-accent-solid) !important;
}

/* Rarity / Klasse / Element: aktiv = nur untere Kante farbig (currentColor), kein Hintergrund-Fill, keine anderen Ränder */
.characterfilter .btn.btn-secondary.rarity-filter.active,
.characterfilter .btn.btn-secondary.class-filter.active,
.characterfilter .btn.btn-secondary.element-filter.active,
#filterSystem .btn.btn-secondary.rarity-filter.active,
#filterSystem .btn.btn-secondary.class-filter.active,
#filterSystem .btn.btn-secondary.element-filter.active {
  background-color: var(--uibluegray) !important;
  box-shadow: none !important;
  border: none !important;
  border-bottom: 2px solid currentColor !important;
  color: var(--ty-text) !important;
}

.characterfilter .btn.btn-secondary.rarity-filter.active:hover,
.characterfilter .btn.btn-secondary.class-filter.active:hover,
.characterfilter .btn.btn-secondary.element-filter.active:hover,
#filterSystem .btn.btn-secondary.rarity-filter.active:hover,
#filterSystem .btn.btn-secondary.class-filter.active:hover,
#filterSystem .btn.btn-secondary.element-filter.active:hover {
  background-color: var(--uibluegray) !important;
  box-shadow: none !important;
  border: none !important;
  border-bottom: 2px solid currentColor !important;
  color: var(--ty-text) !important;
}

.characterfilter .btn svg,
#filterSystem .btn svg {
  fill: currentColor;
}

.characterfilter .reset-button,
#filterSystem .reset-button,
#filterSystem .reset-all-btn {
  background-color: var(--uibluegray) !important;
  border: 1px solid #32323e !important;
  border-radius: 4px !important;
  padding: 0 16px !important;
  height: 38px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  font-size: 0.9rem !important;
  margin-left: 0 !important;
}

.characterfilter .reset-button:not([disabled]):hover,
#filterSystem .reset-button:not([disabled]):hover,
#filterSystem .reset-all-btn:not([disabled]):hover {
  background-color: var(--ty-accent) !important;
  border-color: var(--ty-accent) !important;
  color: white !important;
}

.characterfilter .reset-button[disabled],
#filterSystem .reset-button[disabled],
#filterSystem .reset-all-btn[disabled] {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
}

.characterfilter .btn img,
#filterSystem .btn img,
#filterSystem .category-filter-btn img {
  width: 22px !important;
  height: 22px !important;
  object-fit: contain !important;
  transition: filter 0.2s !important;
  display: block !important;
  margin: 0 !important;
}

.characterfilter .btn-group .btn,
#filterSystem .btn-group .btn {
  flex: 1;
  min-width: 38px;
}

select.form-control,
#filterSystem .school-dropdown {
  background-color: var(--uibluegray) !important;
  border: 1px solid #32323e !important;
  height: 38px !important;
  border-radius: 4px !important;
  padding: 0 10px !important;
  cursor: pointer !important;
  min-width: 120px !important;
}

select.form-control:focus,
#filterSystem .school-dropdown:focus {
  outline: none !important;
  border-color: var(--ty-accent-solid) !important;
}

@media (max-width: 1080px) {
  .characterfilter {
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
  }

  .filter-bar-element {
    width: 100%;
    justify-content: flex-start;
    margin-bottom: 8px;
  }

  .filter-bar-element:last-child {
    margin-bottom: 0;
  }

  .filter-bar-element.search input.form-control {
    width: 100%;
  }

  .filter-bar-element.search {
    margin-right: 0;
  }

  .btn-group {
    width: 100%;
    display: flex;
  }

  .characterfilter .btn,
  #filterSystem .btn,
  #filterSystem .rarity-filter-btn,
  #filterSystem .category-filter-btn,
  #filterSystem .region-btn {
    flex: 1;
    padding: 0 4px !important;
    font-size: 0.85rem !important;
  }

  .characterfilter .reset-button,
  #filterSystem .reset-button,
  #filterSystem .reset-all-btn {
    width: 100% !important;
    justify-content: center !important;
  }
}

@media (min-width: 1081px) {
  .characterfilter {
    padding: 10px 15px;
    gap: 15px;
    margin-bottom: 29px;
    justify-content: flex-start;
  }

  .filter-bar-element.search input.form-control {
    font-size: 1.2rem;
    height: 51px;
    width: 266px;
    padding: 0 40px 0 13px;
    line-height: 51px;
  }

  .filter-bar-element.search .clear {
    font-size: 1.7rem;
    right: 13px;
  }

  .characterfilter .btn,
  #filterSystem .btn,
  #filterSystem .rarity-filter-btn,
  #filterSystem .category-filter-btn,
  #filterSystem .region-btn {
    padding: 0 19px;
    height: 46px;
    min-width: 46px;
    font-size: 1.1rem;
  }

  .characterfilter .btn-group .btn,
  #filterSystem .btn-group .btn {
    min-width: 46px;
  }

  .characterfilter .reset-button,
  #filterSystem .reset-button,
  #filterSystem .reset-all-btn {
    padding: 0 19px;
    height: 46px;
    font-size: 1.1rem;
    gap: 7px;
  }

  .characterfilter .btn img,
  #filterSystem .btn img,
  #filterSystem .category-filter-btn img {
    width: 26px !important;
    height: 26px !important;
  }

  select.form-control,
  .characterfilter .school-dropdown,
  #filterSystem .school-dropdown {
    height: 46px;
    padding: 0 12px;
    min-width: 145px;
    font-size: 1.1rem;
  }
}
