"use client";

import Link from "next/link";
import { motion } from "framer-motion";
import { useTranslations } from "next-intl";

import { Button } from "@/components/ui/button";

import { VideoMakerEditorPreview } from "./VideoMakerEditorPreview";

export function VideoMakerHero() {
  const t = useTranslations("videoMaker");

  return (
    <section className="relative overflow-hidden bg-white pb-16 pt-12 sm:pb-20 sm:pt-16">
      <div className="pointer-events-none absolute -left-32 top-0 h-96 w-96 rounded-full bg-primary-200/40 blur-3xl" />
      <div className="pointer-events-none absolute -right-32 top-20 h-80 w-80 rounded-full bg-primary-100/60 blur-3xl" />

      <div className="relative mx-auto grid max-w-7xl items-center gap-12 px-4 lg:grid-cols-2 lg:gap-16 sm:px-6 lg:px-8">
        <motion.div
          initial={{ opacity: 0, y: 20 }}
          whileInView={{ opacity: 1, y: 0 }}
          viewport={{ once: true, margin: "-40px" }}
          transition={{ duration: 0.4, ease: "easeOut" }}
        >
          <span className="inline-flex rounded-full bg-primary-100 px-3 py-1 text-xs font-semibold text-primary-700">
            {t("badge")}
          </span>
          <h1 className="mt-4 font-heading text-4xl font-bold tracking-tight text-neutral-900 sm:text-5xl">
            {t("heroTitle")}
          </h1>
          <p className="mt-6 text-lg leading-relaxed text-neutral-600">
            {t("heroDesc")}
          </p>
          <div className="mt-8 flex flex-col gap-4 sm:flex-row">
            <Button size="lg" asChild>
              <Link href="/sign-up">{t("heroCta")}</Link>
            </Button>
            <Button variant="outline" size="lg" asChild>
              <Link href="#templates">{t("heroBrowse")}</Link>
            </Button>
          </div>
        </motion.div>

        <motion.div
          initial={{ opacity: 0, y: 24 }}
          whileInView={{ opacity: 1, y: 0 }}
          viewport={{ once: true, margin: "-40px" }}
          transition={{ duration: 0.4, ease: "easeOut", delay: 0.1 }}
        >
          <VideoMakerEditorPreview />
        </motion.div>
      </div>
    </section>
  );
}
