/**
 * Trouve-KA — composant UI Badge (étiquettes mono, bordure encre)
 * Author: Simon-Pierre Boucher
 * Contact: contact@spboucher.ai
 */

import type { HTMLAttributes } from "react";
import { cva, type VariantProps } from "class-variance-authority";
import { cn } from "@/lib/utils";

const badgeVariants = cva(
  // Chip éditorial signature : mono uppercase, bordure encre, micro-ombre
  // dure qui grandit au survol (translation -1px, comme les cartes KA).
  "inline-flex items-center gap-1 whitespace-nowrap rounded-[5px] border border-ink px-2 py-[3px] font-mono text-[10px] font-bold uppercase tracking-[0.09em] shadow-[2px_2px_0_rgba(20,24,20,0.16)] transition-[transform,box-shadow] duration-150 hover:-translate-y-px hover:shadow-[3px_3px_0_rgba(20,24,20,0.24)]",
  {
    variants: {
      variant: {
        default: "bg-surface text-ink-2",
        quebec: "bg-lime text-ink",
        government: "bg-green-deep text-paper",
        news: "bg-amber-soft text-ink",
        education: "bg-surface-2 text-ink",
        success: "bg-green text-paper",
        warning: "bg-amber-soft text-ink",
        danger: "bg-danger text-paper",
      },
    },
    defaultVariants: {
      variant: "default",
    },
  },
);

export interface BadgeProps
  extends HTMLAttributes<HTMLSpanElement>,
    VariantProps<typeof badgeVariants> {}

function Badge({ className, variant, ...props }: BadgeProps) {
  return (
    <span className={cn(badgeVariants({ variant }), className)} {...props} />
  );
}

export { Badge, badgeVariants };
