import Image from "next/image";
import { cn } from "cn";
import type { Dictionary } from "@/i18n/get-dictionary";
import { AiSparkIcon, TrendingUpIcon } from "@/components/icons";
import { FloatingCard } from "@/components/shared/floating-card";
import { IconBadge } from "@/components/shared/icon-badge";

type HeroVisualProps = { t: Dictionary["home"]["hero"]; className?: string };

/** Photo card with the "AI-Powered" pill and the floating "Client Growth" card. */
export function HeroVisual({ t, className }: HeroVisualProps) {
  return (
    <div className={cn("relative shrink-0", className)}>
      <div className="relative h-96 w-80 overflow-hidden rounded-3xl border border-white/50">
        <Image src="/images/home/hero-card.jpg" alt={t.imageAlt} fill sizes="320px" className="object-cover" priority />
        <div aria-hidden className="absolute inset-0 bg-linear-to-t from-ink/80 to-ink/0 to-50%" />
        <div className="absolute inset-x-6 top-[280px] flex h-[38px] items-center gap-2 rounded-[20px] border border-magenta/20 bg-primary/20 px-4 backdrop-blur-[10px]">
          <AiSparkIcon className="size-4 shrink-0" />
          <span className="font-mono text-xs leading-4 text-white">{t.aiBadge}</span>
        </div>
      </div>

      <FloatingCard className="absolute -start-8 top-[334px] w-[167px] px-5 py-3">
        <IconBadge size="sm" tone="indigo">
          <TrendingUpIcon className="rtl:-scale-x-100" />
        </IconBadge>
        <span className="flex flex-col items-center">
          <span className="text-xs leading-4 whitespace-nowrap text-soft">{t.growthLabel}</span>
          <span className="font-heading text-xl leading-7 font-black text-heading" dir="ltr">
            {t.growthValue}
          </span>
        </span>
      </FloatingCard>
    </div>
  );
}
