/* Filter Bar - Pill-based selection design */
/* Professional policy theme: navy/cream, mobile-friendly */

.filter-bar {
  padding: 0;
  background: transparent;
  border: none;
  margin-bottom: 0;
}

.filter-bar--light {
  background: transparent;
}

.filter-bar--dark {
  background: transparent;
}

.filter-bar__search {
  width: 100%;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
  border: 1px solid #dce3eb;
  border-radius: 6px;
  background: #fff;
  color: #2d3748;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-bar--dark .filter-bar__search {
  background: #162a46;
  border-color: #2d3748;
  color: #e2e8f0;
}

.filter-bar__search::placeholder {
  color: #94a3b8;
}

.filter-bar__search:focus {
  outline: none;
  border-color: #1b365d;
  box-shadow: 0 0 0 3px rgba(27, 54, 93, 0.12);
}

/* Select dropdown */
.filter-bar__select {
  width: 100%;
  padding: 5px 26px 5px 8px;
  font-size: 0.75rem;
  font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
  border: 1px solid #dce3eb;
  border-radius: 4px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") no-repeat right 7px center / 11px;
  color: #2d3748;
  appearance: none;
  cursor: pointer;
  line-height: 1.4;
}

.filter-bar__select:focus {
  outline: none;
  border-color: #1b365d;
  box-shadow: 0 0 0 2px rgba(27,54,93,0.1);
}

.filter-bar--dark .filter-bar__select {
  background-color: #162a46;
  border-color: #2d4a6e;
  color: #e2e8f0;
}

/* Pill groups */
.filter-bar__pill-group {
  margin-top: 6px;
}

.filter-bar__pill-label {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #8899a8;
  margin-bottom: 3px;
  padding-left: 1px;
}

.filter-bar__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* Individual pills */
.filter-bar__pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  min-height: 28px;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid #dce3eb;
  background: #fff;
  color: #4a5568;
  user-select: none;
  transition: all 0.15s ease;
  white-space: nowrap;
  line-height: 1.2;
}

.filter-bar__pill:hover {
  border-color: #1b365d;
  color: #1b365d;
  background: #f8fafc;
}

.filter-bar__pill--active {
  border-color: #1b365d;
  background: #1b365d;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.filter-bar__pill--active:hover {
  background: #264a7a;
  border-color: #264a7a;
  color: #fff;
}

/* Confidence-level pill colors when active */
.filter-bar__pill--conf-high.filter-bar__pill--active {
  background: #991b1b;
  border-color: #991b1b;
}

.filter-bar__pill--conf-high.filter-bar__pill--active:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.filter-bar__pill--conf-medium.filter-bar__pill--active {
  background: #92400e;
  border-color: #92400e;
}

.filter-bar__pill--conf-medium.filter-bar__pill--active:hover {
  background: #b45309;
  border-color: #b45309;
}

.filter-bar__pill--conf-low.filter-bar__pill--active {
  background: #475569;
  border-color: #475569;
}

.filter-bar__pill--conf-low.filter-bar__pill--active:hover {
  background: #64748b;
  border-color: #64748b;
}

/* "All" clear button */
.filter-bar__pill-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  min-height: 28px;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
  cursor: pointer;
  border-radius: 4px;
  border: 1px dashed #cbd5e0;
  background: transparent;
  color: #64748b;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.filter-bar__pill-clear:hover {
  border-color: #1b365d;
  color: #1b365d;
  background: #f0f4f8;
  border-style: solid;
}

.filter-bar__pill-clear--dim {
  opacity: 0.5;
}

.filter-bar__pill-clear--dim:hover {
  opacity: 1;
}

/* Dark theme pills */
.filter-bar--dark .filter-bar__pill {
  background: #162a46;
  border-color: #2d4a6e;
  color: #b0c4de;
}

.filter-bar--dark .filter-bar__pill:hover {
  background: #1e3a5f;
  border-color: #4a7ab5;
  color: #e2e8f0;
}

.filter-bar--dark .filter-bar__pill--active {
  background: #3b82c4;
  border-color: #3b82c4;
  color: #fff;
}

.filter-bar--dark .filter-bar__pill-clear {
  border-color: #2d4a6e;
  color: #7b93ad;
}

.filter-bar--dark .filter-bar__pill-label {
  color: #7b93ad;
}

/* Collapsible header on mobile */
.filter-bar__header {
  display: none;
  width: 100%;
  padding: 10px 14px;
  min-height: 40px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
  cursor: pointer;
  background: #f0f4f8;
  border: 1px solid #dce3eb;
  border-radius: 6px;
  color: #1b365d;
  align-items: center;
  justify-content: space-between;
}

.filter-bar--dark .filter-bar__header {
  background: #162a46;
  border-color: #2d4a6e;
  color: #b0c4de;
}

.filter-bar__header::after {
  content: "\25BC";
  font-size: 0.65em;
  opacity: 0.6;
  transition: transform 0.2s;
}

.filter-bar__header[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.filter-bar__body {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px;
}

/* Mobile responsive */
@media (max-width: 767px) {
  .filter-bar__header {
    display: flex;
    margin-bottom: 8px;
  }

  .filter-bar__body {
    display: none;
    padding: 4px 0 8px;
  }

  .filter-bar__body.is-open {
    display: flex;
  }

  .filter-bar__search {
    width: 100%;
    min-width: 0;
  }

  .filter-bar__pill {
    padding: 8px 14px;
    min-height: 40px;
    font-size: 0.875rem;
  }

  .filter-bar__pill-clear {
    padding: 8px 12px;
    min-height: 40px;
  }
}

@media (max-width: 480px) {
  .filter-bar__pills {
    gap: 5px;
  }

  .filter-bar__pill {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
  }
}
