/* ===== Collapsible Filters ===== */
.filters-panel {
  margin-bottom: var(--gap-xx-small);
  border-radius: 0.75rem;
  background: rgba(245, 246, 248, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow:
    0 1px 6px rgba(0, 0, 0, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.04);
}

.filters-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  color: #4a4a4a;
  font-weight: 600;
}

.filters-summary::-webkit-details-marker {
  display: none;
}

.filters-summary::after {
  content: "";
  border: solid #6b6b6b;
  border-width: 0 2px 2px 0;
  display: inline-block;
  padding: 4px;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.filters-panel[open] .filters-summary::after {
  transform: rotate(-135deg);
}

.filters-summary-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
}

.filters-summary-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.filters-summary-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.button-reset-inline {
  padding: 0.25rem 0.6rem;
  font-size: 0.9rem;
  background: transparent;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.button-reset-inline i {
  font-size: 0.85rem;
}

.filters-summary-title i {
  color: #6b6b6b;
  font-size: 1rem;
}

/* ===== Filter Container ===== */
.app-filters {
  padding: 0.5rem 0.75rem 0.75rem;
}

.active-filters-count {
  display: inline-block;
  background: rgba(0, 0, 0, 0.06);
  color: #4a4a4a;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: 1rem;
}

.filter-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}

.button-apply {
  padding: 0.45rem 0.85rem;
  background: var(--core-primary);
  color: white;
  border-radius: 0.5rem;
  border: 1px solid rgba(0,0,0,0.06);
  font-weight: 600;
  cursor: pointer;
}

.button-apply:hover {
  filter: brightness(0.98);
}

/* On wide screens place the Apply button inline with the filter controls */
@media screen and (min-width: 992px) {
  .app-filters {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .filter-selections {
    flex: 1 1 auto;
    margin-bottom: 0;
  }

  .filter-actions {
    margin-left: 0;
    order: 2;
    margin-bottom: 0;
  }

  .filter-actions .button-apply {
    white-space: nowrap;
  }
}

.button-reset {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: white;
  border: 1px solid rgba(220, 53, 69, 0.3);
  color: #c02f3c;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.button-reset:hover {
  background: #fbeaec;
  color: #c02f3c;
  border-color: #e6a9b0;
  box-shadow: 0 2px 6px rgba(220, 53, 69, 0.25);
}

.button-reset i {
  font-size: 1rem;
}

/* ===== Filter Groups ===== */
.filter-selections {
  display: grid;
  gap: 0.5rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.filter-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #5a5a5a;
  margin: 0;
}

.filter-label i {
  font-size: 0.85rem;
  color: #7a7a7a;
  width: 1.125rem;
}

/* ===== SlimSelect Customization ===== */
.ss-main.card-tag.ss-open-below {
  border-radius: 0.5rem 0.5rem 0 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.ss-main {
  background: #fdfdfd;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 0.5rem;
  color: #4a4a4a;
  min-height: 2.25rem;
}

.ss-main.primary-tag {
  background: rgba(67, 160, 173, 0.06);
  border-color: rgba(67, 160, 173, 0.25);
}

.ss-main.secondary-tag {
  background: rgba(98, 66, 106, 0.06);
  border-color: rgba(98, 66, 106, 0.25);
}

.ss-main.tertiary-tag {
  background: rgba(58, 128, 98, 0.06);
  border-color: rgba(58, 128, 98, 0.25);
}

.ss-main:not(.ss-disabled) {
  cursor: pointer;
}

.ss-main.ss-disabled {
  cursor: not-allowed;
  opacity: 0.5;
  filter: grayscale(50%);
}

.primary-tag ~ .ss-main.ss-disabled {
  background-color: var(--primary-light) !important;
}

.secondary-tag ~ .ss-main.ss-disabled {
  background-color: var(--plum) !important;
}

.tertiary-tag ~ .ss-main.ss-disabled {
  background-color: var(--mint) !important;
}

.app-filters .selection-wrapper {
  display: flex;
  flex-direction: column;
  position: relative;
}

.app-filters .selection-wrapper .select-field[multiple] {
  /* keep the fallback compact (same height as single selects) so it doesn't render as a large list
     SlimSelect will replace this with the tokenized dropdown when available */
  height: 2.25rem;
  min-height: 2.25rem;
  overflow: hidden;
}

.slimselect-ready .app-filters .selection-wrapper .select-field[multiple] {
  height: 2.25rem;
  min-height: 2.25rem;
  overflow: hidden;
}

.multiselect-wrapper {
  display: flex;
}

.ss-placeholder,
.ss-option {
  color: #4a4a4a !important;
  font-size: 0.9rem !important;
  background-color: white !important;
}

.app-filters .selection-wrapper .select-field {
  color: #4a4a4a;
  padding: 0.35rem 0.6rem;
  border-radius: 0.45rem;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.app-filters .selection-wrapper .select-field:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* transparent border to avoid layout shift */
.ss-option {
  border: 1px solid transparent;
  margin: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  padding: 0.45rem 0.7rem !important;
  transition: background-color 0.15s ease;
}

.ss-option:hover {
  background: rgba(0, 0, 0, 0.05) !important;
}

.ss-option.ss-selected:not(:hover) {
  background: rgba(0, 0, 0, 0.08) !important;
  font-weight: 500;
}

/* due to contrast issues w secondary tag */
.secondary-tag .ss-option.ss-selected:not(:hover) {
  background: rgba(0, 0, 0, 0.08) !important;
}

/* due to contrast issues w secondary tag */
.primary-tag .ss-option.ss-selected:not(:hover) {
  background: rgba(0, 0, 0, 0.08) !important;
}

.ss-value,
.ss-value-text,
.ss-max {
  font-size: 0.9375rem !important;
}

.ss-value,
.ss-max {
  background-color: rgba(0, 0, 0, 0.06) !important;
  padding: 0.2rem 0.55rem !important;
  border-radius: 0.375rem !important;
  margin: 0.25rem !important;
  font-weight: 500 !important;
}

.ss-content {
  border-radius: 0 0 0.5rem 0.5rem !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
  padding: 0.5rem 0 !important;
  max-height: 320px !important;
  background: white !important;
}

.ss-main .ss-deselect svg path,
.ss-main .ss-arrow path {
  stroke: #666 !important;
}

/* no deselect on single select fields */
.selection-wrapper > select ~ div .ss-deselect {
  display: none;
}

select[multiple]:focus option:checked {
  background: rgba(0, 0, 0, 0.2);
}

/* utility classes for responsiveness */
@media screen and (min-width: 992px) {
  .filter-selections {
    grid-template-columns: 2fr 1fr 1fr;
    gap: 0.75rem;
  }
}

@media screen and (max-width: 991px) {
  .filter-selections {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .filter-actions {
    justify-content: flex-start;
  }
}

@media screen and (max-width: 576px) {
  .app-filters {
    padding: 0.5rem 0.75rem 0.75rem;
  }
}

/* ===== Search Input Styling ===== */
.ss-search input {
  padding: 0.4rem 0.75rem !important;
  border: 1px solid rgba(0, 0, 0, 0.18) !important;
  border-radius: 0.5rem !important;
  background: white !important;
  color: #4a4a4a !important;
  font-size: 0.9rem !important;
  margin: 0.5rem !important;
}

.ss-search input::placeholder {
  color: rgba(0, 0, 0, 0.45) !important;
}

.ss-search input:focus {
  border-color: rgba(0, 0, 0, 0.3) !important;
  outline: none !important;
}
