import type { Metadata, Viewport } from "next";
import { Providers } from "@/components/layout/Providers";
import { SiteChrome } from "@/components/layout/SiteChrome";
import "./globals.css";

export const metadata: Metadata = {
  title: {
    default: "Activate Abundanate — Unlock Your Potential",
    template: "%s | Activate Abundanate",
  },
  description:
    "Activate Abundanate helps you build better habits and unlock your full potential. Manage your subscription and access premium features.",
  keywords: ["activate abundanate", "habits", "productivity", "subscription", "premium"],
  authors: [{ name: "Activate Abundanate" }],
  creator: "Activate Abundanate",
  metadataBase: new URL(
    process.env.NEXT_PUBLIC_APP_URL || "https://app.activateabundanate.com",
  ),
  icons: {
    icon: "/favicon.ico",
  },
  openGraph: {
    type: "website",
    locale: "en_US",
    title: "Activate Abundanate — Unlock Your Potential",
    description:
      "Build better habits and unlock your full potential with Activate Abundanate.",
    siteName: "Activate Abundanate",
  },
};

export const viewport: Viewport = {
  themeColor: [
    { media: "(prefers-color-scheme: dark)", color: "#0a0a0a" },
    { media: "(prefers-color-scheme: light)", color: "#ffffff" },
  ],
  width: "device-width",
  initialScale: 1,
};

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en" suppressHydrationWarning>
      <body>
        <Providers>
          <SiteChrome>{children}</SiteChrome>
        </Providers>
      </body>
    </html>
  );
}
