import 'package:flutter/material.dart';

class CategoryFilterChip extends StatelessWidget {
  const CategoryFilterChip({
    super.key,
    required this.label,
    this.icon = Icons.travel_explore_rounded,
    required this.selected,
    required this.onSelected,
  });

  final String label;
  final IconData icon;
  final bool selected;
  final ValueChanged<bool> onSelected;

  @override
  Widget build(BuildContext context) {
    return FilterChip(
      label: Text(label),
      selected: selected,
      onSelected: onSelected,
      showCheckmark: false,
      avatar: Icon(
        icon,
        size: 18,
        color: selected ? Colors.white : const Color(0xFF0F4C81),
      ),
      padding: const EdgeInsets.symmetric(horizontal: 13, vertical: 11),
      selectedColor: const Color(0xFF0F4C81),
      backgroundColor: Colors.white,
      side: BorderSide(
        color: selected ? const Color(0xFF0F4C81) : const Color(0xFFDCEAF3),
      ),
      labelStyle: TextStyle(
        color: selected ? Colors.white : const Color(0xFF334155),
        fontWeight: FontWeight.w800,
      ),
      shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(999)),
      elevation: selected ? 3 : 0,
      shadowColor: const Color(0xFF0F4C81).withValues(alpha: 0.18),
    );
  }
}
