export interface BlockBackground {
  type: 'image' | 'gradient' | 'color';
  url?: string;
  colors?: string[];
  overlay?: string;
}

export interface BlockButton {
  id: string;
  type: 'square' | 'rectangle';
  background: BlockBackground;
  title: string;
  subtitle?: string;
  icon?: string;
  imageUrl?: string;
  color?: string;
  action?: {
    type: 'route' | 'function' | 'selectStyle' | 'selectPreset';
    value: string;
  };
  disabled?: boolean;
}

export interface ButtonBlockStyle {
  gap: number;
  padding: number | string;
  buttonSize: number;
  columns?: number;
}

export interface UploadPhotoBlockStyle {
  padding?: number | string;
}

export interface DividerBlockStyle {
  margin?: number | string;
}

export interface TextInputBlockStyle {
  padding?: number | string;
}

export interface TextInputBlock {
  type: 'textInput';
  id: string;
  style?: TextInputBlockStyle;
}

export interface UploadPhotoBlock {
  type: 'uploadPhoto';
  id: string;
  style?: UploadPhotoBlockStyle;
}

export interface DividerBlock {
  type: 'divider';
  id: string;
  style?: DividerBlockStyle;
}

export interface ButtonBlock {
  type: 'scrollableButtons' | 'gridButtons';
  id: string;
  buttons: BlockButton[];
  style: ButtonBlockStyle;
}

export interface GenerateButtonBlock {
  type: 'generateButton';
  id: string;
  tokenCount: number;
}

export interface StepTitleBlock {
  type: 'stepTitle';
  id: string;
  number: number;
  text: string;
}

export interface Block {
  type: 'scrollableButtons' | 'gridButtons' | 'uploadPhoto' | 'divider' | 'textInput' | 'generateButton' | 'stepTitle';
  id: string;
  buttons?: BlockButton[];
  style?: ButtonBlockStyle | UploadPhotoBlockStyle | DividerBlockStyle | TextInputBlockStyle;
  tokenCount?: number;
  number?: number;
  text?: string;
}

export interface ScreenConfig {
  blocks: Block[];
}

export interface AppConfig {
  homeScreen: ScreenConfig;
}
