import type { Metadata } from "next";
import { Halant } from "next/font/google";
import { Inter } from "next/font/google";
import { Mulish } from "next/font/google";
import "./globals.css";
import { ServiceWrapper } from "@/components/ServiceWrapper";
import Tag from "@/tag/Tag";
import { getVisualEditScript } from "@/utils/visual-edit-script";

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

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

const mulish = Mulish({
  variable: "--font-mulish",
  subsets: ["latin"],
});

export const metadata: Metadata = {
  title: "FitMumbai - Mumbai's Premium Unified Fitness Ecosystem",
  description: "Book verified personal trainers, discover curated fitness events, and join local running communities in Mumbai. All-in-one premium fitness platform.",
  keywords: "fitness trainers mumbai, gym events, running clubs, personal training, online fitness platform",
  metadataBase: new URL("https://fitmumbai.com"),
  alternates: {
    canonical: "https://fitmumbai.com",
  },
  openGraph: {
    title: "FitMumbai - Your Complete Fitness Companion",
    description: "Connect with verified trainers, join fitness events, and find your running community in Mumbai",
    url: "https://fitmumbai.com",
    siteName: "FitMumbai",
    type: "website",
    images: [
      {
        url: "https://fitmumbai.com/og-image.jpg",
        alt: "FitMumbai - Premium Fitness Ecosystem",
      },
    ],
  },
  twitter: {
    card: "summary_large_image",
    title: "FitMumbai - Mumbai's Unified Fitness Ecosystem",
    description: "Book trainers, join events, find running communities - all in one premium platform",
    images: ["https://fitmumbai.com/twitter-image.jpg"],
  },
  robots: {
    index: true,
    follow: true,
  },
};

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="en" suppressHydrationWarning>
      <ServiceWrapper>
        <body
          className={`${halant.variable} ${inter.variable} ${mulish.variable} antialiased`}
        >
          <Tag />
          {children}
          <script
              dangerouslySetInnerHTML={{
                  __html: `${getVisualEditScript()}`
          }}
        />
        </body>
      </ServiceWrapper>
    </html>
  );
}