import Link from "next/link";
import Marquee from "@/components/Marquee";

// CUSTOMIZATION HOOK: replace address / email placeholders & colophon below.
const links = [
  { href: "/", en: "Home" },
  { href: "/members", en: "Members" },
  { href: "/publications", en: "Publications" },
  { href: "/lectures", en: "Lectures" },
  { href: "/standardization", en: "Standardization" },
];

export default function Footer() {
  return (
    <footer className="mt-0 border-t border-line bg-paper text-ink lg:mt-8">
      {/* Marquee band — colophon ticker */}
      <Marquee
        items={[
          "AI AGENT NETWORKING",
          "A2A PROTOCOLS & ACP",
          "QUIC BASED INTERFACE MODULE",
          "MULTI-AGENT ORCHESTRATION",
        ]}
        reverse
        className="border-b border-line py-4 font-display text-lg tracking-wide text-ink/90"
      />

      <div className="container-content grid gap-10 py-16 lg:grid-cols-12">
        {/* Brand Block */}
        <div className="lg:col-span-5 space-y-4">
          <Link
            href="/"
            className="group inline-flex items-center gap-3.5 shrink-0"
          >
            <div className="relative flex items-center justify-center w-10 h-10 rounded-xl overflow-hidden shadow-sm ring-1 ring-ink/10 group-hover:ring-cobalt/40 group-hover:shadow-md group-hover:scale-105 transition-all duration-300 shrink-0">
              <svg viewBox="0 0 32 32" className="w-full h-full" aria-hidden="true">
                <defs>
                  <linearGradient id="footerLogoGrad" x1="0%" y1="0%" x2="100%" y2="100%">
                    <stop offset="0%" stopColor="#4E77FF" />
                    <stop offset="100%" stopColor="#2B4CDE" />
                  </linearGradient>
                  <radialGradient id="footerNodeGlow" cx="50%" cy="50%" r="50%">
                    <stop offset="0%" stopColor="#FFD666" stopOpacity="1" />
                    <stop offset="100%" stopColor="#FF9C1A" stopOpacity="0.8" />
                  </radialGradient>
                </defs>
                <rect width="32" height="32" rx="7" fill="url(#footerLogoGrad)" />
                {/* Network Graph Edges */}
                <path
                  d="M16 9 L9 22 M16 9 L23 22 M9 22 L23 22 M16 9 L16 17 M9 22 L16 17 M23 22 L16 17"
                  stroke="#FFFFFF"
                  strokeWidth="1.2"
                  strokeOpacity="0.85"
                  strokeLinecap="round"
                />
                {/* Network Agent Outer Nodes */}
                <circle cx="16" cy="9" r="2.5" fill="#FFFFFF" />
                <circle cx="9" cy="22" r="2.5" fill="#FFFFFF" />
                <circle cx="23" cy="22" r="2.5" fill="#FFFFFF" />
                {/* Central Coordinating Hub Node */}
                <circle cx="16" cy="17" r="2.2" fill="url(#footerNodeGlow)" className="animate-pulse" />
              </svg>
            </div>

            <div className="flex flex-col leading-none">
              <span className="headline-ko text-xl font-bold tracking-tight text-ink group-hover:text-cobalt-dark transition-colors">
                ANL
              </span>
              <span className="kicker mt-1 transition-colors group-hover:text-cobalt-dark">
                AI Agent Networking LAB
              </span>
            </div>
          </Link>

          <p className="text-xs sm:text-sm text-ink-mute leading-relaxed max-w-sm">
            Research on agent networking technologies and standard framework technologies for multi-AI agent orchestration.
          </p>

          <div className="pt-2 flex flex-wrap gap-2 text-xs font-mono">
            <a
              href="https://www.knu.ac.kr/"
              target="_blank"
              rel="noopener noreferrer"
              className="inline-flex items-center gap-1 px-2.5 py-1 rounded bg-ivory border border-line text-ink-soft hover:text-cobalt-dark hover:border-cobalt/40 transition-colors"
            >
              <span>KNU</span>
              <span className="text-[0.65rem] text-ink-mute">↗</span>
            </a>
            <a
              href="https://cse.knu.ac.kr/"
              target="_blank"
              rel="noopener noreferrer"
              className="inline-flex items-center gap-1 px-2.5 py-1 rounded bg-ivory border border-line text-ink-soft hover:text-cobalt-dark hover:border-cobalt/40 transition-colors"
            >
              <span>CSE</span>
              <span className="text-[0.65rem] text-ink-mute">↗</span>
            </a>
            <a
              href="https://it.knu.ac.kr/"
              target="_blank"
              rel="noopener noreferrer"
              className="inline-flex items-center gap-1 px-2.5 py-1 rounded bg-ivory border border-line text-ink-soft hover:text-cobalt-dark hover:border-cobalt/40 transition-colors"
            >
              <span>CITE</span>
              <span className="text-[0.65rem] text-ink-mute">↗</span>
            </a>
          </div>
        </div>

        {/* Contact */}
        <div className="lg:col-span-4 space-y-3">
          <div className="flex items-center gap-2">
            <span className="h-px w-6 bg-cobalt-dark"></span>
            <p className="font-mono text-xs font-bold uppercase tracking-wider text-cobalt-dark">
              Contact
            </p>
          </div>

          <address className="not-italic text-sm leading-relaxed text-ink-soft space-y-2">
            <div>
              <div className="font-semibold text-ink">Prof. Seok-Joo Koh</div>
              <a
                href="mailto:sjkoh@knu.ac.kr"
                className="inline-block text-xs font-mono text-cobalt-dark hover:underline mt-0.5"
              >
                sjkoh@knu.ac.kr
              </a>
            </div>
            <div className="text-xs text-ink-mute leading-normal pt-1.5 border-t border-line/50">
              Room 527, Bldg. 415 (IT-5), College of IT Engineering<br />
              Kyungpook National University<br />
              80 Daehak-ro, Buk-gu, Daegu 41566, Republic of Korea
            </div>
          </address>
        </div>

        {/* Navigation Index */}
        <div className="lg:col-span-3 space-y-3">
          <div className="flex items-center gap-2">
            <span className="h-px w-6 bg-cobalt-dark"></span>
            <p className="font-mono text-xs font-bold uppercase tracking-wider text-cobalt-dark">
              Index
            </p>
          </div>
          <ul className="space-y-1.5">
            {links.map((l, i) => (
              <li key={l.href}>
                <Link
                  href={l.href}
                  className="group flex items-center justify-between text-xs font-mono text-ink-soft hover:text-cobalt-dark transition-colors py-1 border-b border-line/40 hover:border-cobalt/40"
                >
                  <span className="font-sans text-sm text-ink-soft group-hover:text-cobalt-dark">
                    {l.en}
                  </span>
                  <span className="text-[0.7rem] text-ink-mute group-hover:text-cobalt-dark">
                    {String(i + 1).padStart(2, "0")} →
                  </span>
                </Link>
              </li>
            ))}
          </ul>
        </div>
      </div>

      <div className="border-t border-line">
        <div className="container-content flex flex-col gap-2 py-5 sm:flex-row sm:items-center sm:justify-between">
          <p className="text-xs text-ink-mute">
            © {new Date().getFullYear()} AI Agent Networking Lab (ANL) · School of Computer Science and Engineering, KNU. All rights reserved.
          </p>
        </div>
      </div>
    </footer>
  );
}
