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

export const lightTheme = createTheme({
  palette: {
    mode: 'light',
    primary: {
      main: '#a855f7',
      light: '#c084fc',
      dark: '#9333ea'
    },
    secondary: {
      main: '#3b82f6',
      light: '#60a5fa',
      dark: '#2563eb'
    },
    background: {
      default: '#F5F7FA',
      paper: 'rgba(255, 255, 255, 0.95)'
    },
    text: {
      primary: '#1A202C',
      secondary: '#718096'
    }
  },
  shape: {
    borderRadius: 12
  },
  typography: {
    fontSize: 13,
    fontFamily: '"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif',
    h1: { fontSize: '1.75rem', fontWeight: 700, lineHeight: 1.2 },
    h2: { fontSize: '1.5rem', fontWeight: 700, lineHeight: 1.2 },
    h3: { fontSize: '1.25rem', fontWeight: 600, lineHeight: 1.3 },
    h4: { fontSize: '1.125rem', fontWeight: 600, lineHeight: 1.3 },
    h5: { fontSize: '1rem', fontWeight: 600, lineHeight: 1.4 },
    h6: { fontSize: '0.875rem', fontWeight: 600, lineHeight: 1.4 },
    body1: { fontSize: '0.875rem', lineHeight: 1.5 },
    body2: { fontSize: '0.8125rem', lineHeight: 1.5 },
    button: { fontSize: '0.8125rem', fontWeight: 600, textTransform: 'none' },
    caption: { fontSize: '0.75rem', lineHeight: 1.4 }
  },
  spacing: 8,
  components: {
    MuiPaper: {
      styleOverrides: {
        root: {
          backgroundImage: 'none',
          backdropFilter: 'blur(10px)',
          boxShadow: '0 4px 16px 0 rgba(31, 38, 135, 0.12)'
        }
      }
    },
    MuiButton: {
      styleOverrides: {
        root: {
          textTransform: 'none',
          borderRadius: 8,
          padding: '6px 16px',
          fontSize: '0.8125rem',
          fontWeight: 600,
          minHeight: 32
        },
        contained: {
          boxShadow: '0 2px 8px rgba(33, 150, 243, 0.25)',
          '&:hover': {
            boxShadow: '0 4px 12px rgba(33, 150, 243, 0.35)'
          }
        },
        small: {
          padding: '4px 12px',
          fontSize: '0.75rem',
          minHeight: 28
        }
      }
    },
    MuiIconButton: {
      styleOverrides: {
        root: {
          padding: 6,
          backdropFilter: 'blur(10px)',
          backgroundColor: 'rgba(255, 255, 255, 0.8)',
          '&:hover': {
            backgroundColor: 'rgba(255, 255, 255, 0.95)'
          }
        },
        small: {
          padding: 4
        }
      }
    },
    MuiCard: {
      styleOverrides: {
        root: {
          borderRadius: 12,
          boxShadow: '0 4px 16px 0 rgba(31, 38, 135, 0.12)',
          backdropFilter: 'blur(10px)',
          backgroundColor: 'rgba(255, 255, 255, 0.95)'
        }
      }
    },
    MuiChip: {
      styleOverrides: {
        root: {
          height: 28,
          fontSize: '0.75rem'
        },
        small: {
          height: 24,
          fontSize: '0.6875rem'
        }
      }
    },
    MuiTextField: {
      styleOverrides: {
        root: {
          '& .MuiInputBase-root': {
            fontSize: '0.875rem'
          }
        }
      }
    },
    MuiListItem: {
      styleOverrides: {
        root: {
          paddingTop: 6,
          paddingBottom: 6
        }
      }
    },
    MuiListItemText: {
      styleOverrides: {
        primary: {
          fontSize: '0.875rem'
        },
        secondary: {
          fontSize: '0.75rem'
        }
      }
    }
  },
  typography: {
    fontFamily: '"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif',
    h1: {
      fontWeight: 700
    },
    h2: {
      fontWeight: 700
    },
    h3: {
      fontWeight: 600
    },
    button: {
      fontWeight: 600
    }
  }
});

export const darkTheme = createTheme({
  palette: {
    mode: 'dark',
    primary: {
      main: '#a855f7',
      light: '#c084fc',
      dark: '#9333ea'
    },
    secondary: {
      main: '#3b82f6',
      light: '#60a5fa',
      dark: '#2563eb'
    },
    background: {
      default: '#0F1419',
      paper: 'rgba(26, 32, 44, 0.95)'
    },
    text: {
      primary: '#F7FAFC',
      secondary: '#A0AEC0'
    }
  },
  shape: {
    borderRadius: 12
  },
  typography: {
    fontSize: 13,
    fontFamily: '"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif',
    h1: { fontSize: '1.75rem', fontWeight: 700, lineHeight: 1.2 },
    h2: { fontSize: '1.5rem', fontWeight: 700, lineHeight: 1.2 },
    h3: { fontSize: '1.25rem', fontWeight: 600, lineHeight: 1.3 },
    h4: { fontSize: '1.125rem', fontWeight: 600, lineHeight: 1.3 },
    h5: { fontSize: '1rem', fontWeight: 600, lineHeight: 1.4 },
    h6: { fontSize: '0.875rem', fontWeight: 600, lineHeight: 1.4 },
    body1: { fontSize: '0.875rem', lineHeight: 1.5 },
    body2: { fontSize: '0.8125rem', lineHeight: 1.5 },
    button: { fontSize: '0.8125rem', fontWeight: 600, textTransform: 'none' },
    caption: { fontSize: '0.75rem', lineHeight: 1.4 }
  },
  spacing: 8,
  components: {
    MuiPaper: {
      styleOverrides: {
        root: {
          backgroundImage: 'none',
          backdropFilter: 'blur(10px)',
          boxShadow: '0 4px 16px 0 rgba(0, 0, 0, 0.3)'
        }
      }
    },
    MuiButton: {
      styleOverrides: {
        root: {
          textTransform: 'none',
          borderRadius: 8,
          padding: '6px 16px',
          fontSize: '0.8125rem',
          fontWeight: 600,
          minHeight: 32
        },
        contained: {
          boxShadow: '0 2px 8px rgba(33, 150, 243, 0.25)',
          '&:hover': {
            boxShadow: '0 4px 12px rgba(33, 150, 243, 0.35)'
          }
        },
        small: {
          padding: '4px 12px',
          fontSize: '0.75rem',
          minHeight: 28
        }
      }
    },
    MuiIconButton: {
      styleOverrides: {
        root: {
          padding: 6,
          backdropFilter: 'blur(10px)',
          backgroundColor: 'rgba(26, 32, 44, 0.8)',
          '&:hover': {
            backgroundColor: 'rgba(26, 32, 44, 0.95)'
          }
        },
        small: {
          padding: 4
        }
      }
    },
    MuiCard: {
      styleOverrides: {
        root: {
          borderRadius: 12,
          boxShadow: '0 4px 16px 0 rgba(0, 0, 0, 0.3)',
          backdropFilter: 'blur(10px)',
          backgroundColor: 'rgba(26, 32, 44, 0.95)'
        }
      }
    },
    MuiChip: {
      styleOverrides: {
        root: {
          height: 28,
          fontSize: '0.75rem'
        },
        small: {
          height: 24,
          fontSize: '0.6875rem'
        }
      }
    },
    MuiTextField: {
      styleOverrides: {
        root: {
          '& .MuiInputBase-root': {
            fontSize: '0.875rem'
          }
        }
      }
    },
    MuiListItem: {
      styleOverrides: {
        root: {
          paddingTop: 6,
          paddingBottom: 6
        }
      }
    },
    MuiListItemText: {
      styleOverrides: {
        primary: {
          fontSize: '0.875rem'
        },
        secondary: {
          fontSize: '0.75rem'
        }
      }
    }
  },
  typography: {
    fontFamily: '"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif',
    h1: {
      fontWeight: 700
    },
    h2: {
      fontWeight: 700
    },
    h3: {
      fontWeight: 600
    },
    button: {
      fontWeight: 600
    }
  }
});
