import { cn } from '@/lib/utils';

type IllustrationProps = { size?: number; className?: string };

/** Envelope with a check badge. */
export function MailSentIllustration({ size = 120, className }: IllustrationProps) {
  return (
    <svg width={size} height={size} viewBox="0 0 120 120" fill="none" className={cn('text-primary', className)} aria-hidden="true">
      <ellipse cx="60" cy="102" rx="34" ry="4" className="fill-border-strong" opacity="0.5" />
      <rect x="20" y="34" width="80" height="56" rx="10" className="fill-primary-soft stroke-primary" strokeWidth="1.5" />
      <path d="M22 40l34.2 24.4a6.5 6.5 0 0 0 7.6 0L98 40" className="stroke-primary" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
      <path d="M22 86l26-22M98 86L72 64" className="stroke-primary" strokeWidth="1.5" strokeLinecap="round" opacity="0.5" />
      <circle cx="92" cy="36" r="13" className="fill-success stroke-surface" strokeWidth="3" />
      <path d="M86.5 36.5l3.6 3.6 6.4-7" className="stroke-primary-foreground" strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round" />
    </svg>
  );
}

/** Parcel with an alert badge. */
export function ErrorIllustration({ size = 120, className }: IllustrationProps) {
  return (
    <svg width={size} height={size} viewBox="0 0 120 120" fill="none" className={cn('text-primary', className)} aria-hidden="true">
      <ellipse cx="58" cy="102" rx="34" ry="4" className="fill-border-strong" opacity="0.5" />
      <path d="M58 22l34 16v38L58 94 24 76V38l34-16z" className="fill-primary-soft stroke-primary" strokeWidth="1.5" strokeLinejoin="round" />
      <path d="M24 38l34 17 34-17M58 55v39" className="stroke-primary" strokeWidth="1.5" strokeLinejoin="round" />
      <path d="M41 30l34 16.5v10" className="stroke-primary" strokeWidth="1.5" strokeLinecap="round" opacity="0.5" />
      <circle cx="90" cy="32" r="13" className="fill-danger stroke-surface" strokeWidth="3" />
      <path d="M90 25.5v8" className="stroke-primary-foreground" strokeWidth="2.4" strokeLinecap="round" />
      <circle cx="90" cy="38.2" r="1.5" className="fill-primary-foreground" />
    </svg>
  );
}

/** Padlock with a keyhole. */
export function LockIllustration({ size = 120, className }: IllustrationProps) {
  return (
    <svg width={size} height={size} viewBox="0 0 120 120" fill="none" className={cn('text-primary', className)} aria-hidden="true">
      <ellipse cx="60" cy="104" rx="30" ry="4" className="fill-border-strong" opacity="0.5" />
      <path d="M40 52V40a20 20 0 0 1 40 0v12" className="stroke-primary" strokeWidth="1.5" strokeLinecap="round" />
      <rect x="28" y="50" width="64" height="46" rx="12" className="fill-primary-soft stroke-primary" strokeWidth="1.5" />
      <circle cx="60" cy="70" r="6" className="fill-primary" />
      <path d="M60 74v9" className="stroke-primary" strokeWidth="3" strokeLinecap="round" />
      <circle cx="88" cy="30" r="3" className="fill-accent" />
      <circle cx="24" cy="38" r="2" className="fill-accent" opacity="0.6" />
    </svg>
  );
}

/** Magnifier over a parcel. */
export function NoResultsIllustration({ size = 120, className }: IllustrationProps) {
  return (
    <svg width={size} height={size} viewBox="0 0 120 120" fill="none" className={cn('text-primary', className)} aria-hidden="true">
      <ellipse cx="56" cy="102" rx="34" ry="4" className="fill-border-strong" opacity="0.5" />
      <path d="M50 30l28 13v31L50 88 22 74V43l28-13z" className="fill-primary-soft stroke-primary" strokeWidth="1.5" strokeLinejoin="round" />
      <path d="M22 43l28 14 28-14M50 57v31" className="stroke-primary" strokeWidth="1.5" strokeLinejoin="round" opacity="0.6" />
      <circle cx="80" cy="64" r="15" className="fill-surface stroke-primary" strokeWidth="1.5" />
      <path d="M91 75l11 11" className="stroke-primary" strokeWidth="3" strokeLinecap="round" />
      <path d="M74 64h12" className="stroke-accent" strokeWidth="1.5" strokeLinecap="round" />
    </svg>
  );
}

/** Small check inside a soft circle, used for "all caught up" states. */
export function AllClearIllustration({ size = 56, className }: IllustrationProps) {
  return (
    <svg width={size} height={size} viewBox="0 0 56 56" fill="none" className={className} aria-hidden="true">
      <circle cx="28" cy="28" r="24" className="fill-success-soft" />
      <circle cx="28" cy="28" r="15" className="fill-success" opacity="0.18" />
      <path d="M21 28.5l5 5 9-10" className="stroke-success" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round" />
    </svg>
  );
}

/** Open parcel with a dotted shadow. */
export function EmptyBoxIllustration({ size = 120, className }: IllustrationProps) {
  return (
    <svg width={size} height={size} viewBox="0 0 120 120" fill="none" className={cn('text-primary', className)} aria-hidden="true">
      <ellipse cx="60" cy="100" rx="36" ry="5" className="stroke-border-strong" strokeWidth="1.5" strokeDasharray="2 4" strokeLinecap="round" />
      <path d="M28 52l32 14 32-14v32L60 98 28 84V52z" className="fill-primary-soft stroke-primary" strokeWidth="1.5" strokeLinejoin="round" />
      <path d="M60 66v32" className="stroke-primary" strokeWidth="1.5" />
      <path d="M28 52l-8-12 32-14 8 12M92 52l8-12-32-14-8 12" className="fill-surface stroke-primary" strokeWidth="1.5" strokeLinejoin="round" />
      <path d="M52 38l8 14 8-14" className="stroke-primary" strokeWidth="1.5" strokeLinejoin="round" opacity="0.5" />
      <circle cx="60" cy="22" r="3" className="fill-accent" />
      <path d="M44 18l2 4M76 18l-2 4" className="stroke-accent" strokeWidth="1.5" strokeLinecap="round" />
    </svg>
  );
}
