import type { Metadata } from "next";
import { Inter, JetBrains_Mono } from "next/font/google";
import "./globals.css";
import { ThemeProvider } from "@/components/theme-provider";
import { Footer } from "@/components/footer";
import { LoadingScreen } from "@/components/loading-screen";
import { ErrorBoundary } from "@/components/error-boundary";

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

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

export const metadata: Metadata = {
  title: "Cihat Cengiz · Digital Ventures & Systems",
  description: "Yazılım, e-ticaret ve dijital ürünler üzerine çalışan girişimci.",
  keywords: [
    "Cihat Cengiz",
    "dijital girişimci",
    "yazılım",
    "e-ticaret",
    "web tasarım",
    "dijital ürünler",
    "İstanbul",
  ],
  authors: [{ name: "Cihat Cengiz" }],
  creator: "Cihat Cengiz",
  publisher: "Cihat Cengiz",
  metadataBase: new URL("https://cihat.org"),
  openGraph: {
    title: "Cihat Cengiz · Digital Ventures & Systems",
    description: "Yazılım, e-ticaret ve dijital ürünler üzerine çalışan girişimci.",
    type: "website",
    locale: "tr_TR",
    siteName: "Cihat Cengiz",
  },
  twitter: {
    card: "summary_large_image",
    title: "Cihat Cengiz · Digital Ventures & Systems",
    description: "Yazılım, e-ticaret ve dijital ürünler üzerine çalışan girişimci.",
  },
  robots: {
    index: true,
    follow: true,
    googleBot: {
      index: true,
      follow: true,
      "max-video-preview": -1,
      "max-image-preview": "large",
      "max-snippet": -1,
    },
  },
  verification: {
    // Google Search Console için
    // google: "your-verification-code",
  },
};

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="tr" suppressHydrationWarning>
      <body
        className={`${inter.variable} ${jetbrainsMono.variable} font-sans antialiased`}
      >
        <ThemeProvider>
          <ErrorBoundary>
            <LoadingScreen />
            <div className="flex flex-col min-h-screen overflow-x-hidden">
              <main className="flex-1 overflow-x-hidden">{children}</main>
              <Footer />
            </div>
          </ErrorBoundary>
        </ThemeProvider>
      </body>
    </html>
  );
}

