import type { Metadata, Viewport } from "next";
import { Inter, Plus_Jakarta_Sans } from "next/font/google";
import "./globals.css";
import Providers from "./providers";

const inter = Inter({
  variable: "--font-inter",
  subsets: ["latin"],
  display: "swap",
});

const jakarta = Plus_Jakarta_Sans({
  variable: "--font-jakarta",
  subsets: ["latin"],
  weight: ["600", "700", "800"],
  display: "swap",
});

const siteUrl = "https://vehcall.com";

export const metadata: Metadata = {
  metadataBase: new URL(siteUrl),
  title: "VehCall | Contact Vehicle Owners Securely Through QR Codes",
  description:
    "VehCall enables secure communication between vehicle owners and the public using QR codes without revealing personal phone numbers.",
  keywords: [
    "VehCall",
    "Vehicle QR Code",
    "Contact Vehicle Owner",
    "Smart Parking Solution",
    "Vehicle Communication Platform",
    "Emergency Vehicle Contact",
    "QR Vehicle Identification",
  ],
  authors: [{ name: "VehCall" }],
  alternates: { canonical: "/" },
  openGraph: {
    type: "website",
    url: siteUrl,
    siteName: "VehCall",
    title: "VehCall | Contact Vehicle Owners Securely Through QR Codes",
    description:
      "Scan a VehCall QR code and instantly call, message, or notify a vehicle owner while keeping personal contact information private.",
  },
  twitter: {
    card: "summary_large_image",
    title: "VehCall | Contact Vehicle Owners Securely Through QR Codes",
    description:
      "Secure communication with vehicle owners via QR codes — no personal numbers shared.",
  },
};

export const viewport: Viewport = {
  themeColor: "#0a0e1a",
  colorScheme: "dark",
};

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html
      lang="en"
      className={`${inter.variable} ${jakarta.variable}`}
      suppressHydrationWarning
    >
      <head>
        {/* Flag JS availability before paint so scroll-reveal animations are
            purely additive — content stays visible for no-JS users & crawlers. */}
        <script
          dangerouslySetInnerHTML={{
            __html: `document.documentElement.classList.add("js")`,
          }}
        />
      </head>
      <body>
        <Providers>{children}</Providers>
      </body>
    </html>
  );
}
