import 'package:flutter/material.dart';
import '../core/app_colors.dart';
import '../core/app_theme.dart';

class AppTabChip extends StatelessWidget {
  final String label;
  final bool selected;
  final VoidCallback onTap;

  const AppTabChip({
    super.key,
    required this.label,
    required this.selected,
    required this.onTap,
  });

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onTap,
      child: AnimatedContainer(
        duration: const Duration(milliseconds: 180),
        margin: const EdgeInsets.only(right: AppTheme.sSm),
        padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 9),
        decoration: BoxDecoration(
          gradient: selected
              ? AppColors.primaryGradient
              : AppColors.surfaceGradient,
          color: selected ? null : Colors.white,
          borderRadius: BorderRadius.circular(AppTheme.rPill),
          border: Border.all(
            color: selected ? AppColors.primaryLight : AppColors.borderLight,
          ),
          boxShadow: selected
              ? AppColors.buttonShadow
              : AppColors.cardShadowLight,
        ),
        child: Text(
          label,
          style: TextStyle(
            fontSize: 14,
            fontWeight: FontWeight.w700,
            color: selected ? Colors.white : AppColors.textSecondary,
          ),
        ),
      ),
    );
  }
}
