import { 
  Activity, 
  Truck, 
  HeartPulse, 
  Hospital, 
  PieChart, 
  Users, 
  Settings, 
  ShieldCheck, 
  LayoutDashboard,
  Monitor,
  Database,
  Zap,
  PhoneCall,
  Navigation,
  ShoppingCart,
  LayoutGrid,
  Video,
  FileText,
  TrendingUp
} from 'lucide-react';

export interface NavItem {
  id: string;
  label: string;
  icon: any;
  path: string;
  roles: string[];
  subItems?: NavItem[];
  portalContext?: string; // If set, this item and its sub-items belong to a specific portal
}

export const NAVIGATION_CONFIG: NavItem[] = [
  { 
    id: 'launcher', 
    label: 'Portal Hub', 
    icon: Monitor, 
    path: '/launcher', 
    roles: ['CURESELECT_ADMIN'] 
  },
  { 
    id: 'overview', 
    label: 'Dashboard', 
    icon: LayoutDashboard, 
    path: '/', 
    roles: ['CURESELECT_ADMIN', 'HOSPITAL_ADMIN'] 
  },
  { 
    id: 'incidents', 
    label: 'Incident Command', 
    icon: Activity, 
    path: '/incidents', 
    roles: ['CURESELECT_ADMIN', 'PILOT', 'COORDINATOR'] 
  },
  { 
    id: 'caller', 
    label: 'Caller Portal', 
    icon: PhoneCall, 
    path: '/caller', 
    roles: ['CURESELECT_ADMIN', 'CALLER'] 
  },
  { 
    id: 'fleet-operator', 
    label: 'Fleet Command', 
    icon: Zap, 
    path: '/fleet-operator', 
    roles: ['CURESELECT_ADMIN', 'FLEET_OPERATOR'],
    subItems: [
      { id: 'fleet-overview', label: 'Command Center', icon: LayoutGrid, path: '/fleet-operator?tab=overview', roles: ['CURESELECT_ADMIN', 'FLEET_OPERATOR'] },
      { id: 'fleet-assets', label: 'Fleet Assets', icon: Truck, path: '/fleet-operator?tab=assets', roles: ['CURESELECT_ADMIN', 'FLEET_OPERATOR'] },
      { id: 'fleet-personnel', label: 'Personnel Hub', icon: Users, path: '/fleet-operator?tab=personnel', roles: ['CURESELECT_ADMIN', 'FLEET_OPERATOR'] },
      { id: 'fleet-mission', label: 'Mission Control', icon: Navigation, path: '/fleet-operator?tab=scheduling', roles: ['CURESELECT_ADMIN', 'FLEET_OPERATOR'] },
      { id: 'fleet-inventory', label: 'Supply Chain', icon: ShoppingCart, path: '/fleet-operator?tab=inventory', roles: ['CURESELECT_ADMIN', 'FLEET_OPERATOR'] },
      { id: 'fleet-intel', label: 'Fleet Intel', icon: Activity, path: '/fleet-operator?tab=analytics', roles: ['CURESELECT_ADMIN', 'FLEET_OPERATOR'] },
    ]
  },
  { 
    id: 'clinical', 
    label: 'Clinical Intelligence', 
    icon: HeartPulse, 
    path: '/clinical', 
    roles: ['CURESELECT_ADMIN', 'HOSPITAL_ADMIN', 'ED_DOCTOR', 'EMT'] 
  },
  { 
    id: 'hospitals', 
    label: 'Hospital Network', 
    icon: Hospital, 
    path: '/hospitals', 
    roles: ['CURESELECT_ADMIN'] 
  },
  { 
    id: 'hospital-console', 
    label: 'Hospital Ops', 
    icon: Monitor, 
    path: '/hospital-console', 
    roles: ['CURESELECT_ADMIN', 'HOSPITAL_ADMIN', 'ED_DOCTOR', 'COORDINATOR', 'EMT'],
    subItems: [
      { id: 'hosp-ed', label: 'ED Monitor', icon: Monitor, path: '/hospital-console?tab=ED_MONITOR', roles: ['CURESELECT_ADMIN', 'HOSPITAL_ADMIN', 'ED_DOCTOR', 'COORDINATOR', 'EMT'] },
      { id: 'hosp-bookings', label: 'Trip Management', icon: Activity, path: '/hospital-console?tab=BOOKINGS', roles: ['CURESELECT_ADMIN', 'HOSPITAL_ADMIN', 'ED_DOCTOR', 'COORDINATOR', 'EMT'] },
      { id: 'hosp-fleet', label: 'Fleet Visibility', icon: Truck, path: '/hospital-console?tab=FLEET', roles: ['CURESELECT_ADMIN', 'HOSPITAL_ADMIN', 'ED_DOCTOR', 'COORDINATOR', 'EMT'] },
      { id: 'hosp-telelink', label: 'TeleLink Hub', icon: Video, path: '/hospital-console?tab=TELELINK', roles: ['CURESELECT_ADMIN', 'HOSPITAL_ADMIN', 'ED_DOCTOR', 'COORDINATOR', 'EMT'] },
      { id: 'hosp-epcr', label: 'ePCR Records', icon: FileText, path: '/hospital-console?tab=EPCR', roles: ['CURESELECT_ADMIN', 'HOSPITAL_ADMIN', 'ED_DOCTOR', 'COORDINATOR', 'EMT'] },
      { id: 'hosp-history', label: 'Patient Archive', icon: Database, path: '/hospital-console?tab=HISTORY', roles: ['CURESELECT_ADMIN', 'HOSPITAL_ADMIN', 'ED_DOCTOR', 'COORDINATOR', 'EMT'] },
      { id: 'hosp-reports', label: 'Analytics', icon: TrendingUp, path: '/hospital-console?tab=REPORTS', roles: ['CURESELECT_ADMIN', 'HOSPITAL_ADMIN', 'ED_DOCTOR', 'COORDINATOR', 'EMT'] },
      { id: 'hosp-referrals', label: 'Referral Hub', icon: Hospital, path: '/hospital-console?tab=REFERRALS', roles: ['CURESELECT_ADMIN', 'HOSPITAL_ADMIN', 'ED_DOCTOR', 'COORDINATOR', 'EMT'] },
      { id: 'hosp-setup', label: 'Account & Setup', icon: Settings, path: '/hospital-console?tab=SETUP', roles: ['CURESELECT_ADMIN', 'HOSPITAL_ADMIN', 'ED_DOCTOR', 'COORDINATOR', 'EMT'] },
    ]
  },
  { 
    id: 'master-data', 
    label: 'Platform Masters', 
    icon: Database, 
    path: '/master-data', 
    roles: ['CURESELECT_ADMIN'] 
  },
  { 
    id: 'analytics', 
    label: 'Business Intelligence', 
    icon: PieChart, 
    path: '/analytics', 
    roles: ['CURESELECT_ADMIN', 'HOSPITAL_ADMIN', 'STATION_INCHARGE'] 
  },
  { 
    id: 'users', 
    label: 'Identity & Access', 
    icon: Users, 
    path: '/users', 
    roles: ['CURESELECT_ADMIN'] 
  },
  { 
    id: 'config', 
    label: 'System Config', 
    icon: Settings, 
    path: '/config', 
    roles: ['CURESELECT_ADMIN'] 
  },
  { 
    id: 'compliance', 
    label: 'Audit & Compliance', 
    icon: ShieldCheck, 
    path: '/compliance', 
    roles: ['CURESELECT_ADMIN', 'HOSPITAL_ADMIN'] 
  },
  { 
    id: 'health', 
    label: 'Infrastructure Health', 
    icon: Zap, 
    path: '/health', 
    roles: ['CURESELECT_ADMIN'] 
  },
];
