<template>
  <div class="filter-bar">
    <button
      v-for="filter in filters"
      :key="filter.value"
      class="filter-btn"
      :class="{ active: modelValue === filter.value }"
      @click="$emit('update:modelValue', filter.value)"
    >{{ filter.label }}</button>
    <slot />
  </div>
</template>

<script setup>
defineProps({
  modelValue: { type: String, default: '' },
  filters: { type: Array, required: true },
})

defineEmits(['update:modelValue'])
</script>

<style scoped>
.filter-bar {
  padding: 14px 32px;
  border-bottom: 1px dashed var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  font-family: 'Commit Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 12px;
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn:hover {
  border-color: var(--candle-faint);
  color: var(--text);
}

.filter-btn.active {
  border-color: var(--candle-dim);
  border-style: solid;
  color: var(--candle);
  background: rgba(154, 116, 32, 0.08);
}
</style>
