import type { Metadata } from 'next'
import Link from 'next/link'
import { ArrowLeft } from 'lucide-react'
import { Footer } from '@/components/layout/Footer'

export const metadata: Metadata = {
  title: 'Features — AI-Powered Website Change Detection',
  description:
    'Explore SiteChangeMonitor features: AI noise filtering, visual diffs, keyword monitoring, SEO ranking alerts, and multi-channel notifications.',
  alternates: { canonical: '/features' },
  openGraph: {
    title: 'Features — SiteChangeMonitor',
    description: 'AI noise filtering, visual diffs, keyword alerts, and more.',
    url: '/features',
  },
}

const features = [
  {
    slug: 'noise-filtering',
    title: 'AI Noise Filtering',
    description: 'Automatically ignore cookie banners, timestamps, ads, and session IDs. Only get alerted on meaningful changes.',
  },
  {
    slug: 'visual-diff',
    title: 'Visual Diff & Screenshots',
    description: 'See exactly what changed with side-by-side screenshot comparisons. Audit-proof visual evidence for every change.',
  },
  {
    slug: 'keyword-monitoring',
    title: 'Keyword Monitoring',
    description: 'Set triggers for when specific words appear or disappear on a page. Track pricing terms, product names, or any keyword.',
  },
  {
    slug: 'seo-ranking',
    title: 'SEO & Ranking Alerts',
    description: 'Monitor SERP changes, featured snippets, and competitor ranking movements for your target keywords.',
  },
  {
    slug: 'multi-channel-alerts',
    title: 'Multi-Channel Alerts',
    description: 'Get notified via email, Slack, webhooks, or Teams. Route different monitors to different channels.',
  },
]

const itemListJsonLd = {
  '@context': 'https://schema.org',
  '@type': 'ItemList',
  itemListElement: features.map((f, i) => ({
    '@type': 'ListItem',
    position: i + 1,
    name: f.title,
    url: `https://sitechangemonitor.com/features/${f.slug}`,
  })),
}

export default function FeaturesPage() {
  return (
    <div className="min-h-screen bg-background flex flex-col">
      <script
        type="application/ld+json"
        dangerouslySetInnerHTML={{ __html: JSON.stringify(itemListJsonLd) }}
      />
      <div className="flex-1 py-24 px-6">
        <div className="mx-auto max-w-5xl space-y-12">
          <div className="space-y-4">
            <Link href="/" className="inline-flex items-center text-sm text-muted-foreground hover:text-foreground transition-colors">
              <ArrowLeft className="mr-2 h-4 w-4" />
              Back to Home
            </Link>
            <h1 className="text-4xl md:text-5xl font-bold font-display text-foreground">
              Features
            </h1>
            <p className="text-xl text-muted-foreground max-w-3xl">
              SiteChangeMonitor combines AI-powered noise filtering with visual diffs, keyword alerts, and multi-channel notifications to deliver zero-noise website change detection.
            </p>
          </div>

          <div className="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
            {features.map((f) => (
              <Link
                key={f.slug}
                href={`/features/${f.slug}`}
                className="group rounded-2xl border border-border bg-card p-8 hover:border-primary/50 transition-colors"
              >
                <h2 className="text-xl font-bold text-foreground group-hover:text-primary transition-colors">
                  {f.title}
                </h2>
                <p className="mt-2 text-muted-foreground">{f.description}</p>
                <span className="mt-4 inline-block text-sm font-medium text-primary">
                  Learn more →
                </span>
              </Link>
            ))}
          </div>

          <section className="text-center py-12">
            <h2 className="text-2xl font-bold text-foreground mb-4">Ready to try it?</h2>
            <p className="text-muted-foreground mb-6">Join the waitlist for early access to every feature.</p>
            <Link
              href="/"
              className="inline-flex items-center rounded-full bg-primary px-8 py-3 font-medium text-primary-foreground hover:bg-primary/90 transition-colors"
            >
              Join the Waitlist
            </Link>
          </section>
        </div>
      </div>
      <Footer />
    </div>
  )
}
