import Link from 'next/link'
import { ArrowRight, Sparkles } from 'lucide-react'
import { getTranslations } from 'next-intl/server'
import { getSiteInfo } from '@/lib/db/queries/getSiteInfo'

// Shown instead of the hero slider while the admin hasn't added any hero
// banner for this design, so a fresh store never opens on an empty hole.
// Brand colors only (Theme Settings), no stock photo.
export default async function HeroFallback({ className = '' }: { className?: string }) {
  const [t, siteInfo] = await Promise.all([getTranslations('HomeDesigns'), getSiteInfo()])

  return (
    <div className={`relative overflow-hidden rounded-3xl bg-gradient-primary text-white ${className}`}>
      <div aria-hidden className="absolute inset-0 opacity-30 [background:radial-gradient(circle_at_20%_20%,white_0,transparent_40%),radial-gradient(circle_at_80%_70%,white_0,transparent_35%)]" />
      <div className="relative z-10 flex h-full flex-col justify-center gap-5 p-8 sm:p-12 lg:p-16 max-w-2xl">
        <span className="inline-flex w-fit items-center gap-2 rounded-full bg-white/15 px-4 py-1.5 text-xs font-semibold uppercase tracking-widest backdrop-blur">
          <Sparkles size={14} />
          {t('heroFallback.eyebrow', { siteName: siteInfo.siteName })}
        </span>
        <h2 className="text-4xl sm:text-5xl lg:text-6xl font-extrabold leading-[1.05] tracking-tight text-balance">
          {siteInfo.tagline || t('heroFallback.title')}
        </h2>
        <p className="text-white/85 text-lg text-pretty">{t('heroFallback.subtitle')}</p>
        <div className="flex flex-wrap gap-3">
          <Link
            href="/products"
            className="inline-flex items-center gap-2 rounded-full bg-white px-7 py-3.5 font-semibold text-gray-900 shadow-xl shadow-black/10 transition-all hover:gap-3"
          >
            {t('heroFallback.cta')}
            <ArrowRight size={18} className="rtl:rotate-180" />
          </Link>
          <Link
            href="/offers"
            className="inline-flex items-center gap-2 rounded-full border border-white/40 px-7 py-3.5 font-semibold text-white backdrop-blur transition-colors hover:bg-white/10"
          >
            {t('heroFallback.secondaryCta')}
          </Link>
        </div>
      </div>
    </div>
  )
}
