/* ===================================================
   Shared filter / search bar styles
   Used on: artists.html, releases.html, news-all.html
   =================================================== */

/* --- Filter container --- */
.filters {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1.2rem;
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  box-shadow: var(--card-shadow);
  animation: riseIn 0.6s ease both;
  position: relative;
  z-index: 40;
}

/* --- Filter field wrapper --- */
.filter-field {
  position: relative;
  flex: 1 1 260px;
  min-width: 220px;
}

/* --- Icon inside field --- */
.filter-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.filter-icon svg {
  width: 100%;
  height: 100%;
}

/* --- Input & Select --- */
.filter-input,
.filter-select {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.6rem;
  background: rgba(10, 10, 10, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--btn-radius);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
}

.filter-input:focus,
.filter-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 176, 185, 0.15);
}

.filter-select option {
  background: var(--bg-dark);
  color: var(--text);
}

/* --- Clear button (releases) --- */
.filter-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  opacity: 0;
  pointer-events: none;
}

.filter-clear:hover {
  color: var(--primary);
  background: rgba(0, 176, 185, 0.2);
}

.filter-clear.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* --- Artist autocomplete suggest (releases) --- */
.artist-suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: rgba(12, 12, 12, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
  padding: 6px;
  display: none;
  z-index: 1200;
  max-height: 280px;
  overflow-y: auto;
}

.artist-suggest.show {
  display: block;
}

.artist-suggest-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text);
}

.artist-suggest-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--primary);
}

.artist-suggest-item img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
}

.artist-suggest-empty {
  padding: 10px 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* --- Toggle switch (releases) --- */
.filter-toggle {
  flex: 0 0 auto;
}

.filter-toggle-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: relative;
}

.filter-toggle-label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.filter-toggle-track {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  transition: background 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.filter-toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  transition: transform 0.2s ease, background 0.2s ease;
}

.filter-toggle-label input:checked + .filter-toggle-track {
  background: rgba(0, 176, 185, 0.35);
  border-color: rgba(0, 176, 185, 0.6);
}

.filter-toggle-label input:checked + .filter-toggle-track::after {
  transform: translateX(20px);
  background: var(--primary-light);
}

.filter-toggle-text {
  font-weight: 600;
  color: var(--text);
}

/* --- Sort / category action buttons (news) --- */
.filter-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.75rem 1.2rem;
  background: var(--bg-dark);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--btn-radius);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--btn-shadow);
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--btn-shadow-hover);
}

.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--bg-dark);
  box-shadow: var(--btn-shadow-hover);
}

/* --- Mood pills (releases) --- */
.mood-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  animation: riseIn 0.5s ease 0.1s both;
}

.mood-pill {
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text, #fff);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.mood-pill:hover {
  border-color: var(--primary, #00B0B9);
  background: rgba(0, 176, 185, 0.1);
  color: var(--primary-light, #00ffff);
}

.mood-pill.active {
  background: var(--primary, #00B0B9);
  border-color: var(--primary, #00B0B9);
  color: var(--bg-dark, #0a0a0a);
}

/* ===================================================
   Mobile — fix vertical stretching
   =================================================== */
@media (max-width: 768px) {
  .filters {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-field {
    /* CRITICAL: prevent flex-grow in column direction = no vertical stretching */
    flex: 0 0 auto;
    min-width: 0;
    width: 100%;
  }

  .filter-field.filter-wide {
    width: 100%;
  }

  .filter-toggle-group {
    width: 100%;
  }

  .filter-toggle-label {
    width: 100%;
    justify-content: space-between;
  }

  .filter-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .filter-btn {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .filter-actions {
    grid-template-columns: 1fr;
  }
}
