import type { Metadata } from "next";
import { PremiumPageShell } from "@/components/common/PremiumPageShell";
import { PlatformHero } from "@/components/platform/PlatformHero";
import { PlatformArchitecture } from "@/components/platform/PlatformArchitecture";
import { ProductFeatureGrid } from "@/components/platform/ProductFeatureGrid";
import { ProductLLMWorkflow } from "@/components/platform/ProductLLMWorkflow";
import { ConsumerFeatures } from "@/components/platform/ConsumerFeatures";
import { CTABanner } from "@/components/ui/CTABanner";

export const metadata: Metadata = {
  title: "Platform — MerchantOS, ConsumerOS & ProductLLM",
  description:
    "The Nearle platform: MerchantOS runs the store, ProductLLM builds the catalog from a shelf photo, and ConsumerOS brings the neighbourhood to shop. AI infrastructure for local retail.",
  openGraph: {
    title: "The Nearle Platform | MerchantOS · ProductLLM · ConsumerOS",
    description:
      "AI infrastructure behind every neighbourhood store — a free POS and AI catalog for merchants, and local discovery, ordering, and rewards for shoppers.",
    url: "https://nearle.in/platform",
  },
  alternates: { canonical: "/platform" },
};

const MERCHANT_OS = [
  { icon: "point_of_sale", title: "Free POS", desc: "A complete point-of-sale, free for every merchant." },
  { icon: "wifi_off", title: "Offline Billing", desc: "Keep billing customers even when the network drops." },
  { icon: "inventory_2", title: "Inventory", desc: "Live stock counts that stay accurate across channels." },
  { icon: "analytics", title: "Analytics", desc: "See what sells, when, and to whom — in real time." },
  { icon: "loyalty", title: "Loyalty", desc: "Reward regulars and bring them back more often." },
  { icon: "auto_awesome", title: "AI Catalog", desc: "A shoppable catalog built by ProductLLM from a photo." },
  { icon: "qr_code", title: "QR Ordering", desc: "Customers scan, browse, and order in seconds." },
  { icon: "dashboard", title: "Store Dashboard", desc: "Run the whole store from one simple screen." },
];

export default function PlatformPage() {
  return (
    <PremiumPageShell>
      <PlatformHero />
      <PlatformArchitecture />
      <ProductFeatureGrid
        id="merchantos"
        eyebrow="MerchantOS"
        name="Everything a store needs to run"
        tagline="A free operating system for the neighbourhood shop — billing, inventory, catalog, and orders, working online and off."
        features={MERCHANT_OS}
        variant="light"
        showcase="dashboard"
        footnote="AI Catalog powered by ProductLLM."
      />
      <ProductLLMWorkflow />
      <ConsumerFeatures />
      <CTABanner
        badge={{ icon: "hub", label: "Built on Nearle" }}
        heading="Put your store on the platform"
        body="Join the neighbourhood stores already running on MerchantOS — with an AI catalog by ProductLLM and a growing base of local shoppers on ConsumerOS."
        primary={{ href: "/businesses", icon: "storefront", label: "For Business" }}
        secondary={{ href: "/why-nearle", icon: "auto_awesome", label: "Why AI Commerce" }}
      />
    </PremiumPageShell>
  );
}
