import Link from 'next/link';
import Header from '@/components/Header';
import Footer from '@/components/Footer';

export const metadata = {
  title: 'Production Crew & Vendor Marketplace | AV Beat',
  description:
    'Find broadcast and production crew, vendors, jobs, and gig opportunities. The professional marketplace built for the broadcast industry.',
};

const CATEGORIES = [
  { icon: '🎥', label: 'Camera & Lighting', count: 'DPs, Operators, Gaffers' },
  { icon: '🎙️', label: 'Audio', count: 'Mixers, Boom Ops, Sound Designers' },
  { icon: '🎬', label: 'Directing & Production', count: 'Directors, Producers, ADs' },
  { icon: '✂️', label: 'Post Production', count: 'Editors, Colorists, VFX' },
  { icon: '📡', label: 'Broadcast & Live', count: 'TDs, Engineers, MCOs' },
  { icon: '🏢', label: 'Vendors & Companies', count: 'Rental Houses, Post Facilities' },
];

const STATS = [
  { value: 'Phase 1', label: 'MVP Launch' },
  { value: 'Free', label: 'To Join' },
  { value: 'NAB', label: 'Official Media Partner' },
  { value: '2025', label: 'Built for Today' },
];

export default function MarketplacePage() {
  return (
    <div className="min-h-screen bg-[#0d0d0d] text-white">
      <Header />
      {/* Hero */}
      <section className="relative pt-24 pb-20 px-4 overflow-hidden">
        <div className="absolute inset-0 bg-gradient-to-b from-[#CC0000]/10 to-transparent pointer-events-none" />
        <div className="max-w-6xl mx-auto text-center relative z-10">
          <div className="inline-flex items-center gap-2 bg-[#CC0000]/20 border border-[#CC0000]/40 rounded-full px-4 py-1.5 text-sm text-[#CC0000] font-semibold mb-6">
            <span className="w-2 h-2 bg-[#CC0000] rounded-full animate-pulse" />
            Now Live — Phase 1 MVP
          </div>
          <h1 className="text-4xl md:text-6xl font-black uppercase tracking-tight mb-6 leading-none">
            The Pro AV Industry&apos;s
            <br />
            <span className="text-[#CC0000]">Production Marketplace</span>
          </h1>
          <p className="text-lg md:text-xl text-gray-400 max-w-3xl mx-auto mb-10 leading-relaxed">
            Find crew, hire vendors, post jobs, and land gigs — all in one place built by
            pro AV professionals, for pro AV professionals.
          </p>
          <div className="flex flex-col sm:flex-row gap-4 justify-center">
            <Link
              href="/marketplace/search"
              className="bg-[#CC0000] hover:bg-red-700 text-white font-bold px-8 py-4 rounded-lg text-lg transition-colors"
            >
              Find Crew & Vendors
            </Link>
            <Link
              href="/marketplace/join"
              className="bg-white/10 hover:bg-white/20 border border-white/20 text-white font-bold px-8 py-4 rounded-lg text-lg transition-colors"
            >
              Create Your Profile
            </Link>
          </div>
        </div>
      </section>
      {/* Stats */}
      <section className="border-y border-white/10 py-8">
        <div className="max-w-6xl mx-auto px-4 grid grid-cols-2 md:grid-cols-4 gap-6">
          {STATS?.map((s) => (
            <div key={s?.label} className="text-center">
              <div className="text-3xl font-black text-[#CC0000]">{s?.value}</div>
              <div className="text-sm text-gray-400 mt-1">{s?.label}</div>
            </div>
          ))}
        </div>
      </section>
      {/* Categories */}
      <section className="py-16 px-4">
        <div className="max-w-6xl mx-auto">
          <h2 className="text-2xl font-black uppercase tracking-wide text-center mb-10">
            Browse by Category
          </h2>
          <div className="grid grid-cols-2 md:grid-cols-3 gap-4">
            {CATEGORIES?.map((cat) => (
              <Link
                key={cat?.label}
                href={`/marketplace/search?category=${encodeURIComponent(cat?.label)}`}
                className="bg-[#1a1a1a] hover:bg-[#222] border border-white/10 hover:border-[#CC0000]/40 rounded-xl p-6 transition-all group"
              >
                <div className="text-3xl mb-3">{cat?.icon}</div>
                <div className="font-bold text-white group-hover:text-[#CC0000] transition-colors">
                  {cat?.label}
                </div>
                <div className="text-sm text-gray-500 mt-1">{cat?.count}</div>
              </Link>
            ))}
          </div>
        </div>
      </section>
      {/* Three Columns: Find / Post / Join */}
      <section className="py-16 px-4 bg-[#111]">
        <div className="max-w-6xl mx-auto grid md:grid-cols-3 gap-8">
          <div className="text-center p-8">
            <div className="w-16 h-16 bg-[#CC0000]/20 rounded-full flex items-center justify-center mx-auto mb-4 text-2xl">
              🔍
            </div>
            <h3 className="text-xl font-bold mb-3">Find Talent</h3>
            <p className="text-gray-400 text-sm leading-relaxed mb-6">
              Search our directory of verified pro AV integrators, live production engineers, and display tech vendors.
              Filter by location, specialty, rate, and union status.
            </p>
            <Link
              href="/marketplace/search"
              className="text-[#CC0000] font-semibold hover:underline text-sm"
            >
              Search Directory →
            </Link>
          </div>

          <div className="text-center p-8 border-x border-white/10">
            <div className="w-16 h-16 bg-[#CC0000]/20 rounded-full flex items-center justify-center mx-auto mb-4 text-2xl">
              📋
            </div>
            <h3 className="text-xl font-bold mb-3">Post Jobs & Gigs</h3>
            <p className="text-gray-400 text-sm leading-relaxed mb-6">
              Post full-time positions or short-term crew calls. Reach thousands of qualified
              pro AV professionals instantly.
            </p>
            <div className="flex flex-col gap-2">
              <Link
                href="/marketplace/jobs"
                className="text-[#CC0000] font-semibold hover:underline text-sm"
              >
                Browse Jobs →
              </Link>
              <Link
                href="/marketplace/gigs"
                className="text-[#CC0000] font-semibold hover:underline text-sm"
              >
                Browse Gigs →
              </Link>
            </div>
          </div>

          <div className="text-center p-8">
            <div className="w-16 h-16 bg-[#CC0000]/20 rounded-full flex items-center justify-center mx-auto mb-4 text-2xl">
              ⭐
            </div>
            <h3 className="text-xl font-bold mb-3">Get Discovered</h3>
            <p className="text-gray-400 text-sm leading-relaxed mb-6">
              Create your free profile, get verified by our team, and start receiving leads from
              clients and employers across the industry.
            </p>
            <Link
              href="/marketplace/join"
              className="text-[#CC0000] font-semibold hover:underline text-sm"
            >
              Create Profile →
            </Link>
          </div>
        </div>
      </section>
      {/* Pricing teaser */}
      <section className="py-16 px-4">
        <div className="max-w-4xl mx-auto text-center">
          <h2 className="text-2xl font-black uppercase tracking-wide mb-4">
            Simple, Transparent Pricing
          </h2>
          <p className="text-gray-400 mb-10">
            Start free. Upgrade when you&apos;re ready to grow.
          </p>
          <div className="grid md:grid-cols-3 gap-6">
            {[
              {
                name: 'Free',
                price: '$0',
                period: 'forever',
                features: ['Basic profile', 'Appear in search', '3 gig responses/month'],
                cta: 'Get Started',
                href: '/marketplace/join',
                highlight: false,
              },
              {
                name: 'Pro',
                price: '$9.99',
                period: '/month',
                features: [
                  'Priority placement',
                  'Unlimited gig responses',
                  'Post jobs & gigs',
                  'Profile analytics',
                ],
                cta: 'Go Pro',
                href: '/marketplace/join',
                highlight: true,
              },
              {
                name: 'Studio / Vendor',
                price: '$29.99',
                period: '/month',
                features: [
                  'Company profile',
                  'Up to 5 staff profiles',
                  'Featured placement',
                  'Priority lead routing',
                ],
                cta: 'Get Started',
                href: '/marketplace/join',
                highlight: false,
              },
            ]?.map((plan) => (
              <div
                key={plan?.name}
                className={`rounded-xl p-6 border ${
                  plan?.highlight
                    ? 'bg-[#CC0000]/10 border-[#CC0000] relative'
                    : 'bg-[#1a1a1a] border-white/10'
                }`}
              >
                {plan?.highlight && (
                  <div className="absolute -top-3 left-1/2 -translate-x-1/2 bg-[#CC0000] text-white text-xs font-bold px-3 py-1 rounded-full">
                    MOST POPULAR
                  </div>
                )}
                <div className="font-bold text-lg mb-1">{plan?.name}</div>
                <div className="text-3xl font-black text-[#CC0000]">
                  {plan?.price}
                  <span className="text-sm text-gray-400 font-normal">{plan?.period}</span>
                </div>
                <ul className="mt-4 mb-6 space-y-2">
                  {plan?.features?.map((f) => (
                    <li key={f} className="text-sm text-gray-300 flex items-center gap-2">
                      <span className="text-[#CC0000]">✓</span> {f}
                    </li>
                  ))}
                </ul>
                <Link
                  href={plan?.href}
                  className={`block text-center py-2.5 rounded-lg font-bold text-sm transition-colors ${
                    plan?.highlight
                      ? 'bg-[#CC0000] hover:bg-red-700 text-white'
                      : 'bg-white/10 hover:bg-white/20 text-white'
                  }`}
                >
                  {plan?.cta}
                </Link>
              </div>
            ))}
          </div>

          {/* Stripe coming soon notice */}
          <div className="mt-8 bg-[#1a1a1a] border border-yellow-500/30 rounded-lg p-4 text-sm text-yellow-400">
            💳 <strong>Billing coming soon</strong> — Pro and Studio plans are available now.
            Payment processing will be enabled shortly. Create your free profile today and upgrade
            when billing launches.
          </div>
        </div>
      </section>
      <Footer />
    </div>
  );
}
