"use client";

import Link from "next/link";
import { usePathname } from "next/navigation";

export function Footer() {
  const pathname = usePathname();
  if (pathname?.startsWith("/admin")) return null;

  const year = new Date().getFullYear();
  return (
    <footer className="mt-24 md:mt-32 border-t border-ink/10">
      {/* Big editorial tagline band */}
      <div className="bg-moss-800 text-parchment overflow-hidden">
        <div className="container py-16 md:py-24">
          <p className="font-display text-[clamp(2.5rem,8vw,6rem)] leading-[0.95] tracking-tight">
            Zeit haben.<br />
            Luft holen.<br />
            <span className="italic text-moss-300">Bleiben.</span>
          </p>
          <div className="mt-10 flex flex-wrap gap-3">
            <Link
              href="/anfrage"
              className="inline-flex items-center gap-2 bg-parchment text-ink px-7 py-3.5 rounded-full text-sm font-medium hover:bg-cream transition-colors"
            >
              Jetzt anfragen →
            </Link>
          </div>
        </div>
      </div>

      {/* Links & info row */}
      <div className="bg-cream/60">
        <div className="container py-12 md:py-16 grid grid-cols-2 md:grid-cols-12 gap-10 md:gap-12">
          <div className="col-span-2 md:col-span-4">
            <div className="font-display text-2xl mb-3">Spreewaldzeit</div>
            <p className="text-ink/65 text-sm leading-relaxed max-w-xs">
              Zwei private Ferienwohnungen im Spreewald. Keine Rezeption, keine Masse —
              nur Sie, das Wasser und die Bäume.
            </p>
          </div>

          <div className="col-span-2 md:col-span-3 md:col-start-6">
            <div className="eyebrow mb-4">Kontakt</div>
            <address className="not-italic text-sm leading-relaxed text-ink/75">
              Spreewaldzeit<br />
              Familie Musterfrau<br />
              Kraftwerkstraße 10<br />
              03226 Vetschau/Spreewald
            </address>
            <div className="mt-4 text-sm text-ink/75">
              <a href="mailto:hallo@spreewaldzeit.de" className="link-underline">
                hallo@spreewaldzeit.de
              </a>
            </div>
          </div>

          <div className="md:col-span-2 md:col-start-9 col-span-1">
            <div className="eyebrow mb-4">Navigation</div>
            <ul className="space-y-2 text-sm text-ink/75">
              <li><Link href="/#wohnungen" className="link-underline">Die Wohnungen</Link></li>
              <li><Link href="/#umgebung" className="link-underline">Umgebung</Link></li>
              <li><Link href="/anfrage" className="link-underline">Anfrage senden</Link></li>
              <li><Link href="/datenschutz" className="link-underline">Datenschutz</Link></li>
              <li><Link href="/impressum" className="link-underline">Impressum</Link></li>
            </ul>
          </div>

          <div className="md:col-span-2 md:col-start-11 col-span-1">
            <div className="eyebrow mb-4">Plattformen</div>
            <ul className="space-y-2 text-sm text-ink/75">
              <li>
                <a href="https://www.airbnb.de" target="_blank" rel="noopener noreferrer" className="link-underline">
                  Airbnb ↗
                </a>
              </li>
              <li>
                <a href="https://www.booking.com" target="_blank" rel="noopener noreferrer" className="link-underline">
                  Booking.com ↗
                </a>
              </li>
            </ul>
          </div>
        </div>

        <div className="border-t border-ink/10">
          <div className="container py-5 flex flex-col md:flex-row justify-between gap-2 text-xs text-ink/40">
            <span>© {year} Spreewaldzeit. Alle Rechte vorbehalten.</span>
            <span>Mit Sorgfalt gemacht im Spreewald.</span>
          </div>
        </div>
      </div>
    </footer>
  );
}
