import { Seo } from "@/components/Seo";
import { PageHero } from "@/components/PageHero";
import { Reveal } from "@/components/Reveal";
import { useQuote } from "@/components/QuoteModal";
import { useContent } from "@/lib/content";

export default function Process() {
  const { openQuote } = useQuote();
  const { PROCESS_STEPS, IMAGES } = useContent();
  return (
    <>
      <Seo
        title="Our Process — From Sunlight to Savings | DHIYAA SOLAR ENERGY"
        description="Our 9-step solar process: consultation, site survey, energy analysis, system design, quotation, installation, testing & commissioning, handover and after-sales support."
      />
      <PageHero
        eyebrow="Our Process"
        title="From Sunlight to Savings"
        subtitle="A clear, transparent 9-step journey from your first call to long-term after-sales support."
        image={IMAGES.hero[2]}
      />
      <section className="mx-auto max-w-5xl px-4 py-16 sm:px-6" data-testid="process-timeline">
        <div className="relative">
          <div className="absolute left-6 top-0 bottom-0 w-px bg-gradient-to-b from-brand-orange via-brand-blue to-brand-green sm:left-1/2" />
          {PROCESS_STEPS.map((s, i) => (
            <Reveal key={s.n} delay={0.05}>
              <div className={`relative mb-10 flex items-start gap-6 sm:w-1/2 ${i % 2 === 0 ? "sm:pr-14" : "sm:ml-auto sm:pl-14"}`} data-testid={`process-step-${s.n}`}>
                <span className={`absolute top-0 flex h-12 w-12 items-center justify-center rounded-full border-4 border-white bg-brand-navy font-heading text-sm font-extrabold text-brand-orange shadow-lg left-0 sm:left-auto ${i % 2 === 0 ? "sm:-right-6" : "sm:-left-6"}`}>
                  {s.n}
                </span>
                <div className="ml-16 sm:ml-0 w-full rounded-2xl border border-slate-100 bg-white p-6 shadow-sm transition-all hover:shadow-lg">
                  <h3 className="font-heading text-lg font-bold text-brand-navy">{s.title}</h3>
                  <p className="mt-1.5 text-sm leading-relaxed text-slate-600">{s.desc}</p>
                </div>
              </div>
            </Reveal>
          ))}
        </div>
        <Reveal className="mt-6 text-center">
          <button onClick={() => openQuote()} className="rounded-full bg-brand-orange px-8 py-4 font-heading text-sm font-bold uppercase tracking-wider text-white transition-colors hover:bg-brand-orangedark" data-testid="process-quote-btn">
            Start With a Free Consultation
          </button>
        </Reveal>
      </section>
    </>
  );
}
