import { Phone, Mail, MapPin, Globe, Building, MessageCircle } from "lucide-react";
import { Seo } from "@/components/Seo";
import { PageHero } from "@/components/PageHero";
import { Reveal } from "@/components/Reveal";
import { QuoteForm } from "@/components/QuoteForm";
import { useContent } from "@/lib/content";

export default function Contact() {
  const { SITE } = useContent();
  return (
    <>
      <Seo
        title="Contact Us — Free Solar Consultation in Chennai | DHIYAA SOLAR ENERGY"
        description="Contact DHIYAA SOLAR ENERGY, Chromepet, Chennai for rooftop solar, solar pumps and commercial/industrial solar. Call 98949 80894 or request a free quotation."
      />
      <PageHero
        eyebrow="Contact Us"
        title="Let's Build a Solar Future Together"
        subtitle="Questions about rooftop solar, solar pumps or commercial/industrial solar? Contact our team for a consultation."
      />

      <section className="mx-auto max-w-7xl px-4 py-16 sm:px-6" data-testid="contact-section">
        <div className="grid gap-10 lg:grid-cols-5">
          <div className="space-y-5 lg:col-span-2">
            <Reveal>
              <div className="rounded-2xl border border-slate-100 bg-white p-6 shadow-sm">
                <h3 className="flex items-center gap-2.5 font-heading text-base font-bold text-brand-navy">
                  <MapPin className="h-5 w-5 text-brand-orange" /> Our Address
                </h3>
                <p className="mt-3 text-sm leading-relaxed text-slate-600" data-testid="contact-address">
                  DHIYAA SOLAR ENERGY<br />
                  {SITE.addressLines.map((l) => (
                    <span key={l}>{l}<br /></span>
                  ))}
                </p>
              </div>
            </Reveal>
            <Reveal delay={0.05}>
              <div className="rounded-2xl border border-slate-100 bg-white p-6 shadow-sm">
                <h3 className="flex items-center gap-2.5 font-heading text-base font-bold text-brand-navy">
                  <Phone className="h-5 w-5 text-brand-orange" /> Phone
                </h3>
                <div className="mt-3 space-y-2">
                  <a href={SITE.phone1} className="block text-sm font-semibold text-brand-blue hover:text-brand-orange transition-colors" data-testid="contact-phone-1">{SITE.phone1Display}</a>
                  <a href={SITE.phone2} className="block text-sm font-semibold text-brand-blue hover:text-brand-orange transition-colors" data-testid="contact-phone-2">{SITE.phone2Display}</a>
                </div>
                <div className="mt-4 grid grid-cols-2 gap-2.5">
                  <a href={SITE.phone1} className="rounded-full bg-brand-blue py-2.5 text-center font-heading text-xs font-bold uppercase tracking-wider text-white transition-colors hover:bg-brand-bluedark" data-testid="contact-call-btn">Call Now</a>
                  <a href={SITE.whatsapp} target="_blank" rel="noreferrer" className="flex items-center justify-center gap-1.5 rounded-full bg-[#25D366] py-2.5 font-heading text-xs font-bold uppercase tracking-wider text-white hover:brightness-110" data-testid="contact-whatsapp-btn">
                    <MessageCircle className="h-3.5 w-3.5" /> WhatsApp
                  </a>
                </div>
              </div>
            </Reveal>
            <Reveal delay={0.1}>
              <div className="rounded-2xl border border-slate-100 bg-white p-6 shadow-sm">
                <h3 className="flex items-center gap-2.5 font-heading text-base font-bold text-brand-navy">
                  <Mail className="h-5 w-5 text-brand-orange" /> Email
                </h3>
                <div className="mt-3 space-y-1.5">
                  {SITE.emails.map((e) => (
                    <a key={e} href={`mailto:${e}`} className="block text-sm text-brand-blue hover:text-brand-orange transition-colors" data-testid={`contact-email-${e.split("@")[0]}`}>{e}</a>
                  ))}
                </div>
                <p className="mt-4 flex items-center gap-2 text-sm text-slate-600">
                  <Globe className="h-4 w-4 text-brand-orange" /> {SITE.website}
                </p>
              </div>
            </Reveal>
            <Reveal delay={0.15}>
              <div className="rounded-2xl border border-slate-100 bg-white p-6 shadow-sm">
                <h3 className="flex items-center gap-2.5 font-heading text-base font-bold text-brand-navy">
                  <Building className="h-5 w-5 text-brand-orange" /> Business Details
                </h3>
                <p className="mt-3 text-sm text-slate-600">GSTIN: {SITE.gstin}</p>
                <p className="text-sm text-slate-600">UDYAM: {SITE.udyam}</p>
              </div>
            </Reveal>
          </div>

          <Reveal delay={0.1} className="lg:col-span-3">
            <div className="rounded-3xl border border-slate-100 bg-white p-7 shadow-xl sm:p-10">
              <p className="text-xs font-bold uppercase tracking-[0.25em] text-brand-orange">Free Solar Quotation</p>
              <h2 className="mt-2 font-heading text-2xl sm:text-3xl font-extrabold text-brand-navy">Get Your Free Solar Quotation</h2>
              <p className="mt-2 text-sm text-slate-500">Tell us a little about your requirement — our team will call you back.</p>
              <div className="mt-6">
                <QuoteForm source="contact-page" />
              </div>
            </div>
          </Reveal>
        </div>
      </section>

      <section className="mx-auto max-w-7xl px-4 pb-16 sm:px-6" data-testid="map-section">
        <Reveal>
          <div className="overflow-hidden rounded-3xl border border-slate-100 shadow-xl">
            <div className="flex flex-wrap items-center justify-between gap-3 bg-brand-navy px-6 py-4">
              <p className="font-heading text-sm font-bold uppercase tracking-wider text-white">Visit Our Office — Chromepet, Chennai</p>
              <a href={SITE.mapsLink} target="_blank" rel="noreferrer" className="rounded-full bg-brand-orange px-5 py-2 text-xs font-bold uppercase tracking-wider text-white transition-colors hover:bg-brand-orangedark" data-testid="map-directions-btn">
                Get Directions
              </a>
            </div>
            <iframe
              title="DHIYAA SOLAR ENERGY office location — Chromepet, Chennai"
              src={SITE.mapsEmbed}
              className="h-[380px] w-full"
              loading="lazy"
              referrerPolicy="no-referrer-when-downgrade"
              data-testid="google-map"
            />
          </div>
        </Reveal>
      </section>
    </>
  );
}
