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: "Trackfolio - Portfolio Tracker for Students & Beginners",
  description: "Track and manage your personal portfolio effortlessly. Organize projects, skills, goals, and achievements in one beautiful dashboard. Dark mode design, fully responsive.",
  keywords: "portfolio tracker, project management, skills tracker, portfolio builder, student portfolio, achievement tracker",
  metadataBase: new URL("https://trackfolio.io"),
  alternates: {
    canonical: "https://trackfolio.io",
  },
  openGraph: {
    title: "Trackfolio - Track Your Portfolio Like Never Before",
    description: "The modern portfolio management tool for students and beginners. Organize projects, track skills, and showcase achievements.",
    url: "https://trackfolio.io",
    siteName: "Trackfolio",
    images: [
      {
        url: "http://img.b2bpic.net/free-vector/user-panel-infographic-template-dashboard_23-2148378205.jpg",
        alt: "Trackfolio Dashboard",
      },
    ],
    type: "website",
  },
  twitter: {
    card: "summary_large_image",
    title: "Trackfolio - Portfolio Tracker",
    description: "Track and manage your personal portfolio with Trackfolio. Clean dark mode interface, easy organization, and beautiful showcase.",
    images: ["http://img.b2bpic.net/free-vector/user-panel-infographic-template-dashboard_23-2148378205.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} ${openSans.variable} antialiased`}
        >
          <Tag />
          {children}
          <script
              dangerouslySetInnerHTML={{
                  __html: `${getVisualEditScript()}`
          }}
        />
        </body>
      </ServiceWrapper>
    </html>
  );
}