import type { Metadata } from "next";
import { Oswald, Montserrat } from "next/font/google";
import "./globals.css";

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

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


export const metadata: Metadata = {
  metadataBase: new URL("https://www.setocar.com"),
  title: {
    default: "Setocar | Location de Voiture à Marrakech - Prix Pas Cher",
    template: "%s | Setocar Marrakech",
  },
  description:
    "Louez une voiture à Marrakech au meilleur prix. Flotte récente, assurance incluse, livraison aéroport Marrakech-Menara. Réservation rapide via WhatsApp.",
  keywords: [
    "location voiture marrakech",
    "car rental marrakech",
    "rent a car marrakech",
    "setocar",
    "location voiture marrakech aeroport",
    "voiture pas cher marrakech",
    "car hire marrakech",
  ],
  openGraph: {
    title: "Setocar | Location de Voiture à Marrakech",
    description:
      "Louez une voiture à Marrakech au meilleur prix. Flotte récente, assurance incluse, livraison aéroport.",
    url: "https://www.setocar.com",
    siteName: "Setocar",
    locale: "fr_MA",
    type: "website",
    images: [
      {
        url: "/og-image.png",
        width: 1200,
        height: 630,
        alt: "Setocar - Location de Voiture Marrakech",
      },
    ],
  },
  twitter: {
    card: "summary_large_image",
    title: "Setocar | Location de Voiture Marrakech",
    description: "Location de voiture à Marrakech - Prix compétitifs, flotte récente.",
  },
  robots: {
    index: true,
    follow: true,
    googleBot: {
      index: true,
      follow: true,
      "max-video-preview": -1,
      "max-image-preview": "large",
      "max-snippet": -1,
    },
  },
  alternates: {
    canonical: "https://www.setocar.com",
    languages: {
      "fr-MA": "https://www.setocar.com",
      "en-US": "https://www.setocar.com/en",
      "ar-MA": "https://www.setocar.com/ar",
    },
  },
  manifest: "/manifest.json",
  icons: {
    icon: "/favicon.ico",
    apple: "/apple-touch-icon.png",
  },
};

const jsonLd = {
  "@context": "https://schema.org",
  "@graph": [
    {
      "@type": "LocalBusiness",
      "@id": "https://www.setocar.com/#business",
      name: "Setocar - Location de Voiture Marrakech",
      url: "https://www.setocar.com",
      telephone: "+212600000000",
      email: "contact@setocar.com",
      image: "https://www.setocar.com/hero.png",
      description:
        "Agence de location de voitures à Marrakech. Flotte récente, assurance incluse, livraison à l'aéroport Marrakech-Menara.",
      address: {
        "@type": "PostalAddress",
        streetAddress: "Avenue Mohammed VI",
        addressLocality: "Marrakech",
        postalCode: "40000",
        addressCountry: "MA",
      },
      geo: {
        "@type": "GeoCoordinates",
        latitude: 31.6295,
        longitude: -7.9811,
      },
      openingHoursSpecification: [
        {
          "@type": "OpeningHoursSpecification",
          dayOfWeek: ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],
          opens: "08:00",
          closes: "22:00",
        },
      ],
      priceRange: "$$",
      aggregateRating: {
        "@type": "AggregateRating",
        ratingValue: "4.9",
        reviewCount: "247",
        bestRating: "5",
        worstRating: "1",
      },
      sameAs: [
        "https://www.facebook.com/setocar",
        "https://www.instagram.com/setocar",
      ],
    },
    {
      "@type": "CarRental",
      "@id": "https://www.setocar.com/#carrental",
      name: "Setocar Car Rental Marrakech",
      url: "https://www.setocar.com",
      image: "https://www.setocar.com/hero.png",
      description: "Premium car rental service in Marrakech, Morocco",
      areaServed: {
        "@type": "City",
        name: "Marrakech",
        sameAs: "https://www.wikidata.org/wiki/Q101625",
      },
      hasOfferCatalog: {
        "@type": "OfferCatalog",
        name: "Car Rental Fleet Marrakech",
      },
    },
  ],
};

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="fr" dir="ltr">
      <head>
        <script
          type="application/ld+json"
          dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
        />
        <link rel="preconnect" href="https://fonts.googleapis.com" />
        <link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />
        <meta name="theme-color" content="#1a3c6b" />
        <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
      </head>
      <body className={`${oswald.variable} ${montserrat.variable}`}>
        {children}
      </body>
    </html>
  );
}
