import { createBrowserRouter } from "react-router-dom";
import { LandingPage } from "@/pages/LandingPage";

// Documentation site — shared pages, zero code duplication
import { DocLayout } from "@docs/DocLayout";
import { DocsHomePage } from "@docs/DocsHomePage";
import { WhatIsVeylantPage } from "@docs/getting-started/WhatIsVeylantPage";
import { QuickStartPage } from "@docs/getting-started/QuickStartPage";
import { KeyConceptsPage } from "@docs/getting-started/KeyConceptsPage";
import { DockerComposePage } from "@docs/installation/DockerComposePage";
import { ConfigurationPage } from "@docs/installation/ConfigurationPage";
import { ProvidersPage } from "@docs/installation/ProvidersPage";
import { AuthenticationPage } from "@docs/api-reference/AuthenticationPage";
import { ChatCompletionsPage } from "@docs/api-reference/ChatCompletionsPage";
import { PiiAnalysisPage } from "@docs/api-reference/PiiAnalysisPage";
import { AdminPoliciesPage } from "@docs/api-reference/AdminPoliciesPage";
import { AdminUsersPage } from "@docs/api-reference/AdminUsersPage";
import { AdminLogsPage } from "@docs/api-reference/AdminLogsPage";
import { AdminCompliancePage } from "@docs/api-reference/AdminCompliancePage";
import { AdminFlagsPage } from "@docs/api-reference/AdminFlagsPage";
import { PiiGuide } from "@docs/guides/PiiGuide";
import { RoutingGuide } from "@docs/guides/RoutingGuide";
import { RbacGuide } from "@docs/guides/RbacGuide";
import { ComplianceGuide } from "@docs/guides/ComplianceGuide";
import { MonitoringGuide } from "@docs/guides/MonitoringGuide";
import { CircuitBreakerGuide } from "@docs/guides/CircuitBreakerGuide";
import { DockerPage } from "@docs/deployment/DockerPage";
import { KubernetesPage } from "@docs/deployment/KubernetesPage";
import { BlueGreenPage } from "@docs/deployment/BlueGreenPage";
import { SecurityModelPage } from "@docs/security/SecurityModelPage";
import { ApiKeysPage } from "@docs/security/ApiKeysPage";
import { ChangelogPage } from "@docs/ChangelogPage";

export const router = createBrowserRouter([
  {
    path: "/",
    element: <LandingPage />,
  },
  // Documentation site — public, no auth
  {
    path: "/docs",
    element: <DocLayout />,
    children: [
      { index: true, element: <DocsHomePage /> },
      // Getting Started
      { path: "getting-started/what-is-veylant", element: <WhatIsVeylantPage /> },
      { path: "getting-started/quick-start", element: <QuickStartPage /> },
      { path: "getting-started/concepts", element: <KeyConceptsPage /> },
      // Installation
      { path: "installation/docker", element: <DockerComposePage /> },
      { path: "installation/configuration", element: <ConfigurationPage /> },
      { path: "installation/providers", element: <ProvidersPage /> },
      // API Reference
      { path: "api/authentication", element: <AuthenticationPage /> },
      { path: "api/chat-completions", element: <ChatCompletionsPage /> },
      { path: "api/pii", element: <PiiAnalysisPage /> },
      { path: "api/admin/policies", element: <AdminPoliciesPage /> },
      { path: "api/admin/users", element: <AdminUsersPage /> },
      { path: "api/admin/logs", element: <AdminLogsPage /> },
      { path: "api/admin/compliance", element: <AdminCompliancePage /> },
      { path: "api/admin/flags", element: <AdminFlagsPage /> },
      // Guides
      { path: "guides/pii", element: <PiiGuide /> },
      { path: "guides/routing", element: <RoutingGuide /> },
      { path: "guides/rbac", element: <RbacGuide /> },
      { path: "guides/compliance", element: <ComplianceGuide /> },
      { path: "guides/monitoring", element: <MonitoringGuide /> },
      { path: "guides/circuit-breaker", element: <CircuitBreakerGuide /> },
      // Deployment
      { path: "deployment/docker", element: <DockerPage /> },
      { path: "deployment/kubernetes", element: <KubernetesPage /> },
      { path: "deployment/blue-green", element: <BlueGreenPage /> },
      // Security
      { path: "security/model", element: <SecurityModelPage /> },
      { path: "security/api-keys", element: <ApiKeysPage /> },
      // Changelog
      { path: "changelog", element: <ChangelogPage /> },
    ],
  },
]);
