import type { Metadata } from "next";
import { Noto_Kufi_Arabic } from "next/font/google";
import "@/app/globals.css";
import { APP_NAME } from "@/lib/constants";

const notoKufiArabic = Noto_Kufi_Arabic({
  subsets: ["arabic", "latin"],
  weight: "variable",
  display: "swap",
  variable: "--font-noto-kufi-arabic",
  fallback: ["Tahoma", "Arial", "sans-serif"]
});

export const metadata: Metadata = {
  metadataBase: new URL(process.env.NEXT_PUBLIC_APP_URL ?? "http://localhost:3000"),
  title: {
    default: `${APP_NAME} | رعاية موثوقة وشفافة`,
    template: `%s | ${APP_NAME}`
  },
  description: "منصة عربية آمنة لإدارة كفالة الأيتام ومتابعة المساهمات والتحويلات الشهرية بشفافية.",
  robots: {
    index: true,
    follow: true
  }
};

export default function RootLayout({ children }: Readonly<{ children: React.ReactNode }>) {
  return (
    <html lang="ar" dir="rtl" className={notoKufiArabic.variable}>
      <body>{children}</body>
    </html>
  );
}
