import React from 'react';
import { Link } from 'react-router-dom';
import { FOOTER_LINKS } from '../constants';

const DISABLED_FOOTER_LINKS = new Set([
  'Best Sellers',
  'Gift Cards',
  'Sustainability',
  'Careers',
  'Press',
  'Shipping',
  'Returns',
]);

const Footer: React.FC = () => {
  const renderFooterLink = (link: { label: string; href: string }) => {
    const baseClassName = 'text-lg font-light transition-all duration-300 block';

    if (DISABLED_FOOTER_LINKS.has(link.label)) {
      return (
        <span className={`${baseClassName} text-stone-500 cursor-not-allowed`} aria-disabled="true">
          {link.label}
        </span>
      );
    }

    return (
      <Link className={`${baseClassName} hover:text-stone-400 hover:pl-2`} to={link.href}>
        {link.label}
      </Link>
    );
  };

  return (
    <footer className="bg-primary dark:bg-black text-white pt-32 pb-12 px-6 md:px-12 border-t border-stone-800">
      <div className="max-w-[1920px] mx-auto">
        <div className="grid grid-cols-1 lg:grid-cols-12 gap-16 lg:gap-24 mb-32">
          {/* Brand & Mission */}
          <div className="lg:col-span-5 flex flex-col justify-between h-full">
            <div>
              <h2 className="font-display text-6xl md:text-8xl leading-none tracking-tighter mb-6 bg-gradient-to-br from-white to-stone-400 bg-clip-text text-transparent">
                KNUTH Ceramics
              </h2>
              <div className="mb-8">
                <span className="font-body text-[0.7rem] uppercase tracking-[0.2em] border border-stone-800 px-3 py-1.5 inline-block text-stone-300 bg-stone-900/40">
                  Online Shop Opening — Coming Soon
                </span>
              </div>
              <p className="font-body text-lg font-light text-stone-400 leading-relaxed max-w-md">
                Handcrafted ceramics for the modern home. Created with intention, fired with patience, and delivered with care.
              </p>
            </div>

            <div className="mt-16 lg:mt-0">
              <h4 className="text-sm font-bold uppercase tracking-widest mb-4">Get in touch</h4>
              <a
                href="mailto:knuth.claudia@gmail.com"
                className="font-body text-stone-400 hover:text-white transition-colors text-base block mb-2"
              >
                knuth.claudia@gmail.com
              </a>
              <a
                href="https://www.instagram.com/knuth.ceramics"
                target="_blank"
                rel="noopener noreferrer"
                className="font-body text-stone-400 hover:text-white transition-colors text-base block"
                aria-label="Instagram"
              >
                <svg viewBox="0 0 24 24" fill="currentColor" className="w-5 h-5">
                  <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-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.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.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z"/>
                </svg>
              </a>
            </div>
          </div>

          {/* Links Columns */}
          <div className="lg:col-span-7 grid grid-cols-2 md:grid-cols-3 gap-12 pt-4">
            <div>
              <h4 className="text-xs font-bold uppercase tracking-widest mb-8 text-stone-500">{FOOTER_LINKS[0].title}</h4>
              <ul className="space-y-6">
                {FOOTER_LINKS[0].links.map((link) => (
                  <li key={link.label}>
                    {renderFooterLink(link)}
                  </li>
                ))}
              </ul>
            </div>
            <div>
              <h4 className="text-xs font-bold uppercase tracking-widest mb-8 text-stone-500">{FOOTER_LINKS[1].title}</h4>
              <ul className="space-y-6">
                {FOOTER_LINKS[1].links.map((link) => (
                  <li key={link.label}>
                    {renderFooterLink(link)}
                  </li>
                ))}
              </ul>
            </div>
            <div>
              <h4 className="text-xs font-bold uppercase tracking-widest mb-8 text-stone-500">{FOOTER_LINKS[2].title}</h4>
              <ul className="space-y-6">
                {FOOTER_LINKS[2].links.map((link) => (
                  <li key={link.label}>
                    {renderFooterLink(link)}
                  </li>
                ))}
              </ul>
            </div>
          </div>
        </div>

        {/* Bottom Bar */}
        <div className="border-t border-white/10 pt-12 flex flex-col md:flex-row justify-between items-center text-xs text-stone-500 tracking-widest uppercase font-light">
          <p>© 2026 KNUTH Ceramics. All rights reserved.</p>
          <div className="flex space-x-8 mt-6 md:mt-0">
            <Link className="hover:text-white transition-colors" to="/privacy">Privacy</Link>
            <Link className="hover:text-white transition-colors" to="/returns">Terms</Link>
            <Link className="hover:text-white transition-colors" to="/cookies">Cookies</Link>
          </div>
        </div>
      </div>
    </footer>
  );
};

export default Footer;
