import { createBrowserRouter } from 'react-router-dom'
import RootLayout from './layout/RootLayout'
import Home from '@/pages/Home/Home'
import ReportDetail from '@/pages/ReportDetail/ReportDetail'
import Market from '@/pages/Market/Market'
import Subscribe from '@/pages/Subscribe/Subscribe'
import Events from '@/pages/Events/Events'
import Team from '@/pages/Team/Team'
import Archive from '@/pages/Archive/Archive'
import Special from '@/pages/Special/Special'
import Risks from '@/pages/Risks/Risks'
import Scanner from '@/pages/Scanner/Scanner'
import Radar from '@/pages/Radar/Radar'
import RadarCategory from '@/pages/RadarCategory/RadarCategory'
import RadarPost from '@/pages/RadarPost/RadarPost'
import PostDetail from '@/pages/PostDetail/PostDetail'
import Technology from '@/pages/Technology/Technology'
import Pulse from '@/pages/Pulse/Pulse'
import Membership from '@/pages/Membership/Membership'
import Sustainability from '@/pages/Sustainability/Sustainability'
import Geopolitics from '@/pages/Geopolitics/Geopolitics'
import AtAGlance from '@/pages/AtAGlance/AtAGlance'
import Experts from '@/pages/Experts/Experts'
import Contact from '@/pages/Contact/Contact'
import About from '@/pages/About/About'
import AuthPage from '@/pages/Auth/AuthPage'
import ProfilePage from '@/pages/Profile/ProfilePage'
import Podcast from '@/pages/Podcast/Podcast'
import SpecializedMeetings from '@/pages/SpecializedMeetings/SpecializedMeetings'
import SteelDashboard from '@/pages/SteelDashboard/SteelDashboard'
import SearchResults from '@/pages/Search/SearchResults'
import Observe from '@/pages/Observe/Observe'
import Newstree from '@/pages/Newstree/Newstree'

export const router = createBrowserRouter([
  {
    path: '/',
    element: <RootLayout />,
    children: [
      { index: true,         element: <Home />         },
      { path: 'reports/:id', element: <ReportDetail /> },
      { path: 'market',      element: <Market />       },
      { path: 'subscribe',   element: <Subscribe />    },
      { path: 'events',      element: <Events />       },
      { path: 'team',        element: <Team />         },
      { path: 'archive',     element: <Archive />      },
      { path: 'search',      element: <SearchResults /> },
      { path: 'special',     element: <Special />      },
      { path: 'risks',       element: <Risks />        },
      { path: 'scanner',     element: <Scanner />      },
      { path: 'radar',          element: <Radar />          },
      { path: 'radar/:category', element: <RadarCategory />  },
      { path: 'radar/post/:id',  element: <RadarPost />      },
      { path: 'posts/:id',       element: <PostDetail />     },
      { path: 'technology',     element: <Technology />     },
      { path: 'pulse',          element: <Pulse />          },
      { path: 'sustainability', element: <Sustainability /> },
      { path: 'geopolitics',    element: <Geopolitics />    },
      { path: 'membership',     element: <Membership />     },
      { path: 'at-a-glance',    element: <AtAGlance />      },
      { path: 'experts',        element: <Experts />        },
      { path: 'contact',        element: <Contact />        },
      { path: 'about',          element: <About />          },
      { path: 'login',          element: <AuthPage defaultMode="login" />    },
      { path: 'register',       element: <AuthPage defaultMode="register" /> },
      { path: 'profile',        element: <ProfilePage />    },
      { path: 'podcast',         element: <Podcast />        },
      { path: 'specialized-meetings', element: <SpecializedMeetings /> },
      { path: 'steeldashboard',       element: <SteelDashboard />      },
    ],
  },
  // hidden test pages — not linked anywhere in nav. Reach via the URL directly.
  { path: '/observe', element: <Observe /> },
  { path: '/newstree', element: <Newstree /> },
])
