import Image from 'next/image'
import { Check, Rocket, Clock, Zap, Star } from 'lucide-react'
import { CtaButton } from '@/components/cta-button'
import { heroStats } from '@/lib/data'

const bullets = [
  'Attirez plus de clients',
  'Développez votre chiffre d’affaires',
  'Automatisez vos tâches',
  'Centralisez tous vos outils',
  'Gérez votre activité',
  'Faites évoluer votre entreprise',
]

const statIcons = [Rocket, Clock, Zap]

export function Hero() {
  return (
    <section
      id="accueil"
      className="relative overflow-hidden border-b border-border/60"
    >
      <div
        className="pointer-events-none absolute inset-0 opacity-60"
        style={{
          background:
            'radial-gradient(60% 50% at 20% 0%, oklch(0.62 0.16 250 / 0.18), transparent), radial-gradient(50% 40% at 90% 10%, oklch(0.72 0.17 152 / 0.14), transparent)',
        }}
        aria-hidden
      />
      <div className="relative mx-auto grid max-w-7xl items-center gap-12 px-4 py-14 lg:grid-cols-2 lg:px-8 lg:py-20">
        <div>
          <span className="inline-flex items-center rounded-full border border-border bg-card/50 px-3 py-1 text-xs font-medium uppercase tracking-wide text-muted-foreground">
            Plateformes métiers sur-mesure
          </span>

          <h1 className="mt-5 text-pretty text-4xl font-extrabold leading-tight tracking-tight sm:text-5xl">
            Construisez la plateforme qui fera{' '}
            <span className="text-primary">grandir</span> votre entreprise.
          </h1>

          <p className="mt-5 max-w-xl text-pretty leading-relaxed text-muted-foreground">
            Que vous soyez créateur d’entreprise, PME, association, fédération,
            collectivité ou grand groupe, nous concevons une plateforme 100 %
            adaptée à votre activité.
          </p>

          <ul className="mt-6 grid max-w-lg grid-cols-1 gap-2 sm:grid-cols-2">
            {bullets.map((b) => (
              <li key={b} className="flex items-center gap-2 text-sm">
                <span className="flex size-5 shrink-0 items-center justify-center rounded-full bg-primary/15 text-primary">
                  <Check className="size-3.5" />
                </span>
                {b}
              </li>
            ))}
          </ul>

          <div className="mt-8 flex flex-col gap-3 sm:flex-row">
            <CtaButton>Recevoir mon étude gratuite</CtaButton>
            <CtaButton href="#solutions" variant="outline">
              Voir ce qu’il est possible de créer
            </CtaButton>
          </div>

          <div className="mt-8 flex items-center gap-3">
            <div className="flex items-center gap-0.5 text-primary">
              {Array.from({ length: 5 }).map((_, i) => (
                <Star key={i} className="size-4 fill-current" />
              ))}
            </div>
            <span className="text-sm font-semibold">4,9/5</span>
            <span className="text-sm text-muted-foreground">
              Plus de 300 entreprises nous font confiance
            </span>
          </div>
        </div>

        <div className="relative">
          <div className="mb-4 flex flex-wrap gap-3">
            {heroStats.map((stat, i) => {
              const Icon = statIcons[i]
              return (
                <div
                  key={stat.value}
                  className="flex items-center gap-3 rounded-xl border border-border bg-card/70 px-4 py-3 backdrop-blur"
                >
                  <span className="flex size-9 items-center justify-center rounded-lg bg-primary/15 text-primary">
                    <Icon className="size-4" />
                  </span>
                  <div className="leading-tight">
                    <div className="text-sm font-bold">{stat.value}</div>
                    <div className="text-xs text-muted-foreground">{stat.label}</div>
                  </div>
                </div>
              )
            })}
          </div>
          <div className="overflow-hidden rounded-2xl border border-border bg-card/40">
            <Image
              src="/hero-dashboard.png"
              alt="Aperçu d’une plateforme Azelior sur ordinateur et mobile"
              width={900}
              height={640}
              className="h-auto w-full"
              priority
            />
          </div>
        </div>
      </div>
    </section>
  )
}
