/* Filter bar layout — supplements Pico CSS defaults. */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.filter-presets {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.preset-btn {
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--primary);
  border-radius: 2rem;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.875rem;
}

.preset-btn.preset-active {
  background: var(--primary);
  color: #fff;
}

.preset-btn.preset-clear {
  border-color: var(--border);
  color: var(--text-muted);
}

.filter-search {
  flex: 1;
  min-width: 12rem;
}

.filter-search input {
  margin-bottom: 0;
}

.filter-panel {
  margin-bottom: 1rem;
}

.filter-panel summary {
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.filter-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.filter-field label {
  font-size: 0.8rem;
  margin-bottom: 0.125rem;
}

.filter-field input[type="text"],
.filter-field input[type="search"],
.filter-field input[type="number"],
.filter-field input[type="date"] {
  margin-bottom: 0;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

.daterange-inputs,
.numrange-inputs {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.daterange-inputs span,
.numrange-inputs span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.multiselect-dropdown {
  position: relative;
}

.multiselect-dropdown summary {
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  cursor: pointer;
  list-style: none;
}

.multiselect-options {
  position: absolute;
  z-index: 10;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.25rem;
  min-width: 100%;
}

.multiselect-options label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.25rem;
  cursor: pointer;
  white-space: nowrap;
}

.multiselect-options input[type="checkbox"] {
  margin: 0;
}

/* Compact button sizes — replaces scattered inline styles */
.btn-sm {
  padding: 0.25em 0.5em;
  font-size: 0.85em;
}

.btn-xs {
  padding: 0.15em 0.4em;
  font-size: 0.75em;
}

/* Inline form — for side-by-side buttons in table cells */
.inline-form {
  display: inline;
  margin: 0;
}

/* Inline icons */
.icon-inline {
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  display: inline-block;
}
.icon-inline svg {
  width: 100%;
  height: 100%;
}

/* Service badge colors */
:root {
  --color-spotify: #1DB954;
  --color-lastfm: #D51007;
  --color-listenbrainz: #E66000;
  --color-github: #24292f;
}

[data-theme="dark"] {
  --color-github: #c9d1d9;
}

.service-badge {
  text-decoration: none;
  font-size: 0.75em;
  font-weight: bold;
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
}

.service-badge-spotify  { background: var(--color-spotify); }
.service-badge-lastfm   { background: var(--color-lastfm); }
.service-badge-lb       { background: var(--color-listenbrainz); }

/* Truncation utility — click to expand/collapse long values in list views */
.truncate {
  max-width: 30ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: bottom;
  cursor: pointer;
}

.truncate.expanded {
  max-width: none;
  white-space: normal;
  word-break: break-word;
}

/* Muted text and row states */
.text-muted {
  color: var(--text-muted);
}

.row-accepted {
  opacity: 0.5;
}

.row-rejected {
  opacity: 0.3;
  text-decoration: line-through;
}
