import { Sun } from "lucide-react";
import { Seo } from "@/components/Seo";
import { PageHero } from "@/components/PageHero";
import { Reveal } from "@/components/Reveal";
import { Marquee } from "@/components/Marquee";
import { useQuote } from "@/components/QuoteModal";
import { useContent } from "@/lib/content";

export default function Brands() {
  const { openQuote } = useQuote();
  const { BRANDS } = useContent();
  return (
    <>
      <Seo
        title="Our Technology & Product Brands | Waaree, UTL, Adani Solar, Vikram Solar, ReNew | DHIYAA SOLAR ENERGY"
        description="DHIYAA SOLAR ENERGY works with reputed solar and energy-product brands including Waaree, UTL, Adani Solar, Vikram Solar and ReNew, based on project requirements and specifications."
      />
      <PageHero
        eyebrow="Trusted Brands"
        title="Our Technology & Product Brands"
        subtitle="We work with reputed solar and energy-product brands based on availability, project requirements and applicable specifications."
      />
      <section className="mx-auto max-w-6xl px-4 py-16 sm:px-6" data-testid="brands-grid">
        <div className="grid gap-6 sm:grid-cols-2 lg:grid-cols-3">
          {BRANDS.map((b, i) => {
            const name = typeof b === "string" ? b : b.name;
            const logo = typeof b === "object" && b ? b.logo : null;
            return (
              <Reveal key={name + i} delay={i * 0.07}>
                <div className="group flex h-36 items-center justify-center rounded-2xl border border-slate-100 bg-white p-8 shadow-sm transition-all hover:-translate-y-1 hover:border-brand-orange/40 hover:shadow-xl" data-testid={`brand-card-${name.toLowerCase().replace(/\s+/g, "-")}`}>
                  {logo ? (
                    <img src={logo} alt={`${name} logo`} className="max-h-24 max-w-full object-contain transition-transform duration-300 group-hover:scale-105" />
                  ) : (
                    <span className="flex items-center gap-3 font-heading text-2xl font-extrabold tracking-wide text-brand-blue transition-colors group-hover:text-brand-orange">
                      <Sun className="h-6 w-6 text-brand-orange" /> {name}
                    </span>
                  )}
                </div>
              </Reveal>
            );
          })}
        </div>
        <Reveal className="mt-10">
          <p className="mx-auto max-w-2xl text-center text-sm text-slate-500">
            "Brand availability and product selection are subject to project requirements, technical specifications and
            current market availability."
          </p>
          <p className="mx-auto mt-3 max-w-2xl text-center text-xs text-slate-400">
            All brand names and trademarks belong to their respective owners.
          </p>
        </Reveal>
        <Reveal className="mt-10 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="brands-quote-btn">
            Get Free Quote
          </button>
        </Reveal>
      </section>
      <Marquee items={BRANDS.map((b) => (typeof b === "string" ? b : b.name))} />
    </>
  );
}
