import { BrowserRouter as Router, Routes, Route, Navigate } from 'react-router-dom'
import HomePage from './pages/HomePage'
import Login from './pages/Login'
import Signup from './pages/Signup'
import Dashboard from './pages/Dashboard'
import Reports from './pages/Reports'
import ReportSummary from './pages/ReportSummary'
import HealthProfile from './pages/HealthProfile'
import Settings from './pages/Settings'
import Recommendations from './pages/Recommendations'
import Medicines from './pages/Medicines'
import VoiceAgent from './pages/VoiceAgent'
import Features from './pages/Features'
import PhysicsTwin from './pages/PhysicsTwin'
import ProtectedRoute from './components/ProtectedRoute'
import './App.css'

function App() {
  return (
    <Router>
      <Routes>
        <Route path="/" element={<HomePage />} />
        <Route path="/login" element={<Login />} />
        <Route path="/signup" element={<Signup />} />
        <Route
          path="/dashboard"
          element={
            <ProtectedRoute>
              <Dashboard />
            </ProtectedRoute>
          }
        />
        <Route
          path="/reports"
          element={
            <ProtectedRoute>
              <Reports />
            </ProtectedRoute>
          }
        />
        <Route
          path="/report-summary"
          element={
            <ProtectedRoute>
              <ReportSummary />
            </ProtectedRoute>
          }
        />
        <Route
          path="/recommendations"
          element={
            <ProtectedRoute>
              <Recommendations />
            </ProtectedRoute>
          }
        />
        <Route
          path="/medicines"
          element={
            <ProtectedRoute>
              <Medicines />
            </ProtectedRoute>
          }
        />
        <Route
          path="/voice-agent"
          element={
            <ProtectedRoute>
              <VoiceAgent />
            </ProtectedRoute>
          }
        />
        <Route
          path="/physics-twin"
          element={
            <ProtectedRoute>
              <PhysicsTwin />
            </ProtectedRoute>
          }
        />
        <Route
          path="/health-profile"
          element={
            <ProtectedRoute>
              <HealthProfile />
            </ProtectedRoute>
          }
        />
        <Route
          path="/features"
          element={
            <ProtectedRoute>
              <Features />
            </ProtectedRoute>
          }
        />
        <Route
          path="/settings"
          element={
            <ProtectedRoute>
              <Settings />
            </ProtectedRoute>
          }
        />
        {/* Catch-all: redirect unknown routes to home */}
        <Route path="*" element={<Navigate to="/" replace />} />
      </Routes>
    </Router>
  )
}

export default App
