import Link from "next/link";
import {
  VehCallLogo,
  FacebookIcon,
  InstagramIcon,
  LinkedinIcon,
} from "./icons";

type FooterLink = { label: string; href: string };

const COLUMNS: { title: string; links: FooterLink[] }[] = [
  {
    title: "Product",
    links: [
      { label: "Features", href: "/#features" },
      { label: "Pricing", href: "/#pricing" },
      { label: "Download", href: "/#download" },
      { label: "For Businesses", href: "/for-business" },
      { label: "FAQ", href: "/#faq" },
    ],
  },
  {
    title: "Legal",
    links: [
      { label: "Privacy Policy", href: "/privacy-policy" },
      { label: "Terms", href: "/terms" },
    ],
  },
];

const SOCIALS = [
  {
    label: "Facebook",
    Icon: FacebookIcon,
    href: "https://www.facebook.com/profile.php?id=61594349485284",
  },
  {
    label: "Instagram",
    Icon: InstagramIcon,
    href: "https://www.instagram.com/vehcall?stkn=cGpzNDMzY2pvMjFi&utm_source=qr",
  },
  {
    label: "LinkedIn",
    Icon: LinkedinIcon,
    href: "https://www.linkedin.com/showcase/vehcall/",
  },
];

export default function Footer() {
  return (
    <footer className="relative border-t border-white/8 bg-surface/40">
      <div className="mx-auto max-w-7xl px-5 py-16 sm:px-8">
        <div className="grid grid-cols-2 gap-10 lg:grid-cols-4">
          {/* Brand */}
          <div className="col-span-2">
            <Link href="/" className="flex items-center gap-2.5">
              <VehCallLogo />
              <span className="text-lg font-bold tracking-tight text-white">
                Veh<span className="text-brand">Call</span>
              </span>
            </Link>
            <p className="mt-4 max-w-xs text-sm leading-relaxed text-white/55">
              Contact any vehicle owner instantly and securely through a QR code
              — without sharing personal phone numbers.
            </p>
            <div className="mt-6 flex items-center gap-3">
              {SOCIALS.map(({ label, Icon, href }) => (
                <a
                  key={label}
                  href={href}
                  target="_blank"
                  rel="noopener noreferrer"
                  aria-label={label}
                  className="flex h-10 w-10 items-center justify-center rounded-xl border border-white/10 text-white/60 transition-colors hover:border-brand/40 hover:text-brand"
                >
                  <Icon />
                </a>
              ))}
            </div>
          </div>

          {/* Link columns */}
          {COLUMNS.map((col) => (
            <div key={col.title}>
              <h3 className="text-sm font-semibold text-white">{col.title}</h3>
              <ul className="mt-4 space-y-3">
                {col.links.map((link) => (
                  <li key={link.label}>
                    <Link
                      href={link.href}
                      className="text-sm text-white/55 transition-colors hover:text-white"
                    >
                      {link.label}
                    </Link>
                  </li>
                ))}
              </ul>
            </div>
          ))}
        </div>

        <div className="mt-12 flex flex-col items-center justify-between gap-4 border-t border-white/8 pt-8 sm:flex-row">
          <p className="text-sm text-white/45">
            © {new Date().getFullYear()} VTRIG TECH. All rights reserved.
          </p>
          <p className="text-sm text-white/45">
            Made for safer, more connected roads.
          </p>
        </div>
      </div>
    </footer>
  );
}
