package core

User_Mode :: enum {
	Casual,
	Professional,
}

Workflow_Step :: enum {
	Story_Input,
	Generating_Script,
	Script_Review,
	Character_Setup,
	Generating_Panels,
	Layout,
	Speech_Bubbles,
	Complete,
}

Export_Format :: enum {
	PDF,
	CBZ,
	PNG,
}

Page_Size_Name :: enum {
	A4,
	Letter,
	Manga,
	Webtoon,
	Square,
}

Color_Profile :: enum {
	RGB,
	CMYK,
}

Character_Role :: enum {
	Protagonist,
	Antagonist,
	Supporting,
	Extra,
}

Shot_Type :: enum {
	Establishing,
	Wide,
	Medium,
	Close_Up,
	Extreme_Close_Up,
	Over_Shoulder,
	Aerial,
}

Layout_Type :: enum {
	Grid,
	Manga,
	Western,
	Action,
	Dialogue,
	Splash,
}

Bubble_Type :: enum {
	Normal,
	Thought,
	Shout,
	Whisper,
	Narration,
	Sound_Effect,
}

Emotion :: enum {
	Happy,
	Sad,
	Angry,
	Surprised,
	Neutral,
	Determined,
}

Transition_Type :: enum {
	None,
	Fade,
	Wipe,
	Dissolve,
	Action_Lines,
}

Art_Style_Key :: enum {
	Manga,
	Western_Comic,
	Pixel_Art,
	Watercolor,
	Noir,
	Chibi,
	Sketch,
	Cyberpunk,
}

Position :: struct {
	x: f32,
	y: f32,
}

Size :: struct {
	width: f32,
	height: f32,
}

Character_Prompt_Template :: struct {
	age: string,
	gender: string,
	hair_color: string,
	hair_style: string,
	skin_tone: string,
	eye_color: string,
	body_type: string,
	outfit: string,
	accessories: string,
	distinguishing_features: string,
}

Color_Palette :: struct {
	hair: string,
	eyes: string,
	skin: string,
	outfit: string,
}

Character :: struct {
	id: string,
	name: string,
	role: Character_Role,
	description: string,
	prompt_template: Character_Prompt_Template,
	reference_image_url: string,
	character_sheet_urls: []string,
	seed: i64,
	color_palette: Color_Palette,
	appearance_count: int,
	first_appearance_panel: string,
}

Dialogue :: struct {
	speaker_id: string,
	text: string,
	bubble_type: Bubble_Type,
	emotion: Emotion,
}

Panel :: struct {
	panel_id: string,
	panel_number: int,
	shot_type: Shot_Type,
	description: string,
	characters_present: []string,
	dialogue: []Dialogue,
	caption: string,
	sound_effects: []string,
	transition_from_previous: Transition_Type,
}

Page :: struct {
	page_number: int,
	layout_type: Layout_Type,
	panels: []Panel,
}

Comic_Script :: struct {
	title: string,
	synopsis: string,
	characters: []Character,
	pages: []Page,
}

Panel_Image :: struct {
	url: string,
	width: int,
	height: int,
	seed: i64,
	prompt: string,
}

Layout_Cell :: struct {
	x: f32,
	y: f32,
	w: f32,
	h: f32,
}

Layout_Pattern :: struct {
	id: string,
	name: string,
	description: string,
	genres: []string,
	max_panels: int,
	cells: []Layout_Cell,
}

Page_Layout_Panel :: struct {
	panel_id: string,
	panel_number: int,
	layout_cell: Layout_Cell,
}

Page_Layout :: struct {
	page_number: int,
	pattern_id: string,
	panels: []Page_Layout_Panel,
	width: int,
	height: int,
}

Speech_Bubble_Style :: struct {
	background_color: string,
	border_color: string,
	border_width: f32,
	border_radius: f32,
	font_family: string,
	font_size: f32,
	text_color: string,
	padding: f32,
}

Speech_Bubble :: struct {
	id: string,
	panel_id: string,
	type: Bubble_Type,
	text: string,
	position: Position,
	size: Size,
	tail_direction: string,
	tail_target: Position,
	style: Speech_Bubble_Style,
	speaker_id: string,
}

Project_Metadata :: struct {
	project_id: string,
	project_name: string,
	created_at_iso: string,
	last_modified_iso: string,
}

Workflow_State :: struct {
	current_step: Workflow_Step,
	completed_steps: []Workflow_Step,
	is_generating: bool,
	generation_progress: f32,
	error_message: string,
}

Comic_State :: struct {
	project: Project_Metadata,
	user_mode: User_Mode,
	story_idea: string,
	story_genre: string,
	target_audience: string,
	art_style: string,
	script: Comic_Script,
	characters: []Character,
	panel_images: map[string]Panel_Image,
	panel_errors: map[string]string,
	page_layouts: []Page_Layout,
	speech_bubbles: map[string][]Speech_Bubble,
	export_format: Export_Format,
	page_size: Page_Size_Name,
	color_profile: Color_Profile,
	workflow: Workflow_State,
}
