import type { Metadata, Viewport } from "next";
import "./globals.css";

const SITE_URL = "https://forex.kenvoracapital.com";

export const metadata: Metadata = {
  metadataBase: new URL(process.env.NEXT_PUBLIC_SITE_URL || SITE_URL),
  title: "Best Forex Broker | kenvoracapital — 0 ECN Spreads & Instant IB Rebates",
  description:
    "Looking for the Best Forex Broker? Trade with kenvoracapital (forex.kenvoracapital.com) — FSA, CySEC & FSCA registered with 15 years of service, 0 ECN spreads, Low Fixed STP accounts, low slippage, INR payment support, instant deposits & withdrawals, and instant IB rebate credit upon trade closure.",
  keywords: [
    "Best Forex Broker",
    "Best Forex Broker in India",
    "Best Forex Broker for Gold Scalpers",
    "kenvoracapital",
    "forex.kenvoracapital.com",
    "0 ECN Spread Account",
    "Low Fixed Spread STP",
    "Instant IB Rebates",
    "EA-Supportive Broker",
    "Copy Trading Broker",
    "INR Payment Support Forex Broker",
    "FSA CySEC FSCA Regulated Broker",
  ],
  authors: [{ name: "kenvoracapital", url: SITE_URL }],
  creator: "kenvoracapital",
  publisher: "kenvoracapital",
  alternates: {
    canonical: SITE_URL,
  },
  robots: {
    index: true,
    follow: true,
    googleBot: {
      index: true,
      follow: true,
      "max-video-preview": -1,
      "max-image-preview": "large",
      "max-snippet": -1,
    },
  },
  openGraph: {
    title: "Best Forex Broker | kenvoracapital — Regulated Forex & Gold Broker",
    description:
      "Best Forex Broker for Gold scalpers, EA-based trading & Copy Trading providers. 0 ECN spreads, Low Fixed STP, INR payment support & instant IB rebate credit upon trade closure.",
    url: SITE_URL,
    type: "website",
    locale: "en_IN",
    siteName: "kenvoracapital",
    images: [
      {
        url: "/kenvora-capital-logo.png",
        width: 1200,
        height: 630,
        alt: "kenvoracapital — Best Forex Broker",
      },
    ],
  },
  twitter: {
    card: "summary_large_image",
    title: "Best Forex Broker | kenvoracapital",
    description:
      "FSA, CySEC & FSCA registered forex broker with 15 years of service, 0 ECN spreads, INR funding, and instant trade-close IB rebates.",
    images: ["/kenvora-capital-logo.png"],
  },
  icons: {
    icon: "/favicon.ico",
  },
};

export const viewport: Viewport = {
  width: "device-width",
  initialScale: 1,
  maximumScale: 5,
  themeColor: "#059669",
  colorScheme: "light",
};

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  const jsonLd = {
    "@context": "https://schema.org",
    "@graph": [
      {
        "@type": "WebSite",
        "@id": `${SITE_URL}/#website`,
        url: SITE_URL,
        name: "kenvoracapital",
        description:
          "Best Forex Broker for Gold Scalpers, EA-Based Trading & Copy Trading Providers with Instant IB Rebates Upon Trade Closure.",
        inLanguage: "en",
      },
      {
        "@type": "FinancialService",
        "@id": `${SITE_URL}/#organization`,
        name: "kenvoracapital",
        url: SITE_URL,
        logo: `${SITE_URL}/kenvora-capital-logo.png`,
        image: `${SITE_URL}/kenvora-capital-logo.png`,
        description:
          "FSA, CySEC & FSCA registered multi-asset Forex & Gold broker with 15 years of service, offering 0 ECN spread accounts, Low Fixed Spread STP accounts, low slippage, INR payment support, instant deposits & withdrawals, and instant IB rebate credit upon trade closure.",
        foundingDate: "2011",
        areaServed: ["IN", "AE", "GB", "SG", "MY", "AU", "ZA"],
        aggregateRating: {
          "@type": "AggregateRating",
          ratingValue: "4.9",
          reviewCount: "2400",
          bestRating: "5",
          worstRating: "1",
        },
        hasOfferCatalog: {
          "@type": "OfferCatalog",
          name: "kenvoracapital Trading Accounts",
          itemListElement: [
            {
              "@type": "Offer",
              itemOffered: {
                "@type": "Service",
                name: "Low Fixed Spread STP Account",
                description:
                  "Low fixed spread on STP accounts with $0 commission, INR payment support, and low slippage.",
              },
            },
            {
              "@type": "Offer",
              itemOffered: {
                "@type": "Service",
                name: "0 ECN Spread Account",
                description:
                  "0.0 pip raw ECN spread account engineered for Gold scalpers, EA-based trading, and instant rebate credit upon trade closure.",
              },
            },
            {
              "@type": "Offer",
              itemOffered: {
                "@type": "Service",
                name: "IB & Copy Trading Pro Account",
                description:
                  "High IB rebates, IB Incentive Program, Copy Trading support, and free Gold market education & marketing materials.",
              },
            },
          ],
        },
      },
      {
        "@type": "FAQPage",
        "@id": `${SITE_URL}/#faq`,
        mainEntity: [
          {
            "@type": "Question",
            name: "Which is the best forex broker for Gold scalpers, EAs, and Copy Trading?",
            acceptedAnswer: {
              "@type": "Answer",
              text: "kenvoracapital (forex.kenvoracapital.com) is engineered as an EA-supportive, low-slippage broker for Gold scalpers, EA-based trading, and Copy Trading providers — offering 0 ECN spread accounts, Low Fixed Spread STP accounts, and instant IB rebate credit upon trade closure.",
            },
          },
          {
            "@type": "Question",
            name: "How does instant rebate credit upon trade closure work?",
            acceptedAnswer: {
              "@type": "Answer",
              text: "Unlike brokers that delay IB commissions for weekly or monthly settlements, kenvoracapital credits High IB Rebates directly into your wallet the exact second a trade closes — supporting instant cashflow for traders, Gold scalpers, and Introducing Brokers.",
            },
          },
          {
            "@type": "Question",
            name: "Is kenvoracapital regulated and how long has it been operating?",
            acceptedAnswer: {
              "@type": "Answer",
              text: "Yes. kenvoracapital is backed by 15 years of service and high-authority regulation as an FSA, CySEC & FSCA registered broker, with segregated client funds and negative balance protection.",
            },
          },
          {
            "@type": "Question",
            name: "Does kenvoracapital support INR deposits and instant withdrawals?",
            acceptedAnswer: {
              "@type": "Answer",
              text: "Yes. kenvoracapital provides full INR payment support alongside cards, SWIFT/SEPA bank wires, and USDT rails with automated instant deposits and withdrawals.",
            },
          },
          {
            "@type": "Question",
            name: "What support and Gold education do IB partners and traders receive?",
            acceptedAnswer: {
              "@type": "Answer",
              text: "Every client and IB partner receives a Personalised Customer Manager, Daily Market Analysis, Free Education on the Gold Market & Marketing Materials, and access to the tiered IB Incentive Program.",
            },
          },
        ],
      },
    ],
  };

  return (
    <html lang="en" className="h-full scroll-smooth">
      <head>
        <script
          type="application/ld+json"
          dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
        />
      </head>
      <body className="min-h-full flex flex-col font-sans bg-white text-slate-900 antialiased selection:bg-emerald-500 selection:text-white">
        {children}
      </body>
    </html>
  );
}
