import type { Metadata } from "next";
import { Inter, Space_Grotesk, JetBrains_Mono } from "next/font/google";
import "./globals.css";
import ScrollToTop from "@/components/ScrollToTop";

const inter = Inter({
  variable: "--font-inter",
  subsets: ["latin"],
  weight: ["400", "500", "600", "700", "800"],
  display: "swap",
});

const spaceGrotesk = Space_Grotesk({
  variable: "--font-space-grotesk",
  subsets: ["latin"],
  weight: ["500", "600", "700"],
  display: "swap",
});

const jetbrainsMono = JetBrains_Mono({
  variable: "--font-jetbrains-mono",
  subsets: ["latin"],
  weight: ["400", "500"],
  display: "swap",
});

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

export const metadata: Metadata = {
  metadataBase: new URL(siteUrl),
  title: {
    default: "Vasundhara Infotech — Software Product Company",
    template: "%s | Vasundhara Infotech",
  },
  description:
    "Vasundhara Infotech helps startups and growing businesses design, build and ship web, mobile and AI-powered products. Over 10 years in business, 800+ projects delivered, and a 140+ person engineering team that sticks around for the long run.",
  keywords: [
    "Vasundhara Infotech",
    "software development company",
    "custom software development",
    "mobile app development company",
    "web development company",
    "AI development services",
    "MVP development",
    "dedicated development team",
  ],
  authors: [{ name: "Vasundhara Infotech" }],
  openGraph: {
    type: "website",
    url: siteUrl,
    siteName: "Vasundhara Infotech",
    title: "Vasundhara Infotech — Software Product Company",
    description:
      "We partner with businesses to build web, mobile and AI-powered products — from the first release through years of ongoing support.",
    images: [
      {
        url: "/og-image.png",
        width: 1200,
        height: 630,
        alt: "Vasundhara Infotech",
      },
    ],
  },
  twitter: {
    card: "summary_large_image",
    title: "Vasundhara Infotech — Software Product Company",
    description:
      "We partner with businesses to build web, mobile and AI-powered products that scale.",
    images: ["/og-image.png"],
  },
  alternates: {
    canonical: siteUrl,
  },
  icons: {
    icon: "/favicon.svg",
  },
  robots: {
    index: true,
    follow: true,
  },
};

const jsonLd = {
  "@context": "https://schema.org",
  "@type": "Organization",
  name: "Vasundhara Infotech",
  url: siteUrl,
  logo: `${siteUrl}/logo.svg`,
  foundingDate: "2013",
  address: [
    {
      "@type": "PostalAddress",
      streetAddress:
        "Opp. Nayara Petrol Pump, Singanpore Road, Katargam",
      addressLocality: "Surat",
      postalCode: "395004",
      addressRegion: "Gujarat",
      addressCountry: "IN",
    },
    {
      "@type": "PostalAddress",
      streetAddress: "22 Liberty Ave APT 3A",
      addressLocality: "Jersey City",
      addressRegion: "NJ",
      postalCode: "07306-5874",
      addressCountry: "US",
    },
  ],
  sameAs: [
    "https://www.linkedin.com/company/vasundhara-infotech/",
    "https://www.youtube.com/@vasundharainfotech",
    "https://www.instagram.com/vasundhara.infotech/",
    "https://www.facebook.com/vasundharainfotech/",
    "https://twitter.com/vasundharainfo",
  ],
  aggregateRating: {
    "@type": "AggregateRating",
    ratingValue: "4.9",
    reviewCount: "300",
  },
};

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="en" data-scroll-behavior="smooth">
      <head>
        <script
          type="application/ld+json"
          dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
        />
      </head>
      <body className={`${inter.variable} ${spaceGrotesk.variable} ${jetbrainsMono.variable} antialiased`}>
        {children}
        <ScrollToTop />
      </body>
    </html>
  );
}
