/* Unified Filter Bar styles */

.filter-bar {
  display: none;
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  background-color: var(--surface);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
  position: relative;
}

.filter-bar.active {
  display: flex !important; /* Force display */
}

.filters-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
}

.filter-label {
  color: var(--muted);
  font-size: 0.875rem;
  white-space: nowrap;
  min-width: 150px; /* Increased to accommodate longer labels */
}

.filter-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex-grow: 1;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.875rem;
}

.filter-item .remove-filter {
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  margin-left: 0.25rem;
}

.clear-all-button {
  padding: 0.25rem 0.75rem;
  background-color: var(--background);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  position: absolute;
  top: 0.75rem;
  right: 1rem;
}

.clear-all-button:hover {
  background-color: var(--surface-hover);
  color: var(--text);
}

/* Included tags and sources styles */
.included-tag {
  background-color: rgba(66, 153, 225, 0.1);
  border: 1px solid rgba(66, 153, 225, 0.2);
  color: #4299e1;
}

.included-source {
  background-color: rgba(66, 153, 225, 0.1);
  border: 1px solid rgba(66, 153, 225, 0.2);
  color: #4299e1;
}

.search-query {
  background-color: rgba(72, 187, 120, 0.1);
  border: 1px solid rgba(72, 187, 120, 0.2);
  color: #48bb78;
}

/* Excluded tags and sources styles */
.excluded-tag {
  background-color: rgba(239, 68, 68, 0.1) !important;
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444 !important;
}

.excluded-source {
  background-color: rgba(239, 68, 68, 0.1) !important;
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444 !important;
}

/* Hide the exclusions manager button */
#exclusions-manager-button {
  display: none !important;
}

/* Responsive styles */
@media (max-width: 768px) {
  .filter-bar {
    padding: 0.5rem;
    padding-top: 2.5rem; /* Make room for the clear all button */
  }
  
  .filters-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .filter-label {
    min-width: auto;
    margin-bottom: 0.25rem;
  }
  
  .clear-all-button {
    top: 0.5rem;
    right: 0.5rem;
  }
}