import type { Metadata } from "next";
import { Quicksand } from "next/font/google";
import "./globals.css";
import { Providers } from "@/components/providers";
import { getSiteUrl } from "@/lib/site-url";

const quicksand = Quicksand({
  variable: "--font-sans",
  subsets: ["latin"],
  weight: ["300", "400", "500", "600", "700"],
});

const siteUrl = getSiteUrl();

export const metadata: Metadata = {
  title: {
    default: "Echo — AI-Powered Response Card Scanning for Churches",
    template: "%s | Echo",
  },
  description:
    "Stop hand-typing visitor cards. Echo uses AI to scan guest cards, prayer requests, and response forms — then syncs to Planning Center, your CRM, or wherever your team needs it.",
  metadataBase: new URL(siteUrl),
  openGraph: {
    type: "website",
    siteName: "Echo",
    title: "Echo — AI-Powered Response Card Scanning for Churches",
    description:
      "Stop hand-typing visitor cards. Echo uses AI to scan guest cards, prayer requests, and response forms — then syncs to Planning Center, your CRM, or wherever your team needs it.",
    images: [
      {
        url: "/og-image.png",
        width: 1200,
        height: 630,
        alt: "Echo — Stop hand-typing visitor cards",
      },
    ],
  },
  twitter: {
    card: "summary_large_image",
    title: "Echo — AI-Powered Response Card Scanning for Churches",
    description:
      "Stop hand-typing visitor cards. Echo uses AI to scan guest cards, prayer requests, and response forms — then syncs to Planning Center, your CRM, or wherever your team needs it.",
    images: ["/og-image.png"],
  },
  keywords: [
    "church OCR",
    "visitor card scanning",
    "guest card scanner",
    "response card digitization",
    "Planning Center integration",
    "church management",
    "AI OCR",
    "prayer request scanning",
    "connection card scanner",
    "church guest services",
  ],
  robots: {
    index: true,
    follow: true,
  },
};

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="en" suppressHydrationWarning>
      <body className={`${quicksand.variable} font-sans antialiased`}>
        <Providers>{children}</Providers>
      </body>
    </html>
  );
}
