import * as React from "react"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils"

const badgeVariants = cva(
  "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
  {
    variants: {
      variant: {
        default: "border-transparent bg-amber-500/20 text-amber-400 hover:bg-amber-500/30",
        secondary: "border-transparent bg-zinc-700 text-zinc-300 hover:bg-zinc-700/80",
        destructive: "border-transparent bg-red-900/60 text-red-300 hover:bg-red-900/80",
        outline: "border-zinc-700 text-zinc-300",
        // Approval status variants
        approved: "border-transparent bg-green-900/60 text-green-300",
        rejected: "border-transparent bg-red-900/60 text-red-300",
        pending: "border-transparent bg-amber-900/60 text-amber-300",
        changes: "border-transparent bg-orange-900/60 text-orange-300",
        // Shot status variants
        waiting: "border-transparent bg-zinc-700 text-zinc-300",
        "in-progress": "border-transparent bg-blue-900/60 text-blue-300",
        "internal-review": "border-transparent bg-cyan-900/60 text-cyan-300",
        "client-review": "border-transparent bg-purple-900/60 text-purple-300",
        revisions: "border-transparent bg-orange-900/60 text-orange-300",
        final: "border-transparent bg-green-900/60 text-green-300",
        // Priority
        urgent: "border-transparent bg-red-900/60 text-red-300",
        high: "border-transparent bg-orange-900/60 text-orange-300",
        normal: "border-transparent bg-zinc-700 text-zinc-300",
        low: "border-transparent bg-zinc-800 text-zinc-400",
      },
    },
    defaultVariants: {
      variant: "default",
    },
  }
)

export interface BadgeProps
  extends React.HTMLAttributes<HTMLDivElement>,
    VariantProps<typeof badgeVariants> {}

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

export { Badge, badgeVariants }
