import type { Metadata } from "next";
import Link from "next/link";
import { SitePage } from "@/app/(site)/_components/SitePage";
import { SiteHeader } from "@/app/(site)/_components/SiteHeader";
import { SiteFooter } from "@/app/(site)/_components/SiteFooter";

export const metadata: Metadata = {
  title: "Education for Every Child — Unionists Group",
};

export default function Page() {
  return (
    <SitePage>
      <a className="skip-link" href="#main">
        Skip to main content
      </a>{" "}
      <SiteHeader active="/donations" />
      <main id="main">
        {/* Hero */}
        <section className="page-hero relative overflow-hidden py-[52px] md:py-[64px] px-5 text-center">
          <div className="page-hero-pattern" aria-hidden="true"></div>
          <div className="relative z-[2] max-w-[820px] mx-auto" data-reveal="">
            <h1 className="text-[clamp(26px,3.8vw,38px)] font-black text-white leading-tight tracking-[-0.01em]">
              Education for Every Child
            </h1>
            <nav className="mt-4 text-[13px] text-white/70" aria-label="Breadcrumb">
              <ol className="inline-flex items-center gap-2">
                <li>
                  <Link href="/" className="hover:text-white transition-colors">
                    Home
                  </Link>
                </li>
                <li aria-hidden="true" className="text-white/40">
                  &gt;
                </li>
                <li>
                  <Link href="/donations" className="hover:text-white transition-colors">
                    Donations
                  </Link>
                </li>
              </ol>
            </nav>
          </div>
        </section>
        {/* Campaign detail */}
        <section className="bg-white py-[56px] md:py-[72px] campaign-detail-panel">
          <div className="w-full max-w-[1180px] mx-auto px-6">
            <div className="grid grid-cols-1 lg:grid-cols-2 gap-8 lg:gap-12 items-start">
              <div className="rounded-[6px] overflow-hidden border border-[#e2e8f0]" data-reveal="left">
                <img
                  src="/assets/images/donations/campaign-detail.jpg"
                  alt="Volunteer serving food to a child in a community relief program"
                  className="w-full aspect-square object-cover block"
                  width="560"
                  height="560"
                  loading="eager"
                />
              </div>
              <div data-reveal="right">
                <span className="campaign-badge inline-block px-[10px] py-[4px] text-[10px] font-bold tracking-[0.06em] text-white rounded-[4px] mb-4">
                  Education
                </span>{" "}
                <h2 className="text-[clamp(22px,2.8vw,30px)] font-black text-ink leading-tight tracking-[-0.01em] mb-3">
                  Global Food Relief 2025
                </h2>
                <p className="text-[14px] text-[#2E2E2E] leading-[1.65] mb-6">
                  Figma ipsum component variant main layer. Invite style vector pencil union frame. Share move frame
                  line polygon thumbnail overflow thumbnail outline plugin.
                </p>
                <div className="grid grid-cols-3 gap-3 mb-6">
                  <div className="campaign-stat-card" data-reveal="">
                    <div className="text-[20px] font-bold text-[#1f63d6] leading-tight">$45,000</div>
                    <div className="mt-1 text-[11px] font-bold text-[#1A1A1A] leading-[1.35]">Funds Raised</div>
                  </div>
                  <div className="campaign-stat-card" data-reveal="">
                    <div className="text-[20px] font-bold text-[#1f63d6] leading-tight">250</div>
                    <div className="mt-1 text-[11px] font-bold text-[#1A1A1A] leading-[1.35]">Supporters</div>
                  </div>
                  <div className="campaign-stat-card" data-reveal="">
                    <div className="text-[20px] font-bold text-[#1f63d6] leading-tight">200</div>
                    <div className="mt-1 text-[11px] font-bold text-[#1A1A1A] leading-[1.35]">Days To Go</div>
                  </div>
                </div>
                <div className="mb-2">
                  <div className="progress-track h-[6px] rounded-full bg-[#eef0f3] overflow-hidden">
                    <div
                      className="progress-fill h-full rounded-full"
                      data-progress="86.54"
                      style={{ width: "0", background: "linear-gradient(90deg,#f5a623,#f7c948)" }}
                    ></div>
                  </div>
                </div>
                <div className="mb-6">
                  <div className="flex items-baseline justify-between gap-3">
                    <div className="text-[14px] font-bold text-[#1A1A1A]">$45,000</div>{" "}
                    <span className="text-[14px] text-[#1A1A1A] progress-label shrink-0" data-target="86.54">
                      0%
                    </span>
                  </div>
                  <div className="text-[12px] text-[#2E2E2E]">raised of $52,000</div>
                </div>{" "}
                <button
                  type="button"
                  className="btn w-full inline-flex items-center justify-center py-[14px] text-[12px] font-bold tracking-[0.08em] uppercase rounded-[6px] border-[1.5px] border-transparent bg-[#1f63d6] text-white transition-all duration-[180ms] hover:bg-[#194fab] hover:-translate-y-px"
                >
                  {" "}
                  Donate{" "}
                </button>
              </div>
            </div>
          </div>
        </section>
        {/* About */}
        <section className="bg-white pb-[56px]">
          <div className="w-full max-w-[1180px] mx-auto px-6">
            <h2 className="text-[clamp(20px,2.4vw,24px)] font-black text-ink mb-5" data-reveal="">
              About The Campaign
            </h2>
            <div className="flex flex-col gap-5 text-[15px] text-[#2E2E2E] leading-[1.75]" data-reveal="">
              <p>
                Figma ipsum component variant main layer. Invite style vector pencil union frame. Share move frame line
                polygon thumbnail overflow thumbnail outline plugin. Ellipse select bold image flows arrow. Figma ipsum
                component variant main layer. Invite style vector pencil union frame. Share move frame line polygon
                thumbnail overflow thumbnail outline plugin.
              </p>
              <p>
                Figma ipsum component variant main layer. Invite style vector pencil union frame. Share move frame line
                polygon thumbnail overflow thumbnail outline plugin. Ellipse select bold image flows arrow. Figma ipsum
                component variant main layer. Invite style vector pencil union frame. Share move frame line polygon
                thumbnail overflow thumbnail outline plugin.
              </p>
              <p>
                Figma ipsum component variant main layer. Invite style vector pencil union frame. Share move frame line
                polygon thumbnail overflow thumbnail outline plugin. Ellipse select bold image flows arrow. Figma ipsum
                component variant main layer. Invite style vector pencil union frame. Share move frame line polygon
                thumbnail overflow thumbnail outline plugin.
              </p>
            </div>
          </div>
        </section>
        {/* Social share */}
        <section className="bg-white border-t border-[#eef0f3] py-8">
          <div
            className="w-full max-w-[1180px] mx-auto px-6 flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4"
            data-reveal=""
          >
            <span className="text-[15px] font-bold text-ink">Social Share:</span>{" "}
            <div className="flex items-center gap-3">
              <a href="#" className="social-share-btn social-share-fb" aria-label="Share on Facebook">
                {" "}
                <svg className="w-4 h-4" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
                  <path d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"></path>
                </svg>{" "}
              </a>{" "}
              <a href="#" className="social-share-btn social-share-ig" aria-label="Share on Instagram">
                {" "}
                <svg className="w-4 h-4" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
                  <path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z"></path>
                </svg>{" "}
              </a>{" "}
              <a href="#" className="social-share-btn social-share-li" aria-label="Share on LinkedIn">
                {" "}
                <svg className="w-4 h-4" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
                  <path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 01-2.063-2.065 2.064 2.064 0 114.127 0 2.063 2.063 0 01-2.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"></path>
                </svg>{" "}
              </a>{" "}
              <a href="#" className="social-share-btn social-share-x" aria-label="Share on X">
                {" "}
                <svg className="w-3.5 h-3.5" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
                  <path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"></path>
                </svg>{" "}
              </a>
            </div>
          </div>
        </section>
        {/* Related campaigns */}
        <section className="bg-white py-[56px] md:py-[72px]">
          <div className="w-full max-w-[1180px] mx-auto px-6">
            <h2 className="text-[clamp(22px,2.8vw,28px)] font-black text-ink text-center mb-10" data-reveal="">
              Related Campaigns
            </h2>
            <div
              id="related-campaigns-grid"
              className="campaigns-grid grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-6"
            >
              {Array.from({ length: 3 }, (_, i) => (
                <RelatedCampaignCard key={i} />
              ))}
            </div>
            <div className="mt-10 text-center" data-reveal="">
              <Link
                href="/active-campaigns"
                className="btn-outline-blue inline-flex items-center justify-center px-[32px] py-[13px] text-[12px] font-bold tracking-[0.08em] uppercase rounded-[6px] border-[1.5px] border-[#1f63d6] bg-white text-[#1f63d6] transition-all duration-[180ms] hover:bg-[#1f63d6] hover:text-white hover:-translate-y-px"
              >
                View All
              </Link>
            </div>
          </div>
        </section>
        {/* CTA */}
        <section className="donations-cta overflow-hidden" aria-label="Partner with Unionists">
          <div className="grid grid-cols-1 lg:grid-cols-2 min-h-0">
            <div
              className="donations-cta-content flex flex-col justify-center px-6 py-14 md:px-12 md:py-16 lg:px-14 lg:py-[72px] order-2 lg:order-1"
              data-reveal="left"
            >
              <h2 className="text-[clamp(24px,3vw,34px)] font-black text-ink leading-tight tracking-[-0.01em] max-w-[480px]">
                Together, We Build Sustainable Change
              </h2>
              <p className="mt-5 text-[15px] leading-[1.75] text-[#3c4554] max-w-[500px]">
                Be part of a global network shaping a future where food, health, and education reach every community
                with purpose and precision. Join our mission to empower lives and accelerate positive impact through
                innovation and collaboration.
              </p>
              <div className="mt-8 flex flex-col sm:flex-row items-stretch sm:items-center gap-[14px] flex-wrap">
                <Link
                  href="/contact"
                  className="btn inline-flex items-center justify-center px-[26px] py-[14px] text-[12px] font-bold tracking-[0.06em] uppercase rounded-[6px] border-[1.5px] border-transparent bg-[#1f63d6] text-white transition-all duration-[180ms] hover:bg-[#194fab] hover:-translate-y-px"
                >
                  Become a Partner
                </Link>{" "}
                <Link
                  href="/"
                  className="btn-outline-blue inline-flex items-center justify-center px-[26px] py-[14px] text-[12px] font-bold tracking-[0.06em] uppercase rounded-[6px] border-[1.5px] border-[#1f63d6] bg-transparent text-[#1f63d6] transition-all duration-[180ms] hover:bg-[#1f63d6] hover:text-white hover:-translate-y-px"
                >
                  Explore Our Global Reach
                </Link>
              </div>
            </div>
            <div
              className="donations-cta-visual relative min-h-[260px] sm:min-h-[320px] lg:min-h-[380px] order-1 lg:order-2 overflow-hidden"
              data-reveal="right"
            >
              <img
                src="/assets/images/donations/cta-sprout.jpg"
                alt="A vibrant green sapling growing from a wet rock surrounded by calm blue water"
                className="donations-cta-image absolute inset-0 w-full h-full object-cover object-[70%_center]"
                width="1024"
                height="572"
                loading="lazy"
              />
            </div>
          </div>
        </section>
      </main>
      <SiteFooter />
    </SitePage>
  );
}

function RelatedCampaignCard() {
  return (
    <>
      <Link
        href="/campaign-detail"
        className="campaign-card campaign-card-link bg-white rounded-[6px] border border-[#e8ecf2] shadow-[0_4px_24px_rgba(15,27,46,0.07)] overflow-hidden flex flex-col"
        data-reveal=""
      >
        <div className="relative">
          <img
            src="/assets/images/donations/campaign-education.jpg"
            alt="Children learning together around a globe"
            className="w-full aspect-[380/200] object-cover block"
            width="380"
            height="200"
            loading="lazy"
          />{" "}
          <span className="campaign-badge absolute top-3 right-3 px-[10px] py-[4px] text-[10px] font-bold tracking-[0.06em] text-white rounded-[4px]">
            Education
          </span>
        </div>
        <div className="p-5 flex flex-col flex-1">
          <div className="flex items-center justify-between gap-2 mb-3 text-[12px]">
            <span className="text-[#2E2E2E]">
              By <span className="text-[#0056D2] font-semibold">Unionists Group</span>
            </span>{" "}
            <span className="text-[#2E2E2E]">200 Days To Go</span>
          </div>
          <h3 className="text-[16px] font-bold text-[#1A1A1A] mb-2 leading-[1.35]">Education for Every Child</h3>
          <p className="text-[13px] text-[#4A4A4A] leading-[1.6] mb-5 flex-1">
            Figma ipsum component variant main layer. Invite style vector pencil union frame. Share move frame line
            polygon thumbnail overflow.
          </p>
          <div className="mb-2">
            <div className="progress-track h-[6px] rounded-full bg-[#eef0f3] overflow-hidden">
              <div
                className="progress-fill h-full rounded-full"
                data-progress="86.54"
                style={{ width: "0", background: "#FFB800" }}
              ></div>
            </div>
          </div>
          <div className="mb-5">
            <div className="flex items-baseline justify-between gap-3">
              <div className="text-[14px] font-bold text-[#1A1A1A]">$45,000</div>{" "}
              <span className="text-[14px] text-[#1A1A1A] progress-label shrink-0" data-target="86.54">
                0%
              </span>
            </div>
            <div className="text-[12px] text-[#2E2E2E]">raised of $52,000</div>
          </div>{" "}
          <span className="campaign-donate-btn w-full inline-flex items-center justify-center py-[13px] text-[12px] font-bold tracking-[0.08em] uppercase rounded-[6px] text-white">
            Donate
          </span>
        </div>
      </Link>
    </>
  );
}
