import { createTheme } from '@mui/material/styles'

export function createAppTheme(mode: 'dark' | 'light') {
  return createTheme({
    palette: {
      mode,
      primary:   { main: '#7C6AF7' },
      secondary: { main: '#9C89F6' },
      success:   { main: '#71DD37' },
      warning:   { main: '#FFAB00' },
      info:      { main: '#03C3EC' },
      error:     { main: '#FF3E1D' },
      background: mode === 'dark'
        ? { default: '#1A1A2E', paper: '#25293C' }
        : { default: '#E9EBF7', paper: '#FFFFFF' },
      text: mode === 'dark'
        ? { primary: '#D0D4E4', secondary: '#8A92A3' }
        : { primary: '#2F3349', secondary: '#6D7175' },
    },
    typography: {
      fontFamily: '"Public Sans", system-ui, sans-serif',
      fontSize: 15,          // base up from MUI default 14
      htmlFontSize: 16,
      h1:       { fontSize: '2.5rem',   fontWeight: 700 },
      h2:       { fontSize: '2rem',     fontWeight: 700 },
      h3:       { fontSize: '1.75rem',  fontWeight: 700 },
      h4:       { fontSize: '1.5rem',   fontWeight: 700 },
      h5:       { fontSize: '1.25rem',  fontWeight: 700 },
      h6:       { fontSize: '1.1rem',   fontWeight: 700 },
      subtitle1:{ fontSize: '1rem',     fontWeight: 600 },
      subtitle2:{ fontSize: '0.925rem', fontWeight: 600 },
      body1:    { fontSize: '0.975rem' },
      body2:    { fontSize: '0.9rem'   },
      caption:  { fontSize: '0.825rem' },
      button:   { fontSize: '0.9rem',   fontWeight: 600, textTransform: 'none' },
      overline: { fontSize: '0.775rem', letterSpacing: '0.08em' },
    },
    shape: { borderRadius: 8 },
    components: {
      MuiCard: {
        styleOverrides: { root: { backgroundImage: 'none' } },
      },
    },
  })
}

export default createAppTheme('dark')
