import type { Metadata } from "next";
import { Halant } from "next/font/google";
import { Inter } from "next/font/google";
import { Open_Sans } 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 openSans = Open_Sans({
  variable: "--font-open-sans",
  subsets: ["latin"],
});

export const metadata: Metadata = {
  title: "FitnessaCollective - Mumbai's Premier Fitness Ecosystem | Book Trainers & Events",
  description: "Discover Mumbai's unified fitness platform. Book verified personal trainers, find exclusive fitness events, and join vibrant running clubs all in one premium ecosystem.",
  keywords: "fitness trainers Mumbai, book trainer online, fitness events Mumbai, running clubs Mumbai, personal training, fitness platform, wellness",
  metadataBase: new URL("https://fitnessacollective.com"),
  alternates: {
    canonical: "https://fitnessacollective.com",
  },
  openGraph: {
    title: "FitnessaCollective - Mumbai's Unified Fitness Ecosystem",
    description: "Connect with elite fitness professionals, discover exciting events, and build your fitness community on FitnessaCollective.",
    url: "https://fitnessacollective.com",
    siteName: "FitnessaCollective",
    type: "website",
    images: [
      {
        url: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3B8SAGkNg6dDslfeJ9cLBIp5dqh/a-professional-personal-trainer-conducti-1773869257907-f7c81841.png",
        alt: "FitnessaCollective premium fitness platform",
      },
    ],
  },
  twitter: {
    card: "summary_large_image",
    title: "FitnessaCollective - Book Trainers & Find Events",
    description: "Mumbai's premier fitness ecosystem connecting trainers, events, and communities.",
    images: [
      "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3B8SAGkNg6dDslfeJ9cLBIp5dqh/a-professional-personal-trainer-conducti-1773869257907-f7c81841.png",
    ],
  },
  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} ${openSans.variable} antialiased`}
        >
          <Tag />
          {children}
          <script
              dangerouslySetInnerHTML={{
                  __html: `${getVisualEditScript()}`
          }}
        />
        </body>
      </ServiceWrapper>
    </html>
  );
}