### search_filters = {FOCUS_FILTER_POLITICAL}
### search_filters = {FOCUS_FILTER_RESEARCH}
### search_filters = {FOCUS_FILTER_INDUSTRY}
### search_filters = {FOCUS_FILTER_STABILITY}
### search_filters = {FOCUS_FILTER_WAR_SUPPORT}
### search_filters = {FOCUS_FILTER_MANPOWER}
### search_filters = {FOCUS_FILTER_ANNEXATION}

focus_tree = {
	id = brazil_tree
	
	country = {
		factor = 0
		modifier = {
			add = 10
			tag = BRA
			has_dlc = "Trial of Allegiance"
		}
	}
	
	default = no

	continuous_focus_position = { x = 0 y = 2500 }

	initial_show_position = {
		x = 27
		y = 0
	}

	##### Shared Military Branch #####

	shared_focus = SMB_army
	shared_focus = SMB_air_force
	shared_focus = SMB_navy

	##################################

	
	
	focus = {
		id = BRA_tribunal_de_seguranca_nacional
		icon = GFX_focus_BRA_tribunal
		#prerequisite = { focus = }
		x = 0
		y = 0
		#relative_position_id =
		mutually_exclusive = { focus = BRA_end_the_state_of_emergency focus = BRA_prepare_for_second_intentona }
		cost = 5
		ai_will_do = {
			factor = 10
		}
		available = {
		}
		allow_branch = {
			IF = {
				limit = {
					has_game_rule = {
						rule = obsolete_focus_branches_visibility
						option = HIDE
					}
				}
				NOT = { has_completed_focus = BRA_end_the_state_of_emergency }
				NOT = { has_completed_focus = BRA_prepare_for_second_intentona }
			}
		}
		search_filters = { FOCUS_FILTER_HISTORICAL }

		completion_reward = {
			custom_effect_tooltip = BRA_modify_aotci_ns_intro
			add_to_variable = {
				BRA_coup_communism_factor = -0.2
				tooltip = communism_drift_factor_tt
			}
			add_to_variable = {
				BRA_coup_democratic_factor = -0.2
				tooltip = democratic_drift_factor_tt
			}
			add_to_variable = {
				BRA_coup_stability_factor = 0.04
				tooltip = stability_factor_tt
			}
			add_political_power = 120

			if = {
				limit = {
					has_game_rule = {
						rule = obsolete_focus_branches_visibility
						option = HIDE
					}
				}
				mark_focus_tree_layout_dirty = yes
			}
		}
	}

	##### Historical and Fascist Branch #####

	focus = {
		id = BRA_ensure_continued_military_support
		icon = GFX_focus_generic_military_dictatorship
		prerequisite = { focus = BRA_tribunal_de_seguranca_nacional }
		x = -2
		y = 1
		relative_position_id = BRA_tribunal_de_seguranca_nacional
		cost = 5
		ai_will_do = {
			factor = 15
		}
		available = {
			NOT = {
				OR = {
					has_completed_focus = BRA_estado_novo
					has_completed_focus = BRA_estado_moderno
				}
			}
		}

		search_filters = { }

		completion_reward = {
			#custom_effect_tooltip = "TODO_JUNO: Add decision system"
			add_war_support = 0.1
			custom_effect_tooltip = BRA_modify_aotci_ns_intro
			add_to_variable = {
				BRA_coup_neutrality_factor = 0.2
				tooltip = neutrality_drift_factor_tt
			}
		}
	}

	focus = {
		id = BRA_work_with_the_integralists
		icon = GFX_focus_BRA_work_with_the_integralists
		prerequisite = { focus = BRA_tribunal_de_seguranca_nacional }
		x = 2
		y = 1
		relative_position_id = BRA_tribunal_de_seguranca_nacional
		cost = 5
		ai_will_do = {
			factor = 5
		}
		available = {
			NOT = {
				OR = {
					has_completed_focus = BRA_estado_novo
					has_completed_focus = BRA_estado_moderno
				}
			}
		}

		search_filters = { }

		completion_reward = {
			custom_effect_tooltip = BRA_boost_integralist_support_tt
			custom_effect_tooltip = BRA_modify_aotci_ns_intro
			add_to_variable = {
				BRA_coup_fascism_factor = 0.05
				tooltip = fascism_drift_factor_tt
			}
		}
	}

	focus = {
		id = BRA_estado_moderno
		icon = GFX_focus_BRA_estado_moderno
		prerequisite = { focus = BRA_work_with_the_integralists }
		prerequisite = { focus = BRA_cohen_plan }
		mutually_exclusive = { focus = BRA_estado_novo }
		x = 0
		y = 2
		relative_position_id = BRA_work_with_the_integralists
		cost = 5
		ai_will_do = {
			factor = 10
		}
		available = {
		}

		bypass = {
			has_government = fascism
		}

		search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {
			
			#set_country_leader_ideology = fascism_ideology
			custom_effect_tooltip = BRA_estado_moderno_tt
			hidden_effect = {
			every_other_country = {
				limit = {
					any_owned_state = {
						OR = {
							is_on_continent = south_america
							is_on_continent = north_america
						}
					}
				}
				news_event = { id = south_american_news.51 hours = 1 }
			}
			retire_country_leader = yes
				BRA_getulio_vargas = { 
					add_country_leader_role = {
						country_leader = {
							ideology = fascism_ideology
							expire = "1965.1.1.1"
							traits = {
								#war_industrialist
							}
						}
					}
					promote_leader = yes 
				}
			}
			set_politics = {
				ruling_party = fascism
				last_election = "1934.3.26"
				election_frequency = 48
				elections_allowed = no
			}
			hidden_effect = {
				retire_country_leader = yes
			}
			remove_dynamic_modifier = {
				modifier = BRA_aftermath_of_the_coup
			}
			add_dynamic_modifier = { modifier = BRA_estado_moderno_modifier }
		}
	}

	focus = {
		id = BRA_estado_novo
		icon = GFX_focus_BRA_estado_novo
		prerequisite = { focus = BRA_ensure_continued_military_support }
		prerequisite = { focus = BRA_cohen_plan }
		mutually_exclusive = { focus = BRA_estado_moderno }
		x = 0
		y = 2
		relative_position_id = BRA_ensure_continued_military_support
		cost = 5
		ai_will_do = {
			factor = 10
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_STABILITY FOCUS_FILTER_HISTORICAL }

		completion_reward = {
			hidden_effect = {
				every_country = {
					limit = {
						any_owned_state = {
							OR = {
								is_on_continent = south_america
								is_on_continent = north_america
							}
						}
					}
					news_event = { 
						id = south_american_news.50 
						hours = 1 
					}
				}
			
			retire_country_leader = yes
				BRA_getulio_vargas = { 
					add_country_leader_role = {
						country_leader = {
							ideology = despotism
							expire = "1965.1.1.1"
							traits = {
								BRA_authoritarian_populist
							}
						}
					}
					promote_leader = yes 
				}
			}
			set_politics = {
				ruling_party = neutrality
				last_election = "1934.3.26"
				election_frequency = 48
				elections_allowed = no
			}
			hidden_effect = {
				retire_country_leader = yes
			}
			remove_dynamic_modifier = {
				modifier = BRA_aftermath_of_the_coup
			}
			add_dynamic_modifier = {
				modifier = BRA_estado_novo_modifier
			}
		}
	}

	focus = {
		id = BRA_cohen_plan
		icon = GFX_focus_BRA_cohen_plan 
		prerequisite = { focus = BRA_ensure_continued_military_support focus = BRA_work_with_the_integralists }
		x = 0
		y = 2
		relative_position_id = BRA_tribunal_de_seguranca_nacional
		cost = 10
		available = {
			OR = {
				fascism > 0.50
				neutrality > 0.50
			}
		}

		cancel_if_invalid = no

		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_HISTORICAL }

		completion_reward = {
			custom_effect_tooltip = BRA_cohen_plan_tt
			add_political_power = 100
		}
	}

	focus = {
		id = BRA_the_polaca
		icon = GFX_focus_BRA_the_polaca
		prerequisite = { focus = BRA_estado_novo }
		x = 0
		y = 1
		relative_position_id = BRA_estado_novo
		cost = 10
		available = {
		}

		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_STABILITY FOCUS_FILTER_HISTORICAL }

		completion_reward = {
			custom_effect_tooltip = BRA_modify_estado_novo_ns_intro
			add_to_variable = { BRA_estado_novo_neutrality_factor = 0.1 tooltip = neutrality_drift_factor_tt }
			remove_dynamic_modifier = { modifier = BRA_weak_government }
		}
	}

	focus = {
		id = BRA_anaue
		icon = GFX_focus_BRA_anaue
		prerequisite = { focus = BRA_estado_moderno }
		x = 0
		y = 1
		relative_position_id = BRA_estado_moderno
		cost = 10
		ai_will_do = {
			factor = 20
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {
			add_ideas = BRA_anaue_idea
			custom_effect_tooltip = BRA_anaue_tt
			hidden_effect = {
				#set_variable = { BRA_green_shirt_division_cap = 0 }
				#set_variable = { BRA_max_green_shirt_division_cap = 10 }
				##add_to_variable = { BRA_green_shirt_division_cap = 1 }
				#clamp_variable = {
				#	var = BRA_green_shirt_division_cap
				#	min = 0 
				#	max = BRA_max_green_shirt_division_cap
				#}
			
				division_template = {
					name = "Integralist Militia"		
					#division_names_group = SWE_BS_01
					is_locked = yes
					#force_allow_recruiting = yes
					template_counter = 89
					# Note: Represents brownshirts
					regiments = {
						militia = { x = 0 y = 0 }
						militia = { x = 0 y = 1 }
						militia = { x = 1 y = 0 }
						militia = { x = 1 y = 1 }
					}
					#division_cap = 0
					override_model = BRA_militia_alt_1_entity
				}
				#set_division_template_cap = { 
				#	division_template = "Integralist Militia" 
				#	division_cap = BRA_green_shirt_division_cap   
				#}
			}
		}
	}

	focus = {
		id = BRA_autarky
		icon = GFX_focus_BRA_autarky
		prerequisite = { focus = BRA_the_polaca focus = BRA_anaue }
		x = 0
		y = 2
		relative_position_id = BRA_the_polaca
		mutually_exclusive = { focus = BRA_corporatism }
		cost = 5
		available = {
			num_of_factories > 25
		}

		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_INDUSTRY }

		completion_reward = {
			#add_ideas = GER_autarky_idea
			IF = {
				limit = { has_dynamic_modifier = { modifier = BRA_estado_novo_modifier } }
				custom_effect_tooltip = BRA_modify_estado_novo_ns_intro
				add_to_variable = {
					BRA_estado_novo_production_speed_arms_factory_factor = 0.05
					tooltip = production_speed_arms_factory_factor_tt
				}
				add_to_variable = {
					BRA_estado_novo_production_speed_dockyard_factor = 0.05
					tooltip = production_speed_dockyard_factor_tt
				}
				add_to_variable = {
					BRA_estado_novo_production_speed_industrial_complex_factor = 0.05
					tooltip = production_speed_industrial_complex_factor_tt
				}
			}
			ELSE = {
				custom_effect_tooltip = BRA_modify_estado_moderno_ns_intro
				add_to_variable = {
					BRA_estado_moderno_production_speed_arms_factory_factor = 0.05
					tooltip = production_speed_arms_factory_factor_tt
				}
				add_to_variable = {
					BRA_estado_moderno_production_speed_dockyard_factor = 0.05
					tooltip = production_speed_dockyard_factor_tt
				}
				add_to_variable = {
					BRA_estado_moderno_production_speed_industrial_complex_factor = 0.05
					tooltip = production_speed_industrial_complex_factor_tt
				}
			}
		}
	}

	focus = {
		id = BRA_corporatism
		icon = GFX_focus_ICE_state_corporatism
		prerequisite = { focus = BRA_anaue focus = BRA_the_polaca}
		mutually_exclusive = { focus = BRA_autarky }
		x = 0
		y = 2
		relative_position_id = BRA_anaue
		cost = 5
		ai_will_do = {
			factor = 10
		}
		available = {
			num_of_factories > 25
		}

		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_INDUSTRY }

		completion_reward = {
			IF = {
				limit = { has_dynamic_modifier = { modifier = BRA_estado_novo_modifier } }
				custom_effect_tooltip = BRA_modify_estado_novo_ns_intro
				add_to_variable = {
					BRA_estado_novo_production_factory_max_efficiency_factor = 0.05
					tooltip = production_factory_max_efficiency_factor_tt
				}
				add_to_variable = {
					BRA_estado_novo_consumer_goods_factor = -0.05
					tooltip = consumer_goods_factor_tt
				}
				add_to_variable = {
					BRA_estado_novo_industrial_capacity_dockyard = 0.05
					tooltip = industrial_capacity_dockyard_tt
				}
			}
			ELSE = {
				custom_effect_tooltip = BRA_modify_estado_moderno_ns_intro
				add_to_variable = {
					BRA_estado_moderno_production_factory_max_efficiency_factor = 0.05
					tooltip = industrial_capacity_factory_tt
				}
				add_to_variable = {
					BRA_estado_moderno_consumer_goods_factor = -0.05
					tooltip = consumer_goods_factor_tt
				}
				add_to_variable = {
					BRA_estado_moderno_industrial_capacity_dockyard = 0.05
					tooltip = industrial_capacity_dockyard_tt
				}
			}
		}
	}

	focus = {
		id = BRA_departamendo_de_propaganda
		icon = GFX_focus_BRA_department_of_propaganda
		prerequisite = { focus = BRA_autarky focus = BRA_corporatism }
		x = 0
		y = 1
		relative_position_id = BRA_autarky
		cost = 5
		available = {
		}

		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_WAR_SUPPORT FOCUS_FILTER_HISTORICAL }

		completion_reward = {
			add_ideas = BRA_propaganda_idea
		}
	}

	focus = {
		id = BRA_departamento_de_ordem_politica_e_social
		icon = GFX_focus_SWI_embrace_rote_drei
		prerequisite = { focus = BRA_corporatism focus = BRA_autarky  }
		x = 0
		y = 1
		relative_position_id = BRA_corporatism
		cost = 5
		ai_will_do = {
			factor = 10
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_HISTORICAL }

		completion_reward = {
		
			IF = {
				limit = {
					has_dlc = "La Resistance"
				}
				#create_intelligence_agency = yes
				create_intelligence_agency = { 
					name = "Departamento de Ordem"
					icon = GFX_intelligence_agency_logo_BRA_neutrality
				}
				upgrade_intelligence_agency = upgrade_passive_defense 
			}
			ELSE = {
				add_ideas = BRA_departamento_de_political_e_social_no_lar
			}
		}
	}

	focus = {
		id = BRA_tech_slot_1
		icon = GFX_focus_research
		prerequisite = { focus = BRA_departamento_de_ordem_politica_e_social  focus = BRA_departamendo_de_propaganda }
		x = 0
		y = 6
		relative_position_id = BRA_cohen_plan
		cost = 10
		ai_will_do = {
			factor = 20
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_RESEARCH }

		completion_reward = {
			add_research_slot = 1
		}
	}

	focus = {
		id = BRA_ban_political_parties
		icon = GFX_focus_BRA_ban_communist_party
		prerequisite = { focus = BRA_the_polaca }
		x = -4
		y = 1
		relative_position_id = BRA_the_polaca
		cost = 5
		ai_will_do = {
			factor = 30
		}
		available = {
			neutrality > 0.6
			has_stability > 0.6
		}

		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_HISTORICAL}

		completion_reward = {
			IF = {
				limit = {
					fascism > 0.4
				}
				start_civil_war = {
					ideology = fascism #SPLITTING TAG
					size = party_popularity@fascism
				}
				hidden_effect = {
					set_popularities = {
						fascism = 0
					}
				}
			}
			ELSE_IF = {
				limit = {
					communism > 0.4
				}
				start_civil_war = {
					ideology = communism #SPLITTING TAG
					size = party_popularity@communism
				}
				hidden_effect = {
					set_popularities = {
						communism = 0
					}				
				}
			}
			ELSE_IF = {
				limit = {
					democratic > 0.4
				}
				start_civil_war = {
					ideology = democratic #SPLITTING TAG
					size = party_popularity@democratic
				}
				hidden_effect = {
					set_popularities = {
						democratic = 0
					}				
				}
			}
			custom_effect_tooltip = BRA_modify_estado_novo_ns_intro
			add_to_variable = {
				BRA_estado_novo_fascism_factor = -0.2
				tooltip = fascism_drift_factor_tt
			}
			add_to_variable = {
				BRA_estado_novo_democratic_factor = -0.2
				tooltip = democratic_drift_factor_tt
			}
			add_to_variable = {
				BRA_estado_novo_communism_factor = -0.2
				tooltip = communism_drift_factor_tt
			}
			add_to_variable = {
				BRA_estado_novo_stability_factor = 0.1
				tooltip = stability_factor_tt
			}
		}
	}


	focus = {
		id = BRA_establish_psad
		icon = GFX_focus_generic_improve_the_administration
		prerequisite = { focus = BRA_the_polaca }
		x = -2
		y = 1
		relative_position_id = BRA_the_polaca
		cost = 5
		ai_will_do = {
			factor = 20
		}
		available = {
			num_of_factories > 25
		}

		search_filters = { FOCUS_FILTER_HISTORICAL }

		completion_reward = {
			add_ideas = BRA_psad_idea
		}
	}

	focus = {
		id = BRA_decree_no_37
		icon = GFX_focus_BRA_decree_number_37
		prerequisite = { focus = BRA_establish_psad focus = BRA_ban_political_parties }
		x = 0
		y = 1
		relative_position_id = BRA_ban_political_parties
		cost = 5
		ai_will_do = {
			factor = 15
		}
		available = {
			has_civil_war = no
		}

		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_STABILITY FOCUS_FILTER_HISTORICAL }

		completion_reward = {
			remove_ideas = BRA_separatism_idea
			add_political_power = 100
		}
	}

	focus = {
		id = BRA_federal_employment_plan
		icon = GFX_focus_generic_hydroelectric_energy
		prerequisite = { focus = BRA_establish_psad focus = BRA_ban_political_parties }
		x = 0
		y = 1
		relative_position_id = BRA_establish_psad
		cost = 10
		ai_will_do = {
			factor = 10
		}
		available = {
			NOT = {
				has_civil_war = yes
			}
		}

		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_INDUSTRY }

		completion_reward = {
			custom_effect_tooltip = BRA_modify_estado_novo_ns_intro
			add_to_variable = { BRA_estado_novo_recruitable_population_factor = -0.02 tooltip = conscription_factor_tt}
			random_core_state = {
				limit = {
					free_building_slots = {
						building = arms_factory
						size > 0
						include_locked = yes
					}
					is_owned_and_controlled_by = ROOT
					NOT = {
						OR = {
							state = 961
							state = 962
							state = 963
							state = 964
							state = 965
							state = 966
							state = 967
							state = 968
						}
					}
				}
				add_extra_state_shared_building_slots = 2
				add_building_construction = {
					type = industrial_complex
					level = 2
					instant_build = yes
				}
			}
		}
	}

	focus = {
		id = BRA_reward_army_loyalty
		icon = GFX_goal_generic_military_sphere
		prerequisite = { focus = BRA_decree_no_37 focus = BRA_federal_employment_plan }
		x = 1
		y = 2
		relative_position_id = BRA_decree_no_37
		cost = 10
		available = {
		}

		search_filters = { }

		completion_reward = {
			add_timed_idea = {
				idea = BRA_army_reward
				days = 730
			}
		}
	}

	focus = {
		id = BRA_depose_vargas
		icon = GFX_focus_generic_military_mission
		prerequisite = { focus = BRA_reward_army_loyalty }
		x = 2
		y = 1
		relative_position_id = BRA_reward_army_loyalty
		cost = 5
		available = {
			has_stability > 0.7
		}

		search_filters = { FOCUS_FILTER_HISTORICAL }

		completion_reward = {
			#retire_country_leader = yes
			BRA_eurico_gaspar_dutra = {
				add_country_leader_role = {
					country_leader = {
						ideology = moderatism
						expire = "1965.1.1.1"
						traits = { war_industrialist }
					}
				} 
				promote_leader = yes
			}
			hidden_effect = {
				retire_country_leader = yes
			}
		}
	}

	focus = {
		id = BRA_secure_our_borders
		icon = GFX_focus_BRA_secure_our_borders
		prerequisite = { focus = BRA_reward_army_loyalty focus = BRA_restoration_of_honor }
		#mutually_exclusive = { focus = BRA_the_international_crisis }
		x = 0
		y = 3
		relative_position_id = BRA_reward_army_loyalty
		cost = 10
		ai_will_do = {
			factor = 20
		}
		available = {
			OR = {
				has_war_support > 0.6
				has_war = yes
			}
		}

		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_HISTORICAL }

		completion_reward = {
			add_timed_idea = { 
				idea = BRA_secure_our_borders_idea
				days = 1460
			}
		}
	}

	focus = {
		id = BRA_reject_cosmopolitanism
		icon = GFX_focus_BRA_reject_cosmopolitanism
		prerequisite = { focus = BRA_anaue }
		x = 2
		y = 1
		relative_position_id = BRA_anaue
		cost = 10
		ai_will_do = {
			factor = 9
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_STABILITY FOCUS_FILTER_MANPOWER }

		completion_reward = {
			custom_effect_tooltip = BRA_modify_estado_moderno_ns_intro
			add_to_variable = { 
				BRA_estado_moderno_stability_factor = -0.05 
				tooltip = stability_factor_tt
			}
			add_to_variable = {
				BRA_estado_moderno_war_support_factor = 0.1
				tooltip = war_support_factor_tt
			}
			add_to_variable = {
				BRA_estado_moderno_recruitable_population_factor = 0.03
				tooltip = conscription_factor_tt
			}
		}
	}

	focus = {
		id = BRA_departamento_feminino
		icon = GFX_focus_SOV_womens_fascist_movement
		prerequisite = { focus = BRA_anaue }
		x = 4
		y = 1
		relative_position_id = BRA_anaue
		cost = 10
		ai_will_do = {
			factor = 11
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_STABILITY FOCUS_FILTER_MANPOWER }

		completion_reward = {
			custom_effect_tooltip = BRA_modify_estado_moderno_ns_intro
			add_to_variable = { BRA_estado_moderno_recruitable_population_factor = 0.1 tooltip = conscription_factor_tt }
			add_to_variable = { BRA_estado_moderno_stability_factor = -0.05 tooltip = stability_factor_tt }
		}
	}

	focus = {
		id = BRA_in_vargas_we_trust
		icon = GFX_focus_BRA_estado_novo
		prerequisite = { focus = BRA_reject_cosmopolitanism focus = BRA_departamento_feminino }
		mutually_exclusive = { focus = BRA_integrity_of_the_fatherland }
		x = 0
		y = 1
		relative_position_id = BRA_reject_cosmopolitanism
		cost = 10
		ai_will_do = {
			factor = 2
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_POLITICAL_CHARACTER }

		completion_reward = {

			add_country_leader_trait = { 
				trait = BRA_reluctant_integralist 
			}
			remove_country_leader_trait = {
				trait = BRA_authoritarian_populist
			}
		}
	}

	focus = {
		id = BRA_integrity_of_the_fatherland
		icon = GFX_focus_BRA_defense_of_the_fatherland 
		prerequisite = { focus = BRA_reject_cosmopolitanism focus = BRA_departamento_feminino }
		mutually_exclusive = { focus = BRA_in_vargas_we_trust }
		x = 0
		y = 1
		relative_position_id = BRA_departamento_feminino
		cost = 10
		ai_will_do = {
			factor = 10
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_POLITICAL_CHARACTER}

		completion_reward = {
			
			custom_effect_tooltip = BRA_modify_estado_moderno_ns_intro
			BRA_plinio_salgado = {
				add_country_leader_role = {
					country_leader = {
						ideology=fascism_ideology
						expire="1965.1.1.1"
						id=-1
						traits = {
							dictator
						}
					}
					promote_leader = yes
				}
				#promote_leader = yes
			}
			#retire_country_leader = yes
		}
	}

	focus = {
		id = BRA_brazil_integral
		icon = GFX_focus_BRA_brazil_integral
		prerequisite = { focus = BRA_in_vargas_we_trust focus = BRA_integrity_of_the_fatherland }
		x = 1
		y = 1
		relative_position_id = BRA_in_vargas_we_trust
		cost = 5
		ai_will_do = {
			factor = 20
		}
		available = {
			fascism > 0.7
		}

		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_STABILITY }

		completion_reward = {
			remove_dynamic_modifier = {
				modifier = BRA_weak_government
			}
		}
	}

	focus = {
		id = BRA_reinvigorate_the_navy
		icon = GFX_goal_generic_navy_cruiser
		prerequisite = { focus = BRA_brazil_integral }
		x = -1
		y = 1
		relative_position_id = BRA_brazil_integral
		cost = 5
		ai_will_do = {
			factor = 10
		}
		available = {
			any_owned_state = {
				is_coastal = yes
			}
		}

		search_filters = { }

		completion_reward = {
			add_timed_idea = {
				idea = BRA_navy_reward
				days = 730
			}
			navy_experience = 20
		}
	}


	#focus = {
	#	id = BRA_internal_revolution
	#	#icon = 
	#	prerequisite = { focus = BRA_brazil_integral }
	#	x = 1
	#	y = 1
	#	relative_position_id = BRA_brazil_integral
	#	cost = 10
	#	ai_will_do = {
	#		factor = 10
	#	}
	#	available = {
	#	}
#
	#	search_filters = { }
#
	#	completion_reward = {
	#		
	#	}
	#}

	focus = {
		id = BRA_ethical_internationalism
		icon = GFX_focus_BRA_ethical_internationalism
		prerequisite = { focus = BRA_brazil_integral }
		x = 0
		y = 4
		relative_position_id = BRA_brazil_integral
		cost = 10
		ai_will_do = {
			factor = 15
		}
		available = {
		}

		search_filters = { }

		completion_reward = {
			add_timed_idea = { 
				idea = BRA_ethical_internationalism_idea
				days = 1460
			}
		}
	}

	##################################

	##### Industrial Branch ##### 

	focus = {
		id = BRA_coffee_crisis_aftermath
		icon = GFX_focus_BRA_coffee_crisis
		#prerequisite = { focus =  }
		x = 12
		y = 0
		relative_position_id = BRA_tribunal_de_seguranca_nacional
		cost = 5
		ai_will_do = {
			factor = 15
		}

		offset = {
			x = -33
			y = 0
			trigger = {
				has_game_rule = {
					rule = obsolete_focus_branches_visibility
					option = HIDE
				}
				has_completed_focus = BRA_prepare_for_second_intentona 
			}
		}

		offset = {
			x = -15
			y = 0
			trigger = {
				has_game_rule = {
					rule = obsolete_focus_branches_visibility
					option = HIDE
				}
				has_completed_focus = BRA_end_the_state_of_emergency 
			}
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_INDUSTRY }

		completion_reward = {
			custom_effect_tooltip = BRA_modify_economy_intro
			add_to_variable = {
				BRA_economy_industrial_capacity_factor = 0.05
				tooltip = industrial_capacity_factory_tt
			}
			add_to_variable = {
				BRA_economy_production_efficiency_gain_factor = 0.05
				tooltip = production_factory_efficiency_gain_factor_tt
			}
			add_to_variable = {
				BRA_economy_production_max_efficiency_factor = 0.05
				tooltip = production_factory_max_efficiency_factor_tt
			}
			custom_effect_tooltip = available_industrial_concern
			show_ideas_tooltip = BRA_departamento_nacional_do_cafe_idea	
		}
	}

	focus = {
		id = BRA_radio_nacional
		icon = GFX_focus_SWE_radiotjanst
		prerequisite = { focus = BRA_coffee_crisis_aftermath  }
		x = -1
		y = 1
		relative_position_id = BRA_coffee_crisis_aftermath
		cost = 10
		ai_will_do = {
			factor = 10
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_INDUSTRY FOCUS_FILTER_HISTORICAL}

		completion_reward = {
			add_ideas = BRA_radio_nacional_idea
			IF = {
				limit = { NOT = { has_tech = radio } }
				set_technology = { radio = 1 }
			}
		}
	}

	focus = {
		id = BRA_desenvolvimentismo
		icon = GFX_focus_ETH_adopt_the_lira
		prerequisite = { focus = BRA_coffee_crisis_aftermath  }
		x = 1
		y = 1
		relative_position_id = BRA_coffee_crisis_aftermath
		cost = 10
		ai_will_do = {
			factor = 10
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_INDUSTRY }

		completion_reward = {
			custom_effect_tooltip = BRA_modify_economy_intro
			add_to_variable = {
				BRA_economy_production_efficiency_gain_factor = 0.1
				tooltip = production_factory_efficiency_gain_factor_tt
			}
			add_to_variable = {
				BRA_economy_production_max_efficiency_factor = 0.1
				tooltip = production_factory_max_efficiency_factor_tt
			}	
			add_tech_bonus = {
				name = BRA_electronics_bonus
				bonus = 0.5
				uses = 2
				category = electronics
			}			
		}
	}

	focus = {
		id = BRA_promote_resource_extraction
		icon = GFX_focus_generic_resource_extraction
		prerequisite = { focus = BRA_radio_nacional focus = BRA_desenvolvimentismo }
		x = 0
		y = 1
		relative_position_id = BRA_radio_nacional
		cost = 10
		available = {
		}

		search_filters = { FOCUS_FILTER_INDUSTRY }

		completion_reward = {
			every_owned_state = {
				limit = {
					is_controlled_by = ROOT
					OR = {
						has_dynamic_modifier = { modifier = BRA_neglected_state_dynamic_modifier }	
						has_dynamic_modifier = { modifier = BRA_growing_state_dynamic_modifier }
					}
				}
				add_extra_state_shared_building_slots = 1
				custom_effect_tooltip = BRA_modify_neglected_state
				add_to_variable = {
					BRA_state_development_state_resources_factor = 0.1
					tooltip = MODIFIER_STATE_RESOURCES_FACTOR_tt
				}
			}
			add_tech_bonus = {
				name = BRA_resource_extraction_bonus
				bonus = 0.50
				uses = 2
				category = excavation_tech
			}
		}
	}

	focus = {
		id = BRA_companhia_siderurgica_nacional
		icon = GFX_focus_BRA_national_steel_company
		prerequisite = { focus = BRA_desenvolvimentismo focus = BRA_radio_nacional  }
		x = 0
		y = 1
		relative_position_id = BRA_desenvolvimentismo
		cost = 10
		ai_will_do = {
			factor = 20
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_INDUSTRY FOCUS_FILTER_HISTORICAL }

		completion_reward = {
			capital_scope = {
				add_resource = {
					type = steel
					amount = 24
					#state = 662
				}
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = industrial_complex
					level = 1
					instant_build = yes
				}
			}
		}
	}

	focus = {
		id = BRA_stimulate_the_civilian_economy
		icon = GFX_goal_generic_construct_civ_factory
		prerequisite = { focus = BRA_desenvolvimentismo  }
		x = 4
		y = 1
		relative_position_id = BRA_desenvolvimentismo
		cost = 10
		ai_will_do = {
			factor = 18
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_INDUSTRY }

		completion_reward = {
			random_core_state = {
				limit = {
					free_building_slots = {
						building = industrial_complex
						size > 0
						include_locked = yes
					}
					is_owned_and_controlled_by = ROOT
					NOT = {
						state = 961
						state = 962
						state = 963
						state = 964
						state = 965
						state = 966
						state = 967
						state = 968
					}
				}
				add_extra_state_shared_building_slots = 2
				add_building_construction = {
					type = industrial_complex
					level = 2
					instant_build = yes
				}
			}
			add_tech_bonus = {
				name = BRA_industry_bonus
				bonus = 0.5
				uses = 2
				category = industry
			}			
		}
	}

	focus = {
		id = BRA_domestic_arms_industry
		icon = GFX_goal_generic_construct_mil_factory
		prerequisite = { focus = BRA_stimulate_the_civilian_economy  }
		x = 0
		y = 1
		relative_position_id = BRA_stimulate_the_civilian_economy
		cost = 10
		ai_will_do = {
			factor = 16
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_INDUSTRY }

		completion_reward = {
			random_core_state = {
				limit = {
					free_building_slots = {
						building = arms_factory
						size > 0
						include_locked = yes
					}
					is_owned_and_controlled_by = ROOT
					NOT = {
						state = 961
						state = 962
						state = 963
						state = 964
						state = 965
						state = 966
						state = 967
						state = 968
					}
				}
				add_extra_state_shared_building_slots = 2
				add_building_construction = {
					type = arms_factory
					level = 2
					instant_build = yes
				}
			}
		}
	}

	focus = {
		id = BRA_war_production
		icon = GFX_focus_secret_rearmament
		prerequisite = { focus = BRA_domestic_arms_industry  }
		x = 0
		y = 1
		relative_position_id = BRA_domestic_arms_industry
		cost = 5
		ai_will_do = {
			factor = 15
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_INDUSTRY }

		completion_reward = {
			custom_effect_tooltip = BRA_modify_economy_intro
			add_to_variable = {
				BRA_economy_industrial_capacity_factor = 0.1
				tooltip = industrial_capacity_factory_tt
			}	
			BRA_remove_economy_modifier = yes
			random_core_state = {
				limit = {
					free_building_slots = {
						building = arms_factory
						size > 0
						include_locked = yes
					}
					is_owned_and_controlled_by = ROOT
					NOT = {
						state = 961
						state = 962
						state = 963
						state = 964
						state = 965
						state = 966
						state = 967
						state = 968
					}
				}
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = arms_factory
					level = 1
					instant_build = yes
				}
			}
		}
	}

	focus = { #INDUSTRIAL
		id = BRA_reach_out_to_the_great_powers
		icon = GFX_focus_ARG_reach_out_to_the_great_powers
		prerequisite = { focus = BRA_promote_resource_extraction focus = BRA_companhia_siderurgica_nacional }
		x = 0
		y = 1
		relative_position_id = BRA_promote_resource_extraction
		cost = 5
		available = {
		}

		ai_will_do = {
			factor = 10
		}

		search_filters = { }

		completion_reward = { 
			custom_effect_tooltip = ARG_international_loan_decisions_tt
		}
	}

	focus = {
		id = BRA_deal_with_the_cangaceiro
		icon = GFX_focus_BRA_deal_with_the_cangaco
		prerequisite = { focus = BRA_radio_nacional  }
		x = -2
		y = 1
		relative_position_id = BRA_radio_nacional
		cost = 5
		available = {
			NOT = {
				has_completed_focus = BRA_sway_the_cangaco
			}
		}

		search_filters = { FOCUS_FILTER_HISTORICAL }

		completion_reward = {
			custom_effect_tooltip = BRA_deal_with_the_cangaceiro_tt
		}
	}

	focus = {
		id = BRA_promote_immigration_to_brazil
		icon = GFX_focus_generic_promote_SA_immigration
		prerequisite = { focus = BRA_desenvolvimentismo  }
		x = 2
		y = 1
		relative_position_id = BRA_desenvolvimentismo
		cost = 5
		ai_will_do = {
			factor = 5
		}
		available = {
		}

		search_filters = { }

		completion_reward = {
			set_country_flag = JUNO_promote_immigration_flag
			custom_effect_tooltip = BRA_promote_immigration_to_brazil_tt
		}
	}

	focus = {
		id = BRA_invest_in_railways
		icon = GFX_focus_generic_railroad
		prerequisite = { focus = BRA_promote_resource_extraction focus = BRA_companhia_siderurgica_nacional }
		x = -2
		y = 1
		relative_position_id = BRA_promote_resource_extraction
		cost = 5
		ai_will_do = {
			factor = 10
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_INDUSTRY }

		completion_reward = {
			every_owned_state = {
				limit = {
					is_controlled_by = ROOT
					OR = {
						has_dynamic_modifier = { modifier = BRA_neglected_state_dynamic_modifier }	
						has_dynamic_modifier = { modifier = BRA_growing_state_dynamic_modifier }
					}
				}
				add_extra_state_shared_building_slots = 1
				custom_effect_tooltip = BRA_modify_neglected_state
				add_to_variable = {
					BRA_state_development_production_speed = 0.1
					tooltip = MODIFIER_STATE_PRODUCTION_SPEED_BUILDINGS_FACTOR_tt
				}
				add_to_variable = {
					BRA_state_development_local_factories = 0.1
					tooltip = local_factories_tt
				}
			}
			add_tech_bonus = {
				name = BRA_invest_in_railways_bonus
				bonus = 0.50
				uses = 1
				category = train_tech
			}
			add_timed_idea = {
				idea = BRA_rail_investment
				days = 730
			}
			IF = {
				limit = {
					495 = { is_owned_and_controlled_by = ROOT }
				}
				495 = {
					add_building_construction = {
						type = supply_node
						province = 1979
						level = 1
						instant_build = yes
					}
				}
				build_railway = {
					level = 1
					build_only_on_allied = yes
					fallback = yes
					start_province = 8189
					target_province = 1979
				}
			}
		}
	}

	focus = {
		id = BRA_national_petroleum_council
		icon = GFX_focus_generic_stockpile_fuel
		prerequisite = { focus = BRA_invest_in_railways }
		x = 0
		y = 1
		relative_position_id = BRA_invest_in_railways
		cost = 10
		ai_will_do = {
			factor = 19
		}
		available = {
			499 = {
				is_owned_and_controlled_by = ROOT
			}
		}

		search_filters = { FOCUS_FILTER_INDUSTRY FOCUS_FILTER_HISTORICAL }

		completion_reward = {
			499 = {
				add_extra_state_shared_building_slots = 1
				add_resource = {
					type = oil
					amount = 16
				}	
				add_to_variable = {
					BRA_state_development_local_building_slots_factor = 0.2
					tooltip = MODIFIER_LOCAL_BUILDING_SLOTS_FACTOR_tt
				}
				add_to_variable = {
					BRA_state_development_state_resources_factor = 0.2
					tooltip = MODIFIER_STATE_RESOURCES_FACTOR_tt
				}
				set_state_flag = BRA_resource_boost
			}
			add_tech_bonus = {
				name = BRA_oil_industry_bonus
				bonus = 0.25
				uses = 1
				category = synth_resources
			}
		}
	}

	focus = {
		id = BRA_batalha_do_borracha
		icon = GFX_focus_BRA_rubber_war
		prerequisite = { focus = BRA_companhia_siderurgica_nacional focus = BRA_promote_resource_extraction }
		x = 2
		y = 1
		relative_position_id = BRA_companhia_siderurgica_nacional
		cost = 10
		available = {
		}

		search_filters = { FOCUS_FILTER_INDUSTRY FOCUS_FILTER_HISTORICAL }

		completion_reward = {
			every_owned_state = {
				limit = {
					OR = {
						state = 497
						state = 495						
					}	
				}
				add_extra_state_shared_building_slots = 1
				add_resource = {
					type = rubber
					amount = 20
				}
				add_to_variable = {
					BRA_state_development_local_building_slots_factor = 0.2
					tooltip = MODIFIER_LOCAL_BUILDING_SLOTS_FACTOR_tt
				}
				add_to_variable = {
					BRA_state_development_state_resources_factor = 0.2
					tooltip = MODIFIER_STATE_RESOURCES_FACTOR_tt
				}
				set_state_flag = BRA_resource_boost
			}
		}
	}

	focus = {
		id = BRA_establish_companhia_vale_do_rio_doce
		icon = GFX_focus_generic_mining_industry
		prerequisite = { focus = BRA_batalha_do_borracha }
		x = -2
		y = 1
		relative_position_id = BRA_batalha_do_borracha
		cost = 10
		available = {
			496 = {
				is_controlled_by = ROOT
			}
		}

		search_filters = { FOCUS_FILTER_INDUSTRY FOCUS_FILTER_HISTORICAL }

		completion_reward = {

			496 = {
				add_resource = {
					type = steel
					amount = 12
				}	
				add_resource = {
					type = aluminium
					amount = 8
				}	
			}

		}
	}

	focus = {
		id = BRA_invest_in_road_infrastructure
		icon = GFX_focus_generic_road_investment
		prerequisite = { 
			focus = BRA_batalha_do_borracha 
			focus = BRA_invest_in_railways }
		x = 2
		y = 1
		relative_position_id = BRA_invest_in_railways
		cost = 5
		ai_will_do = {
			factor = 8
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_INDUSTRY }

		completion_reward = {
			every_owned_state = {
				limit = {
					is_controlled_by = ROOT
					OR = {
						has_dynamic_modifier = { modifier = BRA_neglected_state_dynamic_modifier }	
						has_dynamic_modifier = { modifier = BRA_growing_state_dynamic_modifier }
					}
				}
				add_extra_state_shared_building_slots = 1
				custom_effect_tooltip = BRA_modify_neglected_state
				add_to_variable = {
					BRA_state_development_production_speed = 0.1
					tooltip = MODIFIER_STATE_PRODUCTION_SPEED_BUILDINGS_FACTOR_tt
				}
				add_to_variable = {
					BRA_state_development_local_factories = 0.1
					tooltip = local_factories_tt
				}
			}
			add_timed_idea = {
				idea = BRA_road_investment
				days = 730
			}
		}
	}

	focus = {
		id = BRA_invest_in_ports
		icon = GFX_focus_POL_develop_polish_shipbuilding
		prerequisite = { focus = BRA_national_petroleum_council  }
		x = 0
		y = 1
		relative_position_id = BRA_national_petroleum_council
		cost = 5
		ai_will_do = {
			factor = 9
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_INDUSTRY }

		completion_reward = {
			every_owned_state = {
				limit = {
					is_controlled_by = ROOT
					OR = {
						has_dynamic_modifier = { modifier = BRA_neglected_state_dynamic_modifier }	
						has_dynamic_modifier = { modifier = BRA_growing_state_dynamic_modifier }
					}
					is_coastal = yes
				}
				add_extra_state_shared_building_slots = 1
				custom_effect_tooltip = BRA_modify_neglected_state
				add_to_variable = {
					BRA_state_development_production_speed = 0.1
					tooltip = MODIFIER_STATE_PRODUCTION_SPEED_BUILDINGS_FACTOR_tt
				}
				add_to_variable = {
					BRA_state_development_local_factories = 0.1
					tooltip = local_factories_tt
				}
			}
			add_timed_idea = {
				idea = BRA_port_investment
				days = 730
			}
		}
	}

	focus = {
		id = BRA_fabrica_nacional_de_motores
		icon = GFX_focus_BRA_fabrica_national_de_motores
		prerequisite = { focus = BRA_invest_in_road_infrastructure  }
		x = -1
		y = 2
		relative_position_id = BRA_invest_in_road_infrastructure
		mutually_exclusive = { focus = BRA_expand_fordlandia }
		cost = 10
		ai_will_do = {
			factor = 4
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_INDUSTRY FOCUS_FILTER_HISTORICAL }

		completion_reward = {
			IF = {
				limit = {
					has_dlc = "Arms Against Tyranny"
				}
				IF = {
					limit = {
						NOT = { has_completed_focus = SMB_motorized }
					}
					custom_effect_tooltip = available_mio_tt
					show_mio_tooltip = BRA_fnm_organization
				}
				mio:BRA_fnm_organization = {
					add_mio_size = 3
				}

			}
			ELSE = {
				add_tech_bonus = {
					name = BRA_nacional_de_motores_bonus
					bonus = 0.50
					uses = 2
					category = motorized_equipment
				}
			}
		}
	}

	focus = {
		id = BRA_expand_fordlandia
		icon = GFX_focus_SWE_lynx_armored_car
		prerequisite = { focus = BRA_invest_in_road_infrastructure  }
		x = 1
		y = 2
		relative_position_id = BRA_invest_in_road_infrastructure
		mutually_exclusive = { focus = BRA_fabrica_nacional_de_motores }
		cost = 10
		ai_will_do = {
			factor = 4
		}
		available = {
			USA = {
				NOT = { 
					has_government = communism
				}
			}
			NOT = {
				#OR = {
					has_government = communism
					has_war_with = USA
				#}
			}
		}

		search_filters = { FOCUS_FILTER_INDUSTRY }

		completion_reward = {
			938 = {
				add_resource = {
					type = rubber
					amount = 10
				}
				add_extra_state_shared_building_slots = 1
				add_victory_points = {
					province = 2035
					value = 1
				}
			}
			hidden_effect = {
				set_province_name = {
					id = 2035
					name = BRA_fordlandia_name
				}
			}
			IF = {
				limit = {
					has_dlc = "Arms Against Tyranny"
				}
				custom_effect_tooltip = available_mio_tt
				show_mio_tooltip = USA_ford_motor_company_organization
				mio:USA_ford_motor_company_organization = {
					add_mio_size = 2
				}
			}
			ELSE = {
				add_tech_bonus = {
					name = BRA_nacional_de_motores_bonus
					bonus = 0.75
					uses = 1
					category = motorized_equipment
				}
			}
		}
	}

	focus = {
		id = BRA_bonus_tech_slot
		icon = GFX_focus_research
		prerequisite = { focus = BRA_invest_in_road_infrastructure  }
		x = 0
		y = 1
		relative_position_id = BRA_invest_in_road_infrastructure
		cost = 10
		ai_will_do = {
			factor = 4
		}
		available = {
			#num_of_factories > 50
		}
		search_filters = { FOCUS_FILTER_RESEARCH }
		completion_reward = {
			add_research_slot = 1
		}
	}

	focus = {
		id = BRA_banco_do_brasil
		icon = GFX_focus_BRA_banco_do_brasil
		prerequisite = { focus = BRA_batalha_do_borracha 
		}
		x = 0
		y = 1
		relative_position_id = BRA_batalha_do_borracha
		cost = 5
		ai_will_do = {
			factor = 7
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_INDUSTRY }

		completion_reward = {
			custom_effect_tooltip = BRA_modify_economy_intro
			add_to_variable = {
				BRA_economy_industrial_capacity_factor = 0.05
				tooltip = industrial_capacity_factory_tt
			}
			add_to_variable = {
				BRA_economy_production_efficiency_gain_factor = 0.05
				tooltip = production_factory_efficiency_gain_factor_tt
			}
			add_to_variable = {
				BRA_economy_production_max_efficiency_factor = 0.05
				tooltip = production_factory_max_efficiency_factor_tt
			}
			BRA_remove_economy_modifier = yes
			
			custom_effect_tooltip = available_industrial_concern
			show_ideas_tooltip = BRA_banco_do_brasil_idea			
		}
	}

	focus = {
		id = BRA_federal_development
		icon = GFX_focus_generic_agricultural_subsidies
		prerequisite = { focus = BRA_banco_do_brasil  }
		x = -1
		y = 1
		relative_position_id = BRA_banco_do_brasil
		#mutually_exclusive = { focus = BRA_centralize_development }
		cost = 5
		available = {
		}
		ai_will_do = {
			factor = 5
		}

		search_filters = { FOCUS_FILTER_INDUSTRY }

		completion_reward = {
			every_owned_state = {
				limit = {
					is_controlled_by = ROOT
					OR = {
						has_dynamic_modifier = { modifier = BRA_neglected_state_dynamic_modifier }	
						has_dynamic_modifier = { modifier = BRA_growing_state_dynamic_modifier }
					}
				}
				custom_effect_tooltip = BRA_modify_neglected_state
				add_to_variable = {
					BRA_state_development_production_speed = 0.1
					tooltip = MODIFIER_STATE_PRODUCTION_SPEED_BUILDINGS_FACTOR_tt
				}
				add_to_variable = {
					BRA_state_development_local_factories = 0.1
					tooltip = local_factories_tt
				}
				add_to_variable = {
					BRA_state_development_local_building_slots_factor = 0.1
					tooltip = MODIFIER_LOCAL_BUILDING_SLOTS_FACTOR_tt
				}
				add_to_variable = {
					BRA_state_development_state_resources_factor = 0.1
					tooltip = MODIFIER_STATE_RESOURCES_FACTOR_tt
				}
			}

			custom_effect_tooltip = generic_skip_one_line_tt

			unlock_decision_tooltip = {
				decision = develop_guapore_casserite_deposits
				show_effect_tooltip = no
			}	
			unlock_decision_tooltip = {
				decision = rename_guapore_to_rondonia_decision
				show_effect_tooltip = no
			}	

		}
	}

	focus = {
		id = BRA_centralize_development
		icon = GFX_focus_BRA_new_capital
		prerequisite = { focus = BRA_banco_do_brasil  }
		x = 1
		y = 1
		relative_position_id = BRA_banco_do_brasil
		#mutually_exclusive = { focus = BRA_federal_development }
		cost = 5
		ai_will_do = {
			factor = 4
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_INDUSTRY FOCUS_FILTER_HISTORICAL }

		completion_reward = {
			custom_effect_tooltip = BRA_centralize_development_tt
			set_capital = {
				state = 505
				remember_old_capital = no
			}
			505 = {
				add_victory_points = {
					province = 8140
					value = 10
				}
				add_dynamic_modifier = { modifier = BRA_new_capital_modifier }
				add_building_construction = {
					type = supply_node
					province = 8140
					level = 1
					instant_build = yes
				}	
				build_railway = {
					level = 1
					build_only_on_allied = yes
					fallback = yes
					start_province = 12977
					target_province = 8140
				}			
			}
			hidden_effect = {
				set_province_name = { id = 8140 name = BRA_new_capital }
			}
			#500 = {
			#	add_victory_points = {
			#		province = 10980
			#		value = -5
			#	}
			#}
		}
	}

	focus = {
		id = BRA_financial_stimulation
		icon = GFX_focus_BRA_growth
		prerequisite = { focus = BRA_centralize_development focus = BRA_federal_development  }
		x = 0
		y = 2
		relative_position_id = BRA_banco_do_brasil
		cost = 5
		available = {
		}

		search_filters = { FOCUS_FILTER_INDUSTRY }

		completion_reward = {
			unlock_decision_tooltip = BRA_federal_investment_in_rural_state
			custom_effect_tooltip = BRA_financial_stimulation_tt
		}
	}

	##############################################

	##### Cooperation in the Americas Branch #####

	focus = {
		id = BRA_cooperation_in_the_americas
		icon = GFX_focus_BRA_good_neighbor_policy
		mutually_exclusive = { focus = BRA_domination_of_the_americas }
		prerequisite = { 
			focus = BRA_secure_our_borders 
			focus = BRA_the_international_crisis
		}
		x = -10
		y = 1
		relative_position_id = BRA_secure_our_borders
		cost = 5
		ai_will_do = {
			factor = 30
			modifier = {
				factor = 5
				has_completed_focus = BRA_reward_army_loyalty
			}
		}
		available = {
			OR = {
				has_government = democratic
				has_government = neutrality
			}
		}

		search_filters = { FOCUS_FILTER_HISTORICAL }

		completion_reward = {
			add_political_power = 100
			every_other_country = {
				limit = {
					capital_scope = {
						is_on_continent = south_america
					}
					NOT = {
						has_war_with = ROOT
					}
				}
				country_event = {
					id = JUNO_brazil_events.14
					hours = 1
				}
				event_option_tooltip = JUNO_brazil_events.14.a
			}
		}
	}

	focus = {
		id = BRA_defense_spending
		icon = GFX_focus_BRA_for_the_fatherland
		prerequisite = { 
			focus = BRA_cooperation_in_the_americas 
			#focus = BRA_the_international_crisis
		}
		x = 0
		y = 1
		relative_position_id = BRA_cooperation_in_the_americas
		cost = 10
		ai_will_do = {
			factor = 20
		}
		available = {
			any_country = {
				has_war = yes
				has_civil_war = no
			}
		}

		search_filters = { FOCUS_FILTER_INDUSTRY }

		completion_reward = {

			random_core_state = {
				limit = {
					free_building_slots = {
						building = arms_factory
						size > 0 
						include_locked = yes
					}
					is_owned_and_controlled_by = ROOT
					NOT = {
						OR = {
							state = 961
							state = 962
							state = 963
							state = 964
							state = 965
							state = 966
							state = 967
							state = 968
						}
					}
				}
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = arms_factory
					level = 1
					instant_build = yes
				} 
			}
			random_core_state = {
				limit = {
					free_building_slots = {
						building = dockyard
						size > 0 
						include_locked = yes
					}
					is_owned_and_controlled_by = ROOT
					is_coastal = yes
					NOT = {
						OR = {
							state = 961
							state = 962
							state = 963
							state = 964
							state = 965
							state = 966
							state = 967
							state = 968
						}
					}
				}
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = dockyard
					level = 1
					instant_build = yes
				} 
			}

			add_timed_idea = {
				idea = BRA_national_defence_fund_idea
				days = 360
			}

		}
	}

	#focus = {
	#	id = BRA_rio_conference
	#	#icon = 
	#	prerequisite = { 
	#		focus = BRA_reach_out_to_our_neighbors 
	#		#focus = BRA_the_international_crisis
	#	}
	#	x = 0
	#	y = 1
	#	relative_position_id = BRA_reach_out_to_our_neighbors
	#	cost = 5
	#	ai_will_do = {
	#		factor = 5
	#	}
	#	available = {
	#	}
	#	search_filters = { }
	#	completion_reward = {
	#		every_other_country	= {
	#			limit = {
	#				capital_scope = {
	#					is_on_continent = south_america
	#					is_core_of = PREV
	#				}
	#				NOT = {
	#					has_war_with = FROM
	#				}
	#			}
	#			country_event = {
	#				id = JUNO_brazil_events.80
	#				hours = 1
	#			}
	#		}
	#	}
	#}

	#focus = {
	#	id = BRA_organization_of_american_unity
	#	#icon = 
	#	prerequisite = { 
	#		focus = BRA_cooperation_in_the_americas 
	#		#focus = BRA_the_international_crisis
	#	}
	#	x = 6
	#	y = 1
	#	relative_position_id = BRA_cooperation_in_the_americas
	#	cost = 5
	#	ai_will_do = {
	#		factor = 5
	#	}
	#	available = {
	#		is_in_faction = no
	#	}
	#	search_filters = { }
	#	completion_reward = {
	#		custom_effect_tooltip = BRA_organization_of_american_unity_tt
	#		custom_effect_tooltip = BRA_org_american_unity_warning_tt
	#		add_ideas = SMB_organization_of_american_states_member
	#	}
	#}


	focus = {
		id = BRA_reach_out_to_our_neighbors
		icon = GFX_focus_BRA_north_and_south_america
		prerequisite = { 
			focus = BRA_cooperation_in_the_americas 
			#focus = BRA_the_international_crisis
		}
		x = 2
		y = 1
		relative_position_id = BRA_cooperation_in_the_americas
		cost = 5
		ai_will_do = {
			factor = 5
			modifier = {
				factor = 0
				is_in_faction = yes
			}
		}
		available = {
			is_subject = no
			is_in_faction = no
		}

		search_filters = { }

		completion_reward = {

			set_rule = {
				can_create_factions = yes
			}
			create_faction_from_template = {
				template = faction_template_pan_american
				name = BRA_org_american_states_faction
			}

		}
	}

	focus = {
		id = BRA_south_american_defense_cooperation
		icon = GFX_focus_generic_little_entente
		prerequisite = { 
			focus = BRA_reach_out_to_our_neighbors 
			#focus = BRA_the_international_crisis
		}
		x = 0
		y = 1
		relative_position_id = BRA_reach_out_to_our_neighbors
		cost = 5
		bypass = {
		}
		available = {
			is_in_faction = yes
			OR = {
				has_government = democratic
				has_government = neutrality
			}
		}

		search_filters = { FOCUS_FILTER_HISTORICAL }

		completion_reward = {
			IF = {
				limit = {
					NOT = {
						has_completed_focus = BRA_reach_out_to_our_neighbors
					}
				}
				custom_effect_tooltip = BRA_south_american_defense_cooperation_tt
			}
			every_country = {
				limit = {
					is_in_faction_with = ROOT
					capital_scope = {
						is_on_continent = south_america
						is_core_of = PREV
					}
				}
				every_army_leader = {
					random_list = {
						10 = {
							modifier = {
								factor = 0
								has_trait = ranger
							}
							add_trait = { trait = ranger }
						}
						10 = {
							modifier = {
								factor = 0
								has_trait = jungle_rat
							}
							add_trait = { trait = jungle_rat }
						}
						10 = {
							modifier = {
								factor = 0
								has_trait = trait_mountaineer 
							}
							add_trait = { trait = trait_mountaineer  }
						}
						10 = {
							modifier = {
								factor = 0
								has_trait = hill_fighter
							}
							add_trait = { trait = hill_fighter }
						}
						10 = {
							modifier = {
								factor = 0
								has_trait = desert_fox
							}
							add_trait = { trait = desert_fox }
						}
						50 = {
							#do nothing
						}
					}
				}
			}
		}
	}

	focus = {
		id = BRA_foreign_legion
		icon = GFX_focus_generic_manpower
		prerequisite = { 
			focus = BRA_reach_out_to_our_neighbors 
			#focus = BRA_the_international_crisis
		}
		x = 2
		y = 1
		relative_position_id = BRA_reach_out_to_our_neighbors
		cost = 5
		bypass = {
		}
		available = {
			#is_in_faction = yes
			OR = {
				has_government = democratic
				has_government = neutrality
			}
		}

		search_filters = { FOCUS_FILTER_HISTORICAL }

		completion_reward = {
			division_template = {
				name = "Legião Estrangeira"
				#division_names_group = BRA_FL_01
				is_locked = yes
				force_allow_recruiting = yes
				#division_cap = 6
				template_counter = 03
				regiments = {
					infantry = { x = 0 y = 0 }
					infantry = { x = 0 y = 1 }
					infantry = { x = 0 y = 2 }
					infantry = { x = 1 y = 0 }
					infantry = { x = 1 y = 1 }
					infantry = { x = 1 y = 2 }
				}
				support = {
					engineer = { x = 0 y = 0 }
					artillery = { x = 0 y = 1 }
				}
				override_model = FRA_infantry_entity
			}
			custom_effect_tooltip = BRA_foreign_legion_tt
			hidden_effect = {
				capital_scope = {
					create_unit = {
						division = "division_template =\"Legião Estrangeira\" start_experience_factor = 0.2 start_equipment_factor	= 1.0"
						owner = ROOT
						count = 3
					} 
				}
			}
		}
	}

	focus = {
		id = BRA_south_american_research_cooperation
		icon = GFX_goal_tfv_generic_tech_sharing
		prerequisite = { 
			focus = BRA_south_american_defense_cooperation 
			#focus = BRA_the_international_crisis
		}
		mutually_exclusive = { focus = BRA_us_brazil_technology_exchange }
		x = 0
		y = 1
		relative_position_id = BRA_south_american_defense_cooperation
		cost = 5
		bypass = {
		}
		available = {
			is_in_faction = yes
			OR = {
				has_government = democratic
				has_government = neutrality
			}
		}

		search_filters = { FOCUS_FILTER_HISTORICAL }

		completion_reward = {
			every_other_country = {
				limit = {
					is_in_faction_with = ROOT
					capital_scope = {
						is_on_continent = south_america
						is_core_of = PREV
					}
				}
				country_event = {
					id = JUNO_brazil_events.120
					hours = 1
				}
			}
			custom_effect_tooltip = BRA_south_american_tech_sharing_group_tt
			effect_tooltip = {
				add_to_tech_sharing_group = BRA_south_american_tech_sharing_group
			}
		}
	}

	focus = {
		id = BRA_washington_accords
		icon = GFX_focus_chi_mission_to_the_us
		prerequisite = { 
			focus = BRA_cooperation_in_the_americas 
		}
		x = -2
		y = 1
		relative_position_id = BRA_cooperation_in_the_americas
		cost = 5
		ai_will_do = {
			factor = 20
		}
		available = {	
			any_other_country = {
				original_tag = USA
				has_war_with_major = yes
				has_government = democratic
				NOT = {
					has_war_with = ROOT
				}
			}
			NOT = {
				is_in_faction = yes
			}
		}

		bypass = {
			is_in_faction_with = USA
		}
		cancel_if_invalid = yes

		search_filters = { FOCUS_FILTER_WAR_SUPPORT FOCUS_FILTER_HISTORICAL }

		completion_reward = {
			every_other_country = {
				limit = {
					original_tag = USA
					has_war_with_major = yes
					has_government = democratic
				}
				country_event = {
					id = JUNO_brazil_events.15
					hours = 1
				}
			}
			custom_effect_tooltip = BRA_washington_accords_tt
			event_option_tooltip = JUNO_brazil_events.16.a
		}
	}

	focus = {
		id = BRA_disrupt_operation_bolivar
		icon = GFX_focus_BRA_disrupt_bolivar
		prerequisite = { 
			focus = BRA_defense_spending
		}
		relative_position_id = BRA_defense_spending
		x = 0
		y = 1
		
		cost = 10
		available = {
			any_country = {
				original_tag = GER
				NOT = {
					has_government = BRA
				}
			}
			has_intelligence_agency = yes
		}

		search_filters = { }

		completion_reward = {
			IF = {
				limit = {
					has_dlc = "La Resistance"
				}
				add_ideas = BRA_disrupt_bolivar_LaR
			}
			ELSE = {
				add_ideas = BRA_disrupt_bolivar_no_lar
			}
			GER = {
				country_event = {
					id = JUNO_brazil_events.13
					hours = 1
				}
				event_option_tooltip = JUNO_brazil_events.13.a
			}

		}
	}

	focus = {
		id = BRA_potenji_river_conference
		icon = GFX_focus_BRA_rio_protocol
		prerequisite = { 
			focus = BRA_washington_accords 
			#focus = BRA_the_international_crisis
		}
		x = 0
		y = 1
		relative_position_id = BRA_washington_accords
		cost = 10
		bypass = {
			is_in_faction_with = USA
		}
		available = {
			is_subject = no
			USA = {
				
				has_war = yes
				is_in_faction = yes
				any_allied_country = {
					is_major = yes 
				}
			}
		}

		search_filters = { FOCUS_FILTER_HISTORICAL }

		completion_reward = {
			USA = {
				country_event = {
					id = JUNO_brazil_events.20
					hours = 1
				}
				faction_leader = {
					add_to_faction = ROOT
				}
			}
			custom_effect_tooltip = BRA_potenji_river_conference_tt
			every_other_country = {
				limit = {
					has_war_with = USA
					is_major = yes
				}
				ROOT = {
					add_to_war = {
					    targeted_alliance = USA
					    enemy = PREV
					    hostility_reason = asked_to_join
					}
				}
			}
		}
	}

	focus = {
		id = BRA_natal_naval_base

		icon = GFX_focus_generic_air_bases

		prerequisite = { 
			focus = BRA_washington_accords 
			#focus = BRA_the_international_crisis
		}

		x = -2
		y = 1

		relative_position_id = BRA_washington_accords

		cost = 5
		ai_will_do = {
			factor = 15
		}
		available = {

			USA = {
				exists = yes 
			}

			NOT = {
				has_war_with = USA
			}

			USA = {
				has_war = yes
			}

			498 = {
				is_owned_and_controlled_by = ROOT
			}
		}

		search_filters = { FOCUS_FILTER_HISTORICAL }

		completion_reward = {

			IF = {
				limit = {
					USA = {
						NOT = {
							has_military_access_to = ROOT
						}
					}
				}
				ROOT = {
					give_military_access = USA
				}
				USA = {
					add_opinion_modifier = {
						target = ROOT
						modifier = natal_airbase_modifier
					}
				}
			}

			IF = {
				limit = {
					ENG = {
						NOT = {
							has_military_access_to = ROOT
						}
						is_in_faction_with = USA
					}
				}
				ROOT = {
					give_military_access = ENG
				}
				ENG = {
					add_opinion_modifier = {
						target = ROOT
						modifier = natal_airbase_modifier
					}
				}
			}

			# TODO, might be a different state later?
			IF = {
				limit = {
					498 = {
						free_building_slots = {
							building = air_base
							size > 2 
						}
					}
				}
				498 = {
					add_extra_state_shared_building_slots = 2
					add_building_construction = {
						type = air_base
						level = 3
						instant_build = yes
					} 
				}
				ELSE_IF = {
					limit = {
						498 = {
							free_building_slots = {
								building = air_base
								size > 1 
							}
						}
					}
					498 = {
						add_extra_state_shared_building_slots = 2
						add_building_construction = {
							type = air_base
							level = 2
							instant_build = yes
						} 
					}
				}
				ELSE_IF = {
					limit = {
						498 = {
							free_building_slots = {
								building = air_base
								size > 0 
							}
						}
					}
					498 = {
						add_extra_state_shared_building_slots = 2
						add_building_construction = {
							type = air_base
							level = 1
							instant_build = yes
						} 
					}
				}
			}

			add_tech_bonus = {
				name = JUNO_natal_base_sharing
				bonus = 0.5
				uses = 2
				category = air_equipment
			}

		}
	}


	focus = {
		id = BRA_smoking_cobras
		icon = GFX_focus_BRA_cobras_fumantes
		prerequisite = { 
			focus = BRA_washington_accords 
			#focus = BRA_the_international_crisis
		}
		x = -4
		y = 1
		relative_position_id = BRA_washington_accords
		cost = 5
		ai_will_do = {
			factor = 10
		}
		available = {
			is_in_faction_with = USA
		}

		search_filters = { FOCUS_FILTER_HISTORICAL }

		completion_reward = {
			IF = {
				limit = {
					has_dlc = "Arms Against Tyranny"
				}
				add_equipment_subsidy = {
					cic = 1000
					equipment_type = infantry_equipment
					seller_tags = { USA } 
				}
				add_equipment_subsidy = {
					cic = 1000
					equipment_type = artillery_equipment
					seller_tags = { USA } 
				}
			}
			add_equipment_to_stockpile = { 
				type = infantry_equipment
				amount = 4000
				producer = USA
			}
		}
	}


	focus = {
		id = BRA_no_fascism_in_south_america
		icon = GFX_focus_generic_anti_fascist_diplomacy
		prerequisite = { 
			focus = BRA_cooperation_in_the_americas 
			#focus = BRA_the_international_crisis
		}
		x = -4
		y = 1
		relative_position_id = BRA_cooperation_in_the_americas
		cost = 10
		ai_will_do = {
			factor = 0
		}
		available = {
			NOT = {
				USA = {
					has_government = fascism
				}
			}
			any_country = {
				capital_scope = {
					is_on_continent = south_america
				}
				has_government = fascism
				NOT = {
					OR = {
						original_tag = ELS
						original_tag = MEX
						original_tag = DOM
						original_tag = PAN
					}
				}
			}
		}

		search_filters = { FOCUS_FILTER_ANNEXATION }

		completion_reward = {
			hidden_effect = {
				every_other_country = {
					limit = {
						capital_scope = {
							is_on_continent = south_america
						}
						has_government = fascism
						NOT = {
							OR = {
								original_tag = ELS
								original_tag = MEX
								original_tag = DOM
								original_tag = PAN
							}
						}
					}
					ROOT = {
						create_wargoal = {
							type = puppet_wargoal_focus
							target = PREV
							expire = 0
						}
					}
				}
			}
			custom_effect_tooltip = BRA_no_fascism_in_south_america_tt
		} 
	}

	focus = {
		id = BRA_senta_a_pua
		icon = GFX_focus_BRA_senta_a_pua
		prerequisite = { 
			focus = BRA_natal_naval_base 
			#focus = BRA_the_international_crisis
		}
		x = 0
		y = 1
		relative_position_id = BRA_natal_naval_base
		cost = 5
		available = {
			is_in_faction_with = USA
		}

		search_filters = { FOCUS_FILTER_HISTORICAL }

		completion_reward = {
			if = {
				limit = {
					has_dlc = "By Blood Alone"
				}
				add_equipment_to_stockpile = { 
					type = small_plane_airframe_1
					amount = 200
					producer = USA
				}
			}
			else = {
				add_equipment_to_stockpile = { 
					type = fighter_equipment_1
					amount = 200
					producer = USA
				}
			}
			IF = {
				limit = {
					has_dlc = "Arms Against Tyranny"
				}
				add_equipment_subsidy = {
					cic = 500
					equipment_type = small_plane_airframe
					seller_tags = { USA } 
				}
				add_equipment_subsidy = {
					cic = 500
					equipment_type = large_plane_airframe
					seller_tags = { USA } 
				}
				add_equipment_subsidy = {
					cic = 500
					equipment_type = medium_plane_airframe
					seller_tags = { USA } 
				}
			}
		}
	}

	focus = {
		id = BRA_no_communism_in_south_america
		icon = GFX_goal_generic_war_with_comintern
		prerequisite = { 
			focus = BRA_cooperation_in_the_americas 
			#focus = BRA_the_international_crisis
		}
		x = 4
		y = 1
		relative_position_id = BRA_cooperation_in_the_americas
		cost = 10
		ai_will_do = {
			factor = 0
		}
		available = {
			NOT = {
				USA = {
					has_government = communism
				}
			}
			any_country = {
				capital_scope = {
					is_on_continent = south_america
				}
				has_government = communism
			}
		}

		search_filters = { FOCUS_FILTER_ANNEXATION }

		completion_reward = {
			custom_effect_tooltip = BRA_no_communism_in_south_america_tt
			every_country = {
				limit = {
					capital_scope = {
						is_on_continent = south_america
					}
					has_government = communism
				}
				BRA = {
					create_wargoal = {
						type = puppet_wargoal_focus
						target = PREV
						expire = 0
					} 
				}
			}
		}
	}

	focus = {
		id = BRA_us_brazil_technology_exchange
		icon = GFX_goal_tfv_generic_tech_sharing
		prerequisite = { 
			focus = BRA_potenji_river_conference 
			#focus = BRA_the_international_crisis
		}
		x = 0
		y = 1
		relative_position_id = BRA_potenji_river_conference
		mutually_exclusive = { focus = BRA_south_american_research_cooperation }
		cost = 5
		ai_will_do = {
			factor = 10
		}
		available = {
			is_in_faction_with = USA
		}

		search_filters = { FOCUS_FILTER_RESEARCH }

		completion_reward = {
			USA = {
				country_event = {
					id = JUNO_brazil_events.120
					hours = 1
				}
			}
			custom_effect_tooltip = BRA_us_brazil_technology_exchange_tt
			effect_tooltip = {
				add_to_tech_sharing_group = BRA_USA_tech_sharing_group
			}
		} 
	}




	##############################################

	##### Domination of the Americas Branch #####

	focus = {
		id = BRA_domination_of_the_americas
		icon = GFX_focus_por_recover_latin_america
		mutually_exclusive = { focus = BRA_cooperation_in_the_americas }
		prerequisite = { 
			focus = BRA_secure_our_borders 
			focus = BRA_ethical_internationalism
		}
		x = 5
		y = 1
		relative_position_id = BRA_secure_our_borders
		cost = 10
		ai_will_do = {
			factor = 9
			modifier = {
				factor = 10
				OR = {
					has_government = fascism
					has_completed_focus = BRA_empire_of_brazil
				}
			}
		}
		available = {
			OR = {
				has_government = fascism
				has_government = neutrality
			}
			has_army_manpower = { size > 199999 }
		}

		search_filters = { }

		completion_reward = {
			hidden_effect = {
				every_other_country = {
					limit = {
						any_controlled_state = { 
							OR = {
								is_on_continent = north_america
								is_on_continent = south_america
							}
						}
					}
					news_event = {
						id = JUNO_brazil_news.1
						hours = 1
					}
				}
			}
			add_timed_idea = {
				idea = BRA_defense_of_the_fatherland_idea
				days = 720
			}
		}
	}

	focus = {
		id = BRA_berlin_accords
		icon = GFX_focus_chi_mission_to_germany
		prerequisite = { 
			focus = BRA_domination_of_the_americas 
		}
		bypass = {
			is_in_faction_with = GER
		}
		#mutually_exclusive = { focus = BRA_rome_accords }
		x = -4
		y = 1
		relative_position_id = BRA_domination_of_the_americas
		cost = 5
		ai_will_do = {
			factor = 20
			modifier = {
				factor = 0
				has_completed_focus = BRA_rome_accords
				GER = {
					has_war_with = ITA
				}
			}
		}
		available = {
			is_subject = no
			is_in_faction = no
			GER = {
				OR = {
					has_government = fascism
					has_government = neutrality
				}
				NOT = {
					has_war_with = ROOT
				}
			}
		}

		search_filters = { }

		completion_reward = {
			add_political_power = 50
			GER = {
				country_event = {
					id = JUNO_brazil_events.30
					hours = 1
				}
			}
			custom_effect_tooltip = BRA_accords_tt
			effect_tooltip = {
				IF = {
					limit = {
						GER = {
							is_in_faction = yes
						}
					}
					GER = {
						add_to_faction = ROOT
					}
				}
				ELSE = {
					event_option_tooltip = JUNO_brazil_events.30.a
				}
			}
		}
	}

	focus = {
		id = BRA_expand_operation_bolivar
		icon = GFX_focus_BRA_expand_bolivar
		prerequisite = { 
			focus = BRA_berlin_accords 
			focus = BRA_rome_accords
		}
		x = 0
		y = 1
		relative_position_id = BRA_berlin_accords
		cost = 10
		ai_will_do = {
			factor = 15
		}
		available = {
			is_in_faction_with = GER
		}

		search_filters = { }

		completion_reward = {
			GER = {
				country_event = {
					id = JUNO_brazil_events.31
					hours = 1
				}
			}
			add_ideas = BRA_aid_operation_bolivar
			create_operative_leader = {
				name = "Maximilian Vogel"
				traits = { operative_double_agent operative_infiltrator }
				female = no
				bypass_recruitment = yes
				nationalities = { BRA ARG CHL}
				GFX = GFX_portrait_europe_generic_operative_male_14
			}
		}
	}

	focus = {
		id = BRA_german_tanks
		icon = GFX_focus_BRA_acquire_german_tanks
		prerequisite = { 
			focus = BRA_expand_operation_bolivar 
		}
		x = -1
		y = 1
		relative_position_id = BRA_expand_operation_bolivar
		cost = 5
		ai_will_do = {
			factor = 5
		}
		available = {
			GER = {
				exists = yes
			}
			NOT = {
				has_war_with = GER
			}
			is_in_faction_with = ROOT
		}

		search_filters = { }

		completion_reward = {

			#add_tech_bonus = {
			#	name = BRA_German_tank_exchange
			#	bonus = 0.5
			#	uses = 3
			#	category = armor
			#}	

			IF = {
				limit = {
					has_dlc = "Arms Against Tyranny" 
				}
				show_mio_tooltip = GER_daimler_benz_organization
				mio:GER_daimler_benz_organization = {
					add_mio_size = 2
				}
			}
			random_core_state = {
				limit = {
					free_building_slots = {
						building = arms_factory
						size > 0 
						include_locked = yes
					}
					is_owned_and_controlled_by = ROOT
					NOT = {
						OR = {
							state = 961
							state = 962
							state = 963
							state = 964
							state = 965
							state = 966
							state = 967
							state = 968
						}
					}
				}
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = arms_factory
					level = 1
					instant_build = yes
				} 
			}

			IF = {
				limit = {
					NOT = {
						has_idea = JUNO_license_idea
					}
				}
				add_ideas = JUNO_license_idea
			}
			IF = {
				limit = {
					has_dlc = "No Step Back"
				}
				IF = {
					limit = {
						NOT = {
							has_tech = basic_medium_tank_chassis
						}
					}
				}
				set_technology = { basic_medium_tank_chassis = 1 }
				create_equipment_variant = {
					name = "Panzer IV Ausf. A"
					type = medium_tank_chassis_1
					parent_version = 1
					modules = {
						main_armament_slot = tank_close_support_gun
						turret_type_slot = tank_medium_three_man_tank_turret
						suspension_type_slot = tank_bogie_suspension
						armor_type_slot = tank_welded_armor
						engine_type_slot = tank_gasoline_engine
						special_type_slot_1 = tank_radio_1
						special_type_slot_2 = smoke_launchers
					}
					upgrades = {
						tank_nsb_engine_upgrade = 6
						tank_nsb_armor_upgrade = 2
					}
					icon = "GFX_GER_basic_medium_tank_medium"
				}
				custom_effect_tooltip = BRA_german_tanks_tt
				add_equipment_to_stockpile = {
					type = medium_tank_chassis_1
					variant_name = "Panzer IV Ausf. A"
					amount = 200
					producer = BRA
					#override_model = GER_medium_armor_entity
				}
			}
		}
	}

	focus = {
		id = BRA_german_subs
		icon = GFX_focus_BRA_german_submarine_development
		prerequisite = { 
			focus = BRA_expand_operation_bolivar 
		}
		x = 1
		y = 1
		relative_position_id = BRA_expand_operation_bolivar
		cost = 5
		ai_will_do = {
			factor = 15
		}
		available = {
			GER = {
				exists = yes
			}
			NOT = {
				has_war_with = GER
			}
			is_in_faction_with = ROOT
		}

		search_filters = { }

		completion_reward = {

			navy_experience = 15

			add_tech_bonus = {
				name = BRA_german_sub_initiative
				bonus = 0.75
				uses = 1
				category = submarine_doctrine
			}

			add_tech_bonus = {
				name = BRA_german_sub_initiative
				bonus = 0.5
				uses = 1
				category = ss_tech
			}

			random_core_state = {
				limit = {
					is_coastal = yes
					free_building_slots = {
						building = dockyard
						size > 0
						include_locked = yes
					}

					NOT = {
						has_dynamic_modifier = { modifier = BRA_neglected_state_dynamic_modifier }
					}

					is_owned_and_controlled_by = ROOT
				}
				add_extra_state_shared_building_slots = 2
				add_building_construction = {
					type = naval_base
					level = 2
					instant_build = yes
					province = {
						all_provinces = yes
						limit_to_naval_base = yes
				    }
				}
			}

			custom_effect_tooltip = generic_skip_one_line_tt

			add_breakthrough_progress = {
				specialization = specialization_naval
				value = 0.5
			}
		}

	}

	focus = {
		id = BRA_german_cooperation
		icon = GFX_focus_ger_reichskommisariats
		prerequisite = { 
			focus = BRA_german_tanks 
			focus = BRA_german_subs
		}
		x = -1
		y = 1
		relative_position_id = BRA_german_subs
		cost = 10
		ai_will_do = {
			factor = 10
		}
		available = {
			GER = {
				exists = yes
			}
			NOT = {
				has_war_with = GER
			}
			498 = {
				is_owned_and_controlled_by = ROOT
			}
			is_in_faction_with = ROOT
		}

		search_filters = { }

		completion_reward = {
			498 = {
				add_extra_state_shared_building_slots = 3
				add_building_construction = {
					type = naval_base
					level = 3
					instant_build = yes
					province = {
						id = 10933
				    }
				}
				add_building_construction = {
					type = dockyard
					level = 3
					instant_build = yes
				}
				

			}
			custom_effect_tooltip = BRA_german_cooperation_tt
			custom_effect_tooltip = BRA_german_cooperation_tt_2
			hidden_effect = {
				GER = {
					create_ship = {
						type = ship_hull_submarine_1
						equipment_variant = "Type II Class"
						creator = GER
						name = "Type IIA U-1"
					}
					transfer_ship={
					  prefer_name = "Type IIA U-1"
					  type = submarine
					  target = ROOT
					  exclude_refitting = no
					}
					create_ship = {
						type = ship_hull_submarine_1
						equipment_variant = "Type II Class"
						creator = GER
						name = "Type IIA U-2"
					}
					transfer_ship={
					  prefer_name = "Type IIA U-2"
					  type = submarine
					  target = ROOT
					  exclude_refitting = no
					}
					create_ship = {
						type = ship_hull_submarine_1
						equipment_variant = "Type II Class"
						creator = GER
						name = "Type IIA U-3"
					}
					transfer_ship={
					  prefer_name = "Type IIA U-3"
					  type = submarine
					  target = ROOT
					  exclude_refitting = no
					}
					create_ship = {
						type = ship_hull_submarine_1
						equipment_variant = "Type II Class"
						creator = GER
						name = "Type IIA U-4"
					}
					transfer_ship={
					  prefer_name = "Type IIA U-4"
					  type = submarine
					  target = ROOT
					  exclude_refitting = no
					}
					create_ship = {
						type = ship_hull_submarine_1
						equipment_variant = "Type II Class"
						creator = GER
						name = "Type IIA U-5"
					}
					transfer_ship={
					  prefer_name = "Type IIA U-5"
					  type = submarine
					  target = ROOT
					  exclude_refitting = no
					}
					create_ship = {
						type = ship_hull_submarine_1
						equipment_variant = "Type II Class"
						creator = GER
						name = "Type IIA U-6"
					}
					transfer_ship={
					  prefer_name = "Type IIA U-6"
					  type = submarine
					  target = ROOT
					  exclude_refitting = no
					}
					create_ship = {
						type = ship_hull_submarine_1
						equipment_variant = "Type II Class"
						creator = GER
						name = "Type IIA U-7"
					}
					transfer_ship={
					  prefer_name = "Type IIA U-7"
					  type = submarine
					  target = ROOT
					  exclude_refitting = no
					}
					create_ship = {
						type = ship_hull_submarine_1
						equipment_variant = "Type II Class"
						creator = GER
						name = "Type IIA U-8"
					}
					transfer_ship={
					  prefer_name = "Type IIA U-8"
					  type = submarine
					  target = ROOT
					  exclude_refitting = no
					}
					create_ship = {
						type = ship_hull_submarine_1
						equipment_variant = "Type II Class"
						creator = GER
						name = "Type IIA U-9"
					}
					transfer_ship={
					  prefer_name = "Type IIA U-9"
					  type = submarine
					  target = ROOT
					  exclude_refitting = no
					}
					create_ship = {
						type = ship_hull_submarine_1
						equipment_variant = "Type II Class"
						creator = GER
						name = "Type IIA U-10"
					}
					transfer_ship={
					  prefer_name = "Type IIA U-10"
					  type = submarine
					  target = ROOT
					  exclude_refitting = no
					}
				}
				IF = {
					limit = {
						299 = {
							NOT = {
								OR = {
									is_owned_by = ROOT
									is_owned_by = GER
								}
							}
						}
					}
					299 = { add_claim_by = ROOT }
				}
				IF = {
					limit = {
						720 = {
							NOT = {
								OR = {
									is_owned_by = ROOT
									is_owned_by = GER
								}
							}
						}
					}
					720 = { add_claim_by = ROOT }
				}
				IF = {
					limit = {
						704 = {
							NOT = {
								OR = {
									is_owned_by = ROOT
									is_owned_by = GER
								}
							}
						}
					}
					704 = { add_claim_by = ROOT }
				}
				IF = {
					limit = {
						703 = {
							NOT = {
								OR = {
									is_owned_by = ROOT
									is_owned_by = GER
								}
							}
						}
					}
					703 = { add_claim_by = ROOT }
				}
				IF = {
					limit = {
						702 = {
							NOT = {
								OR = {
									is_owned_by = ROOT
									is_owned_by = GER
								}
							}
						}
					}
					702 = { add_claim_by = ROOT }
				}
				IF = {
					limit = {
						691 = {
							NOT = {
								OR = {
									is_owned_by = ROOT
									is_owned_by = GER
								}
							}
						}
					}
					691 = { add_claim_by = ROOT }
				}
				IF = {
					limit = {
						692 = {
							NOT = {
								OR = {
									is_owned_by = ROOT
									is_owned_by = GER
								}
							}
						}
					}
					692 = { add_claim_by = ROOT }
				}
				IF = {
					limit = {
						694 = {
							NOT = {
								OR = {
									is_owned_by = ROOT
									is_owned_by = GER
								}
							}
						}
					}
					694 = { add_claim_by = ROOT }
				}
				IF = {
					limit = {
						308 = {
							NOT = {
								OR = {
									is_owned_by = ROOT
									is_owned_by = GER
								}
							}
						}
					}
					308 = { add_claim_by = ROOT }
				}
				IF = {
					limit = {
						695 = {
							NOT = {
								OR = {
									is_owned_by = ROOT
									is_owned_by = GER
								}
							}
						}
					}
					695 = { add_claim_by = ROOT }
				}
				IF = {
					limit = {
						178 = {
							NOT = {
								OR = {
									is_owned_by = ROOT
									is_owned_by = GER
								}
							}
						}
					}
					178 = { add_claim_by = ROOT }
				}
			}
			every_navy_leader = {
				limit = {
					NOT = { has_character_flag = SMB_naval_academy_boost }
				}
				add_trait = {
					trait = seawolf 
				}
			}
		}
	}

	focus = {
		id = BRA_guyana_crisis
		icon = GFX_focus_generic_attack_the_guyanas
		prerequisite = { 
			focus = BRA_domination_of_the_americas 
		}
		x = 4
		y = 1
		relative_position_id = BRA_domination_of_the_americas
		cost = 5
		ai_will_do = {
			factor = 10
			modifier = {
				factor = 5
				OR = {
					ENG = { has_war_with_major = yes }
					FRA = { has_war_with_major = yes }
					HOL = { has_war_with_major = yes }
				}
			}
			modifier = {
				factor = 0
				has_war_with_major = yes
			}
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_ANNEXATION }
		will_lead_to_war_with = ENG
		will_lead_to_war_with = FRA
		will_lead_to_war_with = HOL
		completion_reward = {
			every_other_country = {
				limit = {
					any_owned_state = {
						region = 280
					}
					NOT = {
						OR = {
							is_in_faction_with = ROOT
							capital_scope = {
								is_on_continent = south_america
							}
							has_war_with = ROOT
						}
					}
				}
				country_event = {
					id = JUNO_brazil_events.32
					hours = 1
				}
			}
		}
	}

	focus = {
		id = BRA_defense_of_the_fatherland
		icon = GFX_focus_BRA_for_the_fatherland
		prerequisite = { 
			focus = BRA_domination_of_the_americas 
		}
		x =-2
		y = 1
		relative_position_id = BRA_domination_of_the_americas
		cost = 10
		ai_will_do = {
			factor = 30
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_INDUSTRY }

		completion_reward = {
			add_political_power = 100
			random_core_state = {
				limit = {
					free_building_slots = {
						building = arms_factory
						size > 0 
						include_locked = yes
					}
					is_owned_and_controlled_by = ROOT
					NOT = {
						OR = {
							state = 961
							state = 962
							state = 963
							state = 964
							state = 965
							state = 966
							state = 967
							state = 968
						}
					}
				}
				add_extra_state_shared_building_slots = 2
				add_building_construction = {
					type = arms_factory
					level = 2
					instant_build = yes
				} 
			}  
		}
	}

	focus = {
		id = BRA_uruguay_ultimatum
		icon = GFX_focus_generic_attack_uruguay
		prerequisite = { 
			focus = BRA_anaue
			focus = BRA_the_polaca 
		}
		x = -2
		y = 1
		relative_position_id = BRA_anaue
		cost = 5
		ai_will_do = {
			factor = 0
		}
		will_lead_to_war_with = URG
		available = {
			has_war_support > 0.5
		}

		search_filters = { FOCUS_FILTER_ANNEXATION }

		completion_reward = {
			URG = {
				country_event = {
					id = JUNO_brazil_events.40
					hours = 1
				}
			}
			add_war_support = 0.1
		}
	}

	focus = {
		id = BRA_rome_accords
		icon = GFX_focus_befriend_italy
		prerequisite = { 
			focus = BRA_domination_of_the_americas 
		}
		bypass = {
			is_in_faction_with = ITA
		}
		#mutually_exclusive = { focus = BRA_berlin_accords }
		x = 0
		y = 1
		relative_position_id = BRA_domination_of_the_americas
		cost = 5
		ai_will_do = {
			factor = 10
			modifier = {
				factor = 0
				has_completed_focus = BRA_berlin_accords
				ITA = {
					has_war_with = GER
				}
			}
		}
		available = {
			is_subject = no
			is_in_faction = no
			ITA = {
				OR = {
					has_government = fascism
					has_government = neutrality
				}
				NOT = {
					has_war_with = ROOT
				}
			}
		}

		search_filters = { }

		completion_reward = {
			ITA = {
				country_event = {
					id = JUNO_brazil_events.30
					hours = 1
				}
			}
			add_political_power = 50
			custom_effect_tooltip = BRA_accords_tt
			effect_tooltip = {
				IF = {
					limit = {
						ITA = {
							is_in_faction = yes
						}
					}
					ITA = {
						add_to_faction = ROOT
					}
				}
				ELSE = {
					ITA = {
						create_faction_from_template = {
							template = faction_template_generic_dominance
							name = faction_name_bra_ita
							icon = GFX_faction_logo_generic_fascist
						}
						add_to_faction = ROOT
					}
				}
				ITA = {
					add_opinion_modifier = {
						target = ROOT
						modifier = large_increase 
					}
				}
			}
		}
	}

	focus = {
		id = BRA_italian_car_industry
		icon = GFX_focus_ITA_redirect_alfa_romeo_production
		prerequisite = { 
			focus = BRA_rome_accords 
			focus = BRA_berlin_accords
		}
		x = 0
		y = 1
		relative_position_id = BRA_rome_accords
		cost = 10
		ai_will_do = {
			factor = 10
		}
		available = {
			ITA = {
				OR = {
					has_government = fascism
					has_government = neutrality
				}
			}
			is_in_faction_with = ITA
		}

		search_filters = { FOCUS_FILTER_INDUSTRY }

		completion_reward = {
			add_tech_bonus = {
				name = BRA_italian_truck_exchange
				bonus = 0.50
				uses = 2
				category = motorized_equipment 
				category = cat_mechanized_equipment 
			}	

			add_equipment_to_stockpile = { 
				type = motorized_equipment
				amount = 200 
				producer = ITA
			}
		}
	}

	focus = {
		id = BRA_italian_aircraft
		icon = GFX_focus_BRA_italian_aircraft_development
		prerequisite = { 
			focus = BRA_italian_car_industry 
		}
		x = -1
		y = 1
		relative_position_id = BRA_italian_car_industry
		cost = 5
		ai_will_do = {
			factor = 10
		}
		available = {
			ITA = {
				exists = yes
			}
			NOT = {
				has_war_with = ITA
			}
			is_in_faction_with = ITA
		}

		search_filters = { }

		completion_reward = {

			air_experience = 15
			IF = {
				limit = {
					has_dlc = "Arms Against Tyranny" 
				}
				custom_effect_tooltip = available_mio_tt
				show_mio_tooltip = ITA_fiat_aviazione_organization
				mio:ITA_fiat_aviazione_organization = {
					add_mio_size = 2
				}
			}
			ELSE = {
				IF = {
					limit = {
						NOT = {
							has_idea = JUNO_license_air_idea
						}
					}
					add_ideas = JUNO_license_air_idea
				}
				add_tech_bonus = {
					name = BRA_Italian_plane_exchange
					bonus = 0.5
					uses = 2
					category = light_air
					category = medium_air
				}	
			}
			if = {
				limit = {
					has_dlc = "By Blood Alone"
				}
				add_equipment_to_stockpile = { 
					type = small_plane_airframe_1
					amount = 200
					producer = ITA
				}
			}
			else = {
				add_equipment_to_stockpile = { 
					type = fighter_equipment_1
					amount = 200
					producer = ITA
				}
			}
			random_core_state = {
				limit = {
					free_building_slots = {
						building = arms_factory
						size > 0 
						include_locked = yes
					}
					is_owned_and_controlled_by = ROOT
					NOT = {
						OR = {
							state = 961
							state = 962
							state = 963
							state = 964
							state = 965
							state = 966
							state = 967
							state = 968
						}
					}
				}
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = arms_factory
					level = 1
					instant_build = yes
				} 
			}
		}
	}

	focus = {
		id = BRA_italian_trucks
		icon = GFX_focus_BRA_joint_italian_motor_development
		prerequisite = { 
			focus = BRA_italian_car_industry 
		}
		x = 1
		y = 1
		relative_position_id = BRA_italian_car_industry
		cost = 5
		ai_will_do = {
			factor = 10
		}
		available = {
			ITA = {
				exists = yes
			}
			NOT = {
				has_war_with = ITA
			}
			is_in_faction_with = ITA
		}

		search_filters = { FOCUS_FILTER_INDUSTRY }

		completion_reward = { 
			IF = {
				limit = {
					has_dlc = "Arms Against Tyranny"
				}

				custom_effect_tooltip = available_mio_tt
				show_mio_tooltip = ITA_fiat_organization
				mio:ITA_fiat_organization = {
					add_mio_size = 2
				}

				random_core_state = {
					limit = {
						free_building_slots = {
							building = arms_factory
							size > 0 
							include_locked = yes
						}
						is_owned_and_controlled_by = ROOT
						NOT = {
							OR = {
								state = 961
								state = 962
								state = 963
								state = 964
								state = 965
								state = 966
								state = 967
								state = 968
							}
						}
					}
					add_extra_state_shared_building_slots = 1
					add_building_construction = {
						type = arms_factory
						level = 1
						instant_build = yes
					} 
				}
			}
			ELSE = {
				random_core_state = {
					limit = {
						free_building_slots = {
							building = industrial_complex
							size > 0
							include_locked = yes
						}
						is_owned_and_controlled_by = ROOT
						NOT = {
							OR = {
								state = 961
								state = 962
								state = 963
								state = 964
								state = 965
								state = 966
								state = 967
								state = 968
							}
						}
					}
					add_extra_state_shared_building_slots = 2
					add_building_construction = {
						type = industrial_complex
						level = 2
						instant_build = yes
					}
				}
			}
		}
	}

	focus = {
		id = BRA_italian_cooperation
		icon = GFX_focus_ITA_ministry_of_italian_africa
		prerequisite = { 
			focus = BRA_italian_trucks 
			focus = BRA_italian_aircraft
		}
		x = -1
		y = 1
		relative_position_id = BRA_italian_trucks
		cost = 10
		ai_will_do = {
			factor = 10
		}
		available = {
			ITA = {
				exists = yes
				is_in_faction_with = ROOT
			}
		}

		search_filters = { }

		completion_reward = {
			every_state = {
				limit = {
					OR = {
						region = 226
						region = 140
					}					
					NOT = {
						OR = {
							is_owned_by = ROOT
							is_owned_by = ITA
							OWNER = {
								is_in_faction_with = ROOT
							}
						}
					}
				}
				add_claim_by = ROOT
			}
			add_equipment_to_stockpile = { 
				type = infantry_equipment
				amount = 4000
				producer = ITA
			}
			random_army_leader = {		
				limit = {
					NOT = {
						has_trait = ranger
					}
				}
				add_trait = {
					trait = ranger
				}
			}
			random_army_leader = {	
				limit = {
					NOT = {
						has_trait = ranger
					}
				}	
				add_trait = {
					trait = ranger
				}
			}
			random_army_leader = {	
				limit = {
					NOT = {
						has_trait = ranger
					}
				}	
				add_trait = {
					trait = ranger
				}
			}
		}
	}

	focus = {
		id = BRA_attack_bolivia
		icon = GFX_focus_generic_attack_bolivia
		prerequisite = { 
			focus = BRA_guyana_crisis 
			#focus = BRA_uruguay_ultimatum
		}
		bypass = {
			BOL = {
				OR = {
					is_in_faction_with = ROOT
					exists = no
					is_subject_of = ROOT
				}
			}
		}
		x = -1
		y = 1
		relative_position_id = BRA_guyana_crisis
		cost = 5
		ai_will_do = {
			factor = 15
			modifier = {
				factor = 0
				has_war_with_major = yes
			}
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_ANNEXATION }
		will_lead_to_war_with = BOL
		completion_reward = {
			create_wargoal = {
				target = BOL
				type = annex_everything
				expire = 0
			}
		}
	}

	focus = {
		id = BRA_paraguay_intervention
		icon = GFX_focus_generic_attack_paraguay
		prerequisite = { 
			#focus = BRA_uruguay_ultimatum
			focus = BRA_guyana_crisis
		}
		bypass = {
			PAR = {
				OR = {
					is_in_faction_with = ROOT
					exists = no
					is_subject_of = ROOT
				}
			}
		}
		x = 1
		y = 1
		relative_position_id = BRA_guyana_crisis
		will_lead_to_war_with = PAR
		cost = 5
		ai_will_do = {
			factor = 10
			modifier = {
				factor = 0
				has_war_with_major = yes
			}
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_ANNEXATION }

		completion_reward = {
			PAR = {
				country_event = {
					id = JUNO_brazil_events.45
					hours = 1
				}
			}
		}
	}

	focus = {
		id = BRA_provoke_argentina
		icon = GFX_focus_generic_attack_argentina
		prerequisite = { 
			focus = BRA_attack_bolivia 
			focus = BRA_paraguay_intervention
		}
		bypass = {
			ARG = {
				OR = {
					is_in_faction_with = ROOT
					exists = no
					is_subject_of = ROOT
				}
			}
		}
		x = 0
		y = 1
		relative_position_id = BRA_paraguay_intervention
		cost = 5
		ai_will_do = {
			factor = 15
			modifier = {
				factor = 0
				has_war_with_major = yes
			}
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_ANNEXATION }
		will_lead_to_war_with = ARG
		completion_reward = {
			ARG = {
				country_event = {
					id = JUNO_brazil_events.37
					hours = 1
				}
			}
		}
	}

	focus = {
		id = BRA_attack_chile
		icon = GFX_focus_generic_attack_chile
		prerequisite = { 
			focus = BRA_paraguay_intervention 
			focus = BRA_attack_bolivia
		}
		bypass = {
			CHL = {
				OR = {
					is_in_faction_with = ROOT
					exists = no
					is_subject_of = ROOT
				}
			}
		}
		x = 0
		y = 1
		relative_position_id = BRA_attack_bolivia
		cost = 5
		ai_will_do = {
			factor = 15
			modifier = {
				factor = 0
				has_war_with_major = yes
			}
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_ANNEXATION }
		will_lead_to_war_with = CHL
		completion_reward = {
			create_wargoal = {
				target = CHL
				type = annex_everything
				expire = 0
			}
		}
	}

	focus = {
		id = BRA_panama_push
		icon = GFX_goal_generic_attack_allies	
		prerequisite = { 
			focus = BRA_provoke_argentina
			focus = BRA_attack_chile
		}
		x = 1
		y = 1
		relative_position_id = BRA_attack_chile
		will_lead_to_war_with = ECU
		will_lead_to_war_with = VEN
		will_lead_to_war_with = PRU
		will_lead_to_war_with = PAN
		will_lead_to_war_with = COL
		cost = 10
		ai_will_do = {
			factor = 10
			modifier = {
				factor = 0
				has_war_with_major = yes
			}
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_ANNEXATION }

		completion_reward = {
			IF = {
				limit = {
					ECU = {
						exists = yes
						NOT = {
							is_in_faction_with = ROOT
						}
					}
				}
				create_wargoal = {
					target = ECU
					type = annex_everything
					expire = 0
				}
			}
			IF = {
				limit = {
					VEN = {
						exists = yes
						NOT = {
							is_in_faction_with = ROOT
						}
					}
				}
				create_wargoal = {
					target = VEN
					type = annex_everything
					expire = 0
				}
			}
			IF = {
				limit = {
					PRU = {
						exists = yes
						NOT = {
							is_in_faction_with = ROOT
						}
					}
				}
				create_wargoal = {
					target = PRU
					type = annex_everything
					expire = 0
				}
			}
			IF = {
				limit = {
					PAN = {
						exists = yes
						NOT = {
							is_in_faction_with = ROOT
						}
					}
				}
				create_wargoal = {
					target = PAN
					type = annex_everything
					expire = 0
				}
			}
			IF = {
				limit = {
					COL = {
						exists = yes
						NOT = {
							is_in_faction_with = ROOT
						}
					}
				}
				create_wargoal = {
					target = COL
					type = annex_everything
					expire = 0
				}
			}
			add_timed_idea = { 
				idea = BRA_panama_push
				days = 365
			}
		}
	}

	focus = {
		id = BRA_form_mercosul
		icon = GFX_focus_BRA_form_mercosul
		prerequisite = { 
			focus = BRA_domination_of_the_americas
			#focus = BRA_provoke_argentina
		}
		x = 2
		y = 1
		relative_position_id = BRA_domination_of_the_americas
		cost = 5
		ai_will_do = {
			factor = 5
			modifier = {
				factor = 0 
				is_in_faction = yes
			}
		}
		available = {
			is_subject = no
			is_in_faction = no
		}

		search_filters = { }

		completion_reward = {
			set_rule = { can_create_factions = yes }
			create_faction_from_template = {
				template = faction_template_pan_american
				name = BRA_faction_mercosul_name
				icon = GFX_faction_logo_generic_fascist
			}
			custom_effect_tooltip = BRA_form_mercosul_focus_tt
		}
	}

	##############################################

	##### Domination of the Americas Branch #####

	focus = {
		id = BRA_end_the_state_of_emergency
		icon = GFX_focus_BRA_end_the_state_of_emergency
		x = -15
		y = 0
		relative_position_id = BRA_tribunal_de_seguranca_nacional
		mutually_exclusive = { focus = BRA_tribunal_de_seguranca_nacional focus = BRA_prepare_for_second_intentona }
		cost = 5
		ai_will_do = {
			factor = 5
		}
		available = {
		}
		allow_branch = {
			IF = {
				limit = {
					has_game_rule = {
						rule = obsolete_focus_branches_visibility
						option = HIDE
					}
				}
				NOT = { has_completed_focus = BRA_prepare_for_second_intentona }
				NOT = { has_completed_focus = BRA_tribunal_de_seguranca_nacional }
			}
		}
		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_STABILITY }

		completion_reward = {
			remove_dynamic_modifier = {
				modifier = BRA_aftermath_of_the_coup
			}
			if = {
				limit = {
					has_game_rule = {
						rule = obsolete_focus_branches_visibility
						option = HIDE
					}
				}
				mark_focus_tree_layout_dirty = yes
			}
		}
	}

	focus = {
		id = BRA_repeal_the_national_security_law
		icon = GFX_focus_BRA_repeale_national_security_law
		x = -4
		y = 1
		relative_position_id = BRA_end_the_state_of_emergency
		prerequisite = { focus = BRA_end_the_state_of_emergency }
		mutually_exclusive = { focus = BRA_romanticize_the_old_empire }
		cost = 5
		ai_will_do = {
			factor = 20
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {
			hidden_effect = {
				BRA_armando_de_sales_oliveira = {
					promote_leader = yes
				}
				retire_country_leader = yes
			}
			effect_tooltip = {
				retire_country_leader = yes
				BRA_armando_de_sales_oliveira = {
					add_country_leader_role = {
						country_leader = {
							ideology = liberalism
							expire = "1965.1.1.1"
							traits = { democratic_reformer }
						}
					} 
					promote_leader = yes
				}
			}
			set_party_name = {
				ideology = democratic
				name = BRA_democratic_union
				long_name = BRA_democratic_union_long
			}
		}
	}

	focus = {
		id = BRA_greater_federalism
		icon = GFX_focus_BRA_greater_federalism
		x = -1
		y = 1
		relative_position_id = BRA_repeal_the_national_security_law
		prerequisite = { focus = BRA_repeal_the_national_security_law }
		mutually_exclusive = { focus = BRA_continue_centralization } 
		cost = 5
		ai_will_do = {
			factor = 10
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_STABILITY }

		completion_reward = {
			add_ideas = BRA_federal_republic
		}
	}


	#focus = {
	#	id = BRA_democratic_socialism
	#	#icon = 
	#	x = -4
	#	y = 4
	#	relative_position_id = BRA_greater_federalism
	#	prerequisite = { focus = BRA_end_military_interference }
	#	cost = 10
	#	ai_will_do = {
	#		factor = 5
	#	}
	#	available = {
	#	}
#
	#	search_filters = { FOCUS_FILTER_POLITICAL }
#
	#	completion_reward = {
	#		custom_effect_tooltip = "TODO: Unlock some socialist advisors"
	#	}
	#}

	focus = {
		id = BRA_continue_centralization
		icon = GFX_focus_BRA_centralization
		x = 1
		y = 1
		relative_position_id = BRA_repeal_the_national_security_law
		prerequisite = { focus = BRA_repeal_the_national_security_law }
		mutually_exclusive = { focus = BRA_greater_federalism }
		cost = 5
		ai_will_do = {
			factor = 10
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_STABILITY }

		completion_reward = {
			add_ideas = BRA_presidential_republic
		}
	}

	focus = {
		id = BRA_court_the_military
		icon = GFX_focus_BRA_reach_out_to_military_dem
		x = 0
		y = 2
		relative_position_id = BRA_continue_centralization
		prerequisite = { focus = BRA_continue_centralization }
		cost = 10
		ai_will_do = {
			factor = 10
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_WAR_SUPPORT FOCUS_FILTER_MANPOWER }

		completion_reward = {
			add_ideas = BRA_court_the_military_idea
		}
	}


	focus = {
		id = BRA_implement_a_national_guard
		icon = GFX_focus_BRA_national_guard
		x = 0
		y = 2
		relative_position_id = BRA_greater_federalism
		prerequisite = { focus = BRA_greater_federalism }
		cost = 10
		ai_will_do = {
			factor = 10
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {
			custom_effect_tooltip = BRA_implement_a_national_guard_tt
			IF = {
				limit = {
					NOT = {
						has_tech = tech_military_police
					}
				}
				set_technology = { tech_military_police = 1 }
			}
			ELSE = {
				army_experience = 20
			}
			hidden_effect = {
				division_template = {
					name = "Guarda Nacional"
					#division_names_group = 
					is_locked = no
					force_allow_recruiting = yes
					override_model = BRA_militia_entity
					#division_cap = 6
					template_counter = 06
					regiments = {
						infantry = { x = 0 y = 0 }
						infantry = { x = 0 y = 1 }
						infantry = { x = 0 y = 2 }
						infantry = { x = 1 y = 0 }
						infantry = { x = 1 y = 1 }
						infantry = { x = 1 y = 2 }
					}
					support = {
						engineer = { x = 0 y = 0 }
						military_police = { x = 0 y = 1 }
					}
				}
				capital_scope = {
					create_unit = {
						division = "division_template = \"Guarda Nacional\" start_experience_factor = 0 start_equipment_factor = 1.0"
						OWNER = ROOT
					}
					create_unit = {
						division = "division_template = \"Guarda Nacional\" start_experience_factor = 0 start_equipment_factor = 1.0"
						OWNER = ROOT
					}
					create_unit = {
						division = "division_template = \"Guarda Nacional\" start_experience_factor = 0 start_equipment_factor = 1.0"
						OWNER = ROOT
					}
					create_unit = {
						division = "division_template = \"Guarda Nacional\" start_experience_factor = 0 start_equipment_factor = 1.0"
						OWNER = ROOT
					}
					create_unit = {
						division = "division_template = \"Guarda Nacional\" start_experience_factor = 0 start_equipment_factor = 1.0"
						OWNER = ROOT
					}
					create_unit = {
						division = "division_template = \"Guarda Nacional\" start_experience_factor = 0 start_equipment_factor = 1.0"
						OWNER = ROOT
					}
				}
			}
		}
	}

	focus = {
		id = BRA_nationalize_the_banks
		icon = GFX_focus_BRA_nationalize_banks
		x = 0
		y = 1
		relative_position_id = BRA_implement_a_national_guard
		prerequisite = { focus = BRA_implement_a_national_guard }
		#mutually_exclusive = { focus = BRA_establish_the_brazilian_investment_bank }
		cost = 5
		ai_will_do = {
			factor = 15
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_STABILITY }

		completion_reward = {
			add_ideas = BRA_nationalized_banks
		}
	}

	focus = {
		id = BRA_establish_the_brazilian_investment_bank
		icon = GFX_focus_BRA_pro_business_taxes
		x = 0
		y = 1
		relative_position_id = BRA_court_the_military
		prerequisite = { 
			focus = BRA_court_the_military 
		#	focus = BRA_constitutional_monarchy
		}
		#mutually_exclusive = { focus = BRA_nationalize_the_banks }
		cost = 5
		ai_will_do = {
			factor = 10
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {
			add_ideas = BRA_tax_haven
		}
	}

	focus = {
		id = BRA_church
		icon = GFX_focus_por_concordat
		x = 0
		y = 1
		relative_position_id = BRA_establish_the_brazilian_investment_bank
		prerequisite = { focus = BRA_establish_the_brazilian_investment_bank }
		cost = 10
		ai_will_do = {
			factor = 10
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_STABILITY }

		completion_reward = {
			add_ideas = BRA_collaboration_with_the_church
		}
	}

	focus = {
		id = BRA_implement_article_138
		icon = GFX_focus_generic_population_growth
		x = 0
		y = 1
		relative_position_id = BRA_nationalize_the_banks
		prerequisite = { focus = BRA_nationalize_the_banks }
		cost = 10
		ai_will_do = {
			factor = 15
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_STABILITY }

		completion_reward = {
			add_ideas = BRA_article_138
		}
	}

	focus = {
		id = BRA_tech_slot_2
		icon = GFX_focus_BRA_university_of_sao_paulo
		x = 1
		y = 1
		relative_position_id = BRA_implement_article_138
		prerequisite = { focus = BRA_implement_article_138 focus = BRA_church }
		cost = 10
		ai_will_do = {
			factor = 20
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_RESEARCH }

		completion_reward = {
			add_research_slot = 1
		}
	}

	focus = {
		id = BRA_ban_the_communist_party
		icon = GFX_focus_BRA_ban_communist_party
		x = 2
		y = 1
		relative_position_id = BRA_court_the_military
		prerequisite = { 
			focus = BRA_court_the_military 
			#focus = BRA_constitutional_monarchy 
		}
		cost = 5
		ai_will_do = {
			factor = 20
		}
		available = {
			communism < 0.20
		}

		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_STABILITY}

		completion_reward = {
			hidden_effect = {
				set_temp_variable = {
					var = ban_ideology_var
					value = party_popularity@communism
				}
				multiply_temp_variable = {
					var = ban_ideology_var
					value = -1
				}
				add_popularity = {
					ideology = communism
					popularity = ban_ideology_var
				}
				multiply_temp_variable = {
					var = ban_ideology_var
					value = 0.66
				}
				set_country_flag = banned_communism_flag
			}
			custom_effect_tooltip = ban_communist_party_tt
			add_stability = ban_ideology_var
			custom_effect_tooltip = BRA_ban_the_communist_party_dynamic_tt
		}
	}

	focus = {
		id = BRA_posts_for_generals
		icon = GFX_focus_generic_military_mission
		x = 0
		y = 2
		relative_position_id = BRA_ban_the_communist_party
		prerequisite = { focus = BRA_ban_the_communist_party }
		cost = 10
		ai_will_do = {
			factor = 10
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_STABILITY FOCUS_FILTER_POLITICAL_CHARACTER}

		completion_reward = {
			remove_dynamic_modifier = {
				modifier = BRA_weak_government
			}
			custom_effect_tooltip = BRA_posts_for_generals_tt
		}
	}

	focus = {
		id = BRA_third_republic
		icon = GFX_focus_BRA_third_republic
		x = 0
		y = 1
		relative_position_id = BRA_posts_for_generals
		prerequisite = { focus = BRA_posts_for_generals }
		cost = 5
		ai_will_do = {
			factor = 10
		}
		available = {
			num_of_factories > 25
			has_stability > 0.7
		}

		search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {
			set_cosmetic_tag = BRA_third_republic_democratic
			add_ideas = BRA_stability_and_unity
			remove_ideas = BRA_separatism_idea
		}
	}

	focus = {
		id = BRA_end_military_interference
		icon = GFX_focus_NOR_broken_gun_policies
		x = -2
		y = 1
		relative_position_id = BRA_implement_a_national_guard
		prerequisite = { focus = BRA_implement_a_national_guard }
		cost = 10
		available = {
			#neutrality < 0.21
		}
		cancel_if_invalid = no

		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_STABILITY }

		completion_reward = {
			remove_dynamic_modifier = {
				modifier = BRA_weak_government
			}
			#hidden_effect = {
			#	set_temp_variable = {
			#		var = ban_ideology_var
			#		value = party_popularity@neutrality
			#	}
			#	multiply_temp_variable = {
			#		var = ban_ideology_var
			#		value = -1
			#	}
			#	add_popularity = {
			#		ideology = neutrality
			#		popularity = ban_ideology_var
			#	}
			#	multiply_temp_variable = {
			#		var = ban_ideology_var
			#		value = 0.66
			#	}
			#	set_country_flag = banned_neutrality_flag
			#}
			#custom_effect_tooltip = BRA_end_military_interference_tt
			#add_stability = ban_ideology_var
		}
	}

	focus = {
		id = BRA_free_speech
		icon = GFX_focus_BRA_democratic_socialism
		x = 0
		y = 2
		relative_position_id = BRA_end_military_interference
		prerequisite = { focus = BRA_end_military_interference }
		cost = 10
		available = {
		}

		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_POLITICAL_CHARACTER}

		completion_reward = {
			add_political_power = 100
			remove_ideas = BRA_separatism_idea
			custom_effect_tooltip = BRA_free_speech_tt
			show_ideas_tooltip = BRA_lindolfo_collor
			show_ideas_tooltip = BRA_jose_americo_de_almeida
			show_ideas_tooltip = BRA_armando_de_sales_oliveira
			show_ideas_tooltip = BRA_anisio_teixeira
		}
	}

	focus = {
		id = BRA_united_states_of_brazil
		icon = GFX_focus_BRA_us_of_south_america
		x = 0
		y = 1
		relative_position_id = BRA_free_speech
		prerequisite = { focus = BRA_free_speech }
		cost = 5
		ai_will_do = {
			factor = 10
		}
		available = {
			num_of_factories > 25
			has_stability > 0.7
			has_government = democratic
		}

		search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {
			set_cosmetic_tag = BRA_united_states_of_brazil_cos_tag
			add_ideas = BRA_us_of_brazil
		}
	}

	focus = {
		id = BRA_united_states_of_south_america
		icon = GFX_focus_BRA_us_of_brazil
		x = 2
		y = 1
		relative_position_id = BRA_us_brazil_technology_exchange
		prerequisite = { focus = BRA_us_brazil_technology_exchange focus = BRA_south_american_research_cooperation }
		cost = 5
		ai_will_do = {
			factor = 0
		}
		available = {
			OR = {
				has_government = democratic
				has_government = neutrality
			}
			is_in_faction = yes
			any_other_country = {
				is_in_faction_with = ROOT
				capital_scope = {
					is_on_continent = south_america
					#is_core_of = PREV
				}
			}
		}

		search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {
			set_cosmetic_tag = BRA_united_states_of_south_america_cos_tag
			custom_effect_tooltip = BRA_united_states_of_south_america_tt
		}	
	}

	focus = {
		id = BRA_address_labor_disputes
		icon = GFX_focus_generic_workers
		x = 0
		y = 1
		relative_position_id = BRA_tech_slot_2
		prerequisite = { focus = BRA_free_speech focus = BRA_posts_for_generals }
		cost = 5
		ai_will_do = {
			factor = 10
		}
		available = {
			OR = {
				AND = {
					democratic > 0.6
					has_stability > 0.4
				}
				has_war = yes
			}
		}

		search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {
			country_event = {
				id = JUNO_brazil_events.163
				hours = 1
			}
			custom_effect_tooltip = BRA_address_labor_disputes_tt_1
			event_option_tooltip = JUNO_brazil_events.163.a
			custom_effect_tooltip = BRA_address_labor_disputes_tt_2
			event_option_tooltip = JUNO_brazil_events.163.b

		}
	}

	focus = {
		id = BRA_combat_separatism
		icon = GFX_goal_generic_national_unity
		x = -2
		y = 2
		relative_position_id = BRA_address_labor_disputes
		prerequisite = { focus = BRA_address_labor_disputes }
		cost = 5
		ai_will_do = {
			factor = 5
		}
		available = {
			has_idea = BRA_separatism_idea
			has_civil_war = no
		}

		search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {
			remove_ideas = BRA_separatism_idea
			add_political_power = 100
		}
	}

	focus = {
		id = BRA_war_bonds
		icon = GFX_focus_SWI_issue_war_bonds
		x = 2
		y = 2
		relative_position_id = BRA_address_labor_disputes
		prerequisite = { focus = BRA_address_labor_disputes }
		cost = 5
		ai_will_do = {
			factor = 5
		}
		#available = {
		#	has_idea = BRA_separatism_idea
		#}

		search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {
			add_ideas = BRA_war_bonds
		}
	}

	focus = {
		id = BRA_invite_foreign_companies
		icon = GFX_focus_generic_american_investments
		allow_branch = {
			has_dlc = "Arms Against Tyranny"
			IF = {
				limit = {
					has_game_rule = {
						rule = obsolete_focus_branches_visibility
						option = HIDE
					}
				}
				NOT = { has_completed_focus = BRA_tribunal_de_seguranca_nacional }
				NOT = { has_completed_focus = BRA_prepare_for_second_intentona }
			}
		}
		x = 1
		y = 1
		relative_position_id = BRA_address_labor_disputes
		prerequisite = { focus = BRA_address_labor_disputes }
		cost = 5
		ai_will_do = {
			factor = 5
		}
		available = {
			OR = {
				USA = {
					exists = yes
					has_government = democratic
				}
				ENG = {
					exists = yes
					has_government = democratic
				}
				FRA = {
					exists = yes
					has_government = democratic
				}
				SWE = {
					exists = yes
					has_government = democratic
				}
			}
		}

		search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {
			custom_effect_tooltip = BRA_invite_foreign_companies_tt
			#USA
			show_mio_tooltip = USA_marmon_herrington_organization
			show_mio_tooltip = USA_north_american_aviation_organization
			show_mio_tooltip = USA_newport_news_shipbuilding_organization
			# UK
			show_mio_tooltip = ENG_vauxhall_organization
			show_mio_tooltip = ENG_cammell_laird_organization
			show_mio_tooltip = ENG_avro_organization
			# France
			show_mio_tooltip = FRA_acf_organization
			show_mio_tooltip = FRA_bloch_organization
			show_mio_tooltip = FRA_renault_organization
			# Sweden
			show_mio_tooltip = SWE_saab_organization			
			show_mio_tooltip = SWE_landsverk_organization
			show_mio_tooltip = SWE_gotaverken_organization
			show_mio_tooltip = SWE_scania_vabis_organization
		}
	}

	focus = {
		id = BRA_the_international_crisis
		icon = GFX_focus_BRA_international_crisis
		x = 0
		y = 4
		relative_position_id = BRA_tech_slot_2
		prerequisite = { focus = BRA_address_labor_disputes }
		#mutually_exclusive = { focus = BRA_secure_our_borders }
		cost = 10
		ai_will_do = {
			factor = 30
		}
		available = {
			OR = {
				has_war_support > 0.6
				has_War = yes
			}
		}

		search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {
			add_ideas = BRA_international_crisis 
			set_rule = {
				can_send_volunteers = yes
			}
			#set_rule = {
			#	can_join_factions = yes 
			#}
		}
	}

	##############################################

	##### Communist Branch #####

	focus = {
		id = BRA_prepare_for_second_intentona
		icon = GFX_focus_por_workers_of_iberia
		x = -15
		y = 0
		relative_position_id = BRA_end_the_state_of_emergency
		mutually_exclusive = { focus = BRA_tribunal_de_seguranca_nacional focus = BRA_end_the_state_of_emergency }
		cost = 5
		available = {
		}
		ai_will_do = {
			factor = 5
		}
		search_filters = { }
		allow_branch = {
			IF = {
				limit = {
					has_game_rule = {
						rule = obsolete_focus_branches_visibility
						option = HIDE
					}
				}
				NOT = { has_completed_focus = BRA_end_the_state_of_emergency }
				NOT = { has_completed_focus = BRA_tribunal_de_seguranca_nacional }
			}
		}
		completion_reward = {
			custom_effect_tooltip = BRA_modify_aotci_ns_intro
			add_to_variable = {
				BRA_coup_communism_factor = 0.05
				tooltip = communism_drift_factor_tt
			}
			add_to_variable = {
				BRA_coup_stability_factor = -0.05
				tooltip = stability_factor_tt
			}
			add_political_power = 120

			if = {
				limit = {
					has_game_rule = {
						rule = obsolete_focus_branches_visibility
						option = HIDE
					}
				}
				mark_focus_tree_layout_dirty = yes
			}
		}
	}

	#focus = {
	#	id = BRA_seek_international_support
	#	icon = GFX_focus_ETH_callout_to_the_world
	#	x = 0
	#	y = 1
	#	relative_position_id = BRA_revive_the_anl
	#	prerequisite = { focus = BRA_revive_the_anl }
	#	#mutually_exclusive = { focus = BRA_seek_soviet_support }
	#	cost = 5
	#	available = {
	#		NOT = { has_completed_focus = BRA_launch_the_revolution }
	#	}
	#	search_filters = { }
	#	completion_reward = {
	#	}
	#}

	focus = {
		id = BRA_infilitrate_the_military
		icon = GFX_focus_SOV_military_purge
		x = -1
		y = 1
		relative_position_id = BRA_prepare_for_second_intentona
		prerequisite = { focus = BRA_prepare_for_second_intentona }
		cost = 10
		ai_will_do = {
			factor = 20
		}
		available = {
			communism > 0.30
			NOT = { has_completed_focus = BRA_launch_the_revolution }
		}

		search_filters = { }

		completion_reward = {
			custom_effect_tooltip = BRA_infilitrate_the_military_tt
			add_stability = 0.05
		}
	}

	focus = {
		id = BRA_radicalize_the_proletariat
		icon = GFX_focus_SWE_refuge_for_revolutionaries
		x = 1
		y = 1
		relative_position_id = BRA_prepare_for_second_intentona
		prerequisite = { focus = BRA_prepare_for_second_intentona }
		cost = 5
		ai_will_do = {
			factor = 30
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {
			add_timed_idea = {
				idea = BRA_radicalized_proletariat
				days = 365
			}			
		}
	}

	focus = {
		id = BRA_free_prestes
		icon = GFX_focus_BRA_free_prestes
		x = 0
		y = 1
		relative_position_id = BRA_infilitrate_the_military
		prerequisite = { focus = BRA_infilitrate_the_military focus = BRA_radicalize_the_proletariat }
		mutually_exclusive = { focus = BRA_revive_the_anl }
		cost = 5
		ai_will_do = {
			factor = 5
		}
		available = {
			NOT = {
				has_war_with = SOU
				has_completed_focus = BRA_launch_the_revolution
			}
		}

		search_filters = { FOCUS_FILTER_POLITICAL}

		completion_reward = {
			add_popularity = {
				ideology = communism
				popularity = 0.1
			}
			custom_effect_tooltip = BRA_revive_the_anl_tt
			custom_effect_tooltip = BRA_free_prestes_tt
			hidden_effect = {
				add_ai_strategy = {
					type = befriend
					id = SOV
				}
			}
		}
	}

	focus = {
		id = BRA_revive_the_anl
		icon = GFX_focus_spr_masters_of_our_own_fate
		x = 0
		y = 1
		relative_position_id = BRA_radicalize_the_proletariat
		prerequisite = { focus = BRA_radicalize_the_proletariat focus = BRA_infilitrate_the_military }
		mutually_exclusive = { focus = BRA_free_prestes }
		cost = 5
		ai_will_do = {
			factor = 5
		}
		available = {
			NOT = { has_completed_focus = BRA_launch_the_revolution }
		}

		search_filters = { }

		completion_reward = {
			add_popularity = {
				ideology = communism
				popularity = 0.05
			}
			add_stability = 0.05
			custom_effect_tooltip = BRA_revive_the_anl_tt
			#custom_effect_tooltip = BRA_revive_the_anl_tt_2
		}
	}

	focus = {
		id = BRA_sway_the_cangaco
		icon = GFX_focus_BRA_deal_with_the_cangaco
		x = 1
		y = 1
		relative_position_id = BRA_revive_the_anl
		prerequisite = { focus = BRA_revive_the_anl }
		#mutually_exclusive = { focus = BRA_seek_international_support }
		cost = 5
		ai_will_do = {
			factor = 10
		}
		available = {
			NOT = {
				has_completed_focus = BRA_deal_with_the_cangaceiro
			}
		}
		search_filters = { FOCUS_FILTER_POLITICAL}
		completion_reward = {
			army_experience = 50
			custom_effect_tooltip = BRA_sway_the_cangaco_tt
		}
	}

	focus = {
		id = BRA_seek_soviet_support
		icon = GFX_focus_BRA_seek_soviet_support
		x = 0
		y = 1
		relative_position_id = BRA_free_prestes
		prerequisite = { focus = BRA_free_prestes }
		#mutually_exclusive = { focus = BRA_seek_international_support }
		cost = 5
		ai_will_do = {
			factor = 10
		}
		available = {
			NOT = {
				OR = {
					has_war_with = SOU
					has_government = communism
				}
			}
			communism > 0.3
		}
		search_filters = { FOCUS_FILTER_POLITICAL}
		completion_reward = {
			add_political_power = 150
			SOU = { 
				country_event = {
					id = JUNO_brazil_events.86
					hours = 6
				}
			}
			custom_effect_tooltip = BRA_acceptance_tt
			event_option_tooltip = JUNO_brazil_events.86.a 
		}
	}

	focus = {
		id = BRA_launch_the_revolution
		icon = GFX_focus_SOV_builder_of_the_red_army
		x = 0
		y = 4
		relative_position_id = BRA_prepare_for_second_intentona
		prerequisite = { focus = BRA_free_prestes focus = BRA_revive_the_anl }
		cost = 10
		available = {
			communism > 0.35
		}

		bypass = {
			has_government = communism
		}

		search_filters = { }

		completion_reward = {

			set_variable = {
				var = BRA_total_anti_com_size #used to calculate how big portion of the army that is NOT supporting the communists
				value = party_popularity@democratic #democratic support
			}
	
			add_to_variable = {
				var = BRA_total_anti_com_size
				value = party_popularity@fascism #adds fascist support to variable
			}
	
			add_to_variable = {
				var = BRA_total_anti_com_size
				value = party_popularity@neutrality #adds non-aligned support to variable
			}
	
			IF = {
				limit = { has_completed_focus = BRA_infilitrate_the_military }
				add_to_variable = {
					var = BRA_total_anti_com_size
					value = -0.2
				}
			}
			
			division_template = {
				name = "Guarda Vermelha"		
				#division_names_group = SWE_BS_01
				is_locked = no
				template_counter = 69
				regiments = {
					militia = { x = 0 y = 0 }
					militia = { x = 0 y = 1 }
					militia = { x = 1 y = 0 }
					militia = { x = 1 y = 1 }
				}
				#division_cap = 0
				override_model = BRA_militia_alt_0_entity
			}
	
			set_variable = {
				BRA_cw_militia_divs = 6
			}
	
			IF = {
				limit = {
					has_completed_focus = BRA_revive_the_anl
				}
				add_to_variable = {
					BRA_cw_militia_divs = 2
				}
			}
			IF = {
				limit = {
					has_completed_focus = BRA_free_prestes
				}
				add_to_variable = {
					BRA_cw_militia_divs = 2
				}
			}

			IF = {
				limit = {
					has_completed_focus = BRA_sway_the_cangaco
				}
				division_template = {
					name = "Cangaço"		
					#division_names_group = SWE_BS_01
					is_locked = no
					template_counter = 3
					regiments = {
						militia = { x = 0 y = 0 }
						militia = { x = 0 y = 1 }
						militia = { x = 1 y = 0 }
						militia = { x = 1 y = 1 }
					}
					override_model = BRA_militia_alt_2_entity
					#division_cap = 0
				}
				show_unit_leaders_tooltip = BRA_lampiao
			}

			IF = {
				limit = {
					communism < 0.6
				}
				custom_effect_tooltip = BRA_launch_the_revolution_tt
				hidden_effect = {
					set_capital = {
						state = 499 #Salvador, the old capital, giving them 2nd biggest city, Sao Paolo, leads to being WAY too 	close to Rio de Janeiro, they could rush the capital and win.
						remember_old_capital = yes 
					}
					start_civil_war = {
						ruling_party = communism #the part the player controls
						ideology = democratic #the opposing part
						size = BRA_total_anti_com_size # Opposing strength, variable combines all other parties' popularity 
						states = { 500 501 496 943 505 280 504 944 503 502} #Dem's controlled states, Southern Brazil, Massive
						IF = {
							limit = {  PREV = { has_completed_focus = BRA_radio_nacional } }
							add_ideas = BRA_radio_nacional_idea
						} 	
					}
					BRA_communist_cw_transfer_chars = yes
					news_event = { id = JUNO_brazil_news.5 hours = 1 }
				}
			}
			ELSE_IF = {
				limit = {
					communism > 0.6
				}
				set_politics = {
					ruling_party = communism
					last_election = "1934.3.26"
					election_frequency = 48
					elections_allowed = no
				}
				news_event = { id = JUNO_brazil_news.6 hours = 1 }
			}
			499 = {
				create_unit = {
					division = "division_template =\"Guarda Vermelha\" start_experience_factor = 0.2 start_equipment_factor	= 1.0"
					owner = ROOT
					count = var:BRA.BRA_cw_militia_divs	
				} 
			}
			IF = {
				limit = {
					has_completed_focus = BRA_sway_the_cangaco
				}
				499 = {
					create_unit = {
						division = "division_template =\"Cangaço\" start_experience_factor = 0.2 start_equipment_factor	= 1.0"
						owner = ROOT
						count = 3
					} 
				}
			}
			remove_dynamic_modifier = {
				modifier = BRA_aftermath_of_the_coup
			}
			hidden_effect = {
				IF = {
					limit = { has_completed_focus = BRA_radio_nacional }
					add_ideas = BRA_radio_nacional_idea
				}
				random_country = {
					limit = {
						original_tag = BRA
						NOT = {
							has_government = communism
						}
						has_civil_war = yes
					}
					division_template = {
						name = "National Militia"		
						#division_names_group = SWE_BS_01
						is_locked = no
						template_counter = 03
						regiments = {
							militia = { x = 0 y = 0 }
							militia = { x = 0 y = 1 }
							militia = { x = 1 y = 0 }
							militia = { x = 1 y = 1 }
						}
						#division_cap = 0
						override_model = BRA_militia_entity
					}
					500 = {
						create_unit = {
							division = "division_template =\"National Militia\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
							owner = PREV
							count = 10
						} 
					}
				}
			}
		}
	}

	focus = {
		id = BRA_align_with_moscow
		icon = GFX_focus_chi_mission_to_the_soviet_union
		x = -2
		y = 1
		relative_position_id = BRA_launch_the_revolution
		prerequisite = { focus = BRA_launch_the_revolution }
		prerequisite = { focus = BRA_free_prestes }
		mutually_exclusive = { focus = BRA_oust_prestes focus = BRA_cangaco_coup }
		cost = 10
		ai_will_do = {
			factor = 10
		}
		available = {
			has_civil_war = no
		}

		search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {
			add_political_power = 50
			#BRA_luis_carlos_prestes = {
			#	promote_leader = yes
			#}
			effect_tooltip = {
				retire_country_leader = yes
			}
			add_country_leader_role = {
				character = BRA_luis_carlos_prestes
				promote_leader = yes
				country_leader = {
					ideology=marxism
					expire="1965.1.1.1"
					id=-1
					traits = {
						JUNO_aligned_with_stalin
					}
				}
			}
			#retire_country_leader = yes
			remove_dynamic_modifier = {
				modifier = BRA_weak_government
			}
		}
	}

	focus = {
		id = BRA_oust_prestes
		icon = GFX_focus_ICE_embrace_the_workers_revolution
		x = 0
		y = 1
		relative_position_id = BRA_launch_the_revolution
		prerequisite = { focus = BRA_launch_the_revolution }
		prerequisite = { focus = BRA_revive_the_anl }
		mutually_exclusive = { focus = BRA_align_with_moscow focus = BRA_cangaco_coup }
		cost = 10
		ai_will_do = {
			factor = 5
		}
		available = {
			has_civil_war = no
		}

		search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {
			add_country_leader_role = {
				character =  BRA_alianca_nacional_libertadora_council
				promote_leader = yes
				country_leader = {
					ideology = marxism
					expire="1965.1.1.1"
					id=-1
					traits = { JUNO_alianca_nacional_libertadora_council } 
				}
			}
			remove_dynamic_modifier = {
				modifier = BRA_weak_government
			}
		}
	}

	focus = {
		id = BRA_cangaco_coup
		icon = GFX_focus_BRA_deal_with_the_cangaco
		x = 2
		y = 1
		relative_position_id = BRA_launch_the_revolution
		prerequisite = { focus = BRA_launch_the_revolution }
		prerequisite = { focus = BRA_sway_the_cangaco }
		mutually_exclusive = { focus = BRA_align_with_moscow focus = BRA_oust_prestes }
		cost = 10
		ai_will_do = {
			factor = 1
		}
		available = {
			has_civil_war = no
		}

		search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {
			add_country_leader_role = {
				character =  BRA_lampiao
				promote_leader = yes
				country_leader = {
					ideology = anarchist_communism
					expire="1965.1.1.1"
					id=-1
					traits = {BRA_bandit_revolutionary} 
				}
			}
			set_party_name = {
				ideology = communism
				name = BRA_cangaco_party_long
				long_name = BRA_cangaco_party
			}
			remove_dynamic_modifier = {
				modifier = BRA_weak_government
			}
			every_owned_state = {
				limit = {
					has_dynamic_modifier = {
						modifier = BRA_cangaceiro_state
					}
				}
				remove_dynamic_modifier = {
					modifier = BRA_cangaceiro_state
				}
			}
		}
	}

	focus = {
		id = BRA_nationalization_of_industry
		icon = GFX_goal_generic_soviet_construction
		x = 6
		y = 1
		relative_position_id = BRA_align_with_moscow
		prerequisite = { focus = BRA_align_with_moscow focus = BRA_oust_prestes focus = BRA_cangaco_coup }
		cost = 10
		ai_will_do = {
			factor = 10
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_INDUSTRY  }

		completion_reward = {
			ETH_add_random_civ_factory_effect = yes
		}
	}

	focus = {
		id = BRA_collectivization_of_agriculture
		icon = GFX_focus_prc_agrarian_socialism
		x = 1
		y = 1
		relative_position_id = BRA_nationalization_of_industry
		prerequisite = { focus = BRA_nationalization_of_industry }
		cost = 5
		ai_will_do = {
			factor = 5
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_INDUSTRY }

		completion_reward = {
			add_ideas = BRA_collectivized_agriculture
		}
	}

	focus = {
		id = BRA_collectivization_of_transport
		icon = GFX_focus_generic_railroad
		x = 0
		y = 1
		relative_position_id = BRA_collectivization_of_agriculture
		prerequisite = { focus = BRA_collectivization_of_agriculture }
		cost = 5
		ai_will_do = {
			factor = 3
		}
		available = {
		}

		search_filters = { }

		completion_reward = {
			add_equipment_to_stockpile = {
				type = train_equipment
				amount = 30
				producer = BRA
			}
			add_tech_bonus = {
				name = ETH_mass_transit
				bonus = 1
				uses = 1
				category = train_tech
			}
			add_ideas = ETH_mass_transit_idea
		}
	}

	focus = {
		id = BRA_rapid_industrialization
		icon = GFX_focus_ITA_corpo_volontari_della_liberta
		x = -2
		y = 1
		relative_position_id = BRA_nationalization_of_industry
		prerequisite = { focus = BRA_nationalization_of_industry }
		cost = 10
		ai_will_do = {
			factor = 10
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_INDUSTRY }

		completion_reward = {
			random_owned_controlled_state = {
				limit = {
					is_fully_controlled_by = ROOT
					NOT = {
						OR = {
							has_state_flag = rapid_industrialization_happened
							state = 961
							state = 962
							state = 963
							state = 964
							state = 965
							state = 966
							state = 967
							state = 968
						}	
					}
				}
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = arms_factory
					level = 1
					instant_build = yes
				}
				set_state_flag = rapid_industrialization_happened
			}

			random_owned_controlled_state = {
				limit = {
					is_fully_controlled_by = ROOT
					NOT = {
						OR = {
							has_state_flag = rapid_industrialization_happened
							state = 961
							state = 962
							state = 963
							state = 964
							state = 965
							state = 966
							state = 967
							state = 968
						}	
					}
				}
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = arms_factory
					level = 1
					instant_build = yes
				}
				set_state_flag = rapid_industrialization_happened
			}
			
		}
	}

	focus = {
		id = BRA_state_atheism
		icon = GFX_focus_BRA_state_atheism
		x = -1
		y = 1
		relative_position_id = BRA_rapid_industrialization
		prerequisite = { focus = BRA_rapid_industrialization }
		cost = 5
		ai_will_do = {
			factor = 2
		}
		available = {
		}
		mutually_exclusive = { focus = BRA_allow_the_church_to_operate }
		search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {
			add_ideas = BRA_atheist_state
		}
	}

	focus = {
		id = BRA_allow_the_church_to_operate
		icon = GFX_focus_BRA_socialist_theologians
		x = 1
		y = 1
		relative_position_id = BRA_rapid_industrialization
		prerequisite = { focus = BRA_rapid_industrialization }
		cost = 5
		ai_will_do = {
			factor = 15
		}
		available = {
		}
		mutually_exclusive = { focus = BRA_state_atheism }
		search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {
			add_ideas = BRA_collaboration_with_the_church
		}
	}

	focus = {
		id = BRA_equality_for_women
		icon = GFX_focus_ARG_women_in_industry
		x = 0
		y = 2
		relative_position_id = BRA_rapid_industrialization
		prerequisite = { focus = BRA_state_atheism focus = BRA_allow_the_church_to_operate }
		cost = 5
		ai_will_do = {
			factor = 20
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_MANPOWER }

		completion_reward = {
			add_ideas = BRA_proletarian_equality
			custom_effect_tooltip = BRA_equality_for_women_tt
		}
	}

	focus = {
		id = BRA_soviet_economic_aid
		icon = GFX_focus_BRA_purchase_soviet_equipment
		x = -2
		y = 1
		relative_position_id = BRA_align_with_moscow
		prerequisite = { focus = BRA_align_with_moscow }
		cost = 10
		ai_will_do = {
			factor = 10
		}
		available = {
			NOT = {
				has_war_with = SOU
			}
			SOU = {
				exists = yes
				has_government = communism
				has_opinion = {
					target = ROOT
					value > 49
				}
			}
		}

		search_filters = { FOCUS_FILTER_INDUSTRY }

		completion_reward = {

			add_offsite_building = {
				type = industrial_complex
				level = 2
			}

			add_opinion_modifier = {
				target = SOU
				modifier = large_increase
			}

			SOU = {
				add_opinion_modifier = {
					target = ROOT
					modifier = large_increase
				}
			}
		}
	}

	focus = {
		id = BRA_international_brigades
		icon = GFX_focus_ETH_peacekeeping_forces
		x = 0
		y = 1
		relative_position_id = BRA_align_with_moscow
		prerequisite = { focus = BRA_align_with_moscow focus = BRA_oust_prestes focus = BRA_cangaco_coup }
		cost = 5
		ai_will_do = {
			factor = 3
		}
		available = {
		}

		search_filters = { }

		completion_reward = {
			set_rule = { can_send_volunteers = yes }

			add_ideas = BRA_international_brigades
		
		}
	}

	focus = {
		id = BRA_tech_slot_3
		icon = GFX_focus_generic_socialist_science
		x = 4
		y = 1
		relative_position_id = BRA_align_with_moscow
		prerequisite = { focus = BRA_align_with_moscow focus = BRA_oust_prestes focus = BRA_cangaco_coup }
		cost = 10
		ai_will_do = {
			factor = 30
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_RESEARCH }

		completion_reward = {
			add_research_slot = 1
		}
	}

	focus = {
		id = BRA_purchase_soviet_equipment
		icon = GFX_focus_SOV_the_glory_of_the_red_army_communism
		x = 0
		y = 2
		relative_position_id = BRA_soviet_economic_aid
		prerequisite = { focus = BRA_soviet_economic_aid }
		mutually_exclusive = { focus = BRA_license_soviet_designs }
		cost = 5
		ai_will_do = {
			factor = 10
		}
		available = {
			SOU = {
				has_opinion = {
					target = ROOT
					value > 49
				}
			}
			NOT = {
				has_war_with = SOU
			}
		}

		search_filters = { }

		completion_reward = {
			IF = {
				limit = {
					has_dlc = "Arms Against Tyranny"
				}
				add_equipment_subsidy = {
					cic = 1000
					equipment_type = infantry_equipment
					seller_tags = { SOU } 
				}
				add_equipment_subsidy = {
					cic = 1000
					equipment_type = artillery_equipment
					seller_tags = { SOU } 
				}
				add_equipment_subsidy = {
					cic = 1000
					equipment_type = support_equipment
					seller_tags = { SOU } 
				}
			}
			ELSE = {
				add_equipment_to_stockpile = { 
					type = infantry_equipment
					amount = 2000
					producer = SOU
				}
				add_equipment_to_stockpile = { 
					type = artillery_equipment
					amount = 500
					producer = SOU
				}
			}
		
		}
	}

	focus = {
		id = BRA_license_soviet_designs
		icon = GFX_focus_generic_license_production
		x = 2
		y = 2
		relative_position_id = BRA_soviet_economic_aid
		prerequisite = { focus = BRA_soviet_economic_aid }
		mutually_exclusive = { focus = BRA_purchase_soviet_equipment }
		cost = 5
		ai_will_do = {
			factor = 4
		}
		available = {
			NOT = {
				has_war_with = SOU
			}
			SOU = {
				has_opinion = {
					target = ROOT
					value > 49
				}
			}
		}

		search_filters = { }

		completion_reward = {
			hidden_effect = {
				SOU = {
					country_event = {
						id = JUNO_brazil_events.134
						hours = 6
					}
				}
			}

			custom_effect_tooltip = BRA_license_soviet_designs_tt
		}
	}

	focus = {
		id = BRA_soviet_arms_industry
		icon = GFX_focus_generic_combined_arms
		x = -1
		y = 1
		relative_position_id = BRA_license_soviet_designs
		prerequisite = { focus = BRA_license_soviet_designs focus = BRA_purchase_soviet_equipment }
		cost = 5
		ai_will_do = {
			factor = 10
		}
		available = {
			SOU = {
				has_opinion = {
					target = ROOT
					value > 49
				}
			}
		}

		search_filters = { }

		completion_reward = {
			random_core_state = {
				limit = {
					free_building_slots = {
						building = arms_factory
						size > 0
						include_locked = yes
					}
					is_owned_and_controlled_by = ROOT
					NOT = {
						OR = {
							state = 961
							state = 962
							state = 963
							state = 964
							state = 965
							state = 966
							state = 967
							state = 968
						}
					}
				}
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = arms_factory
					level = 1
					instant_build = yes
				}
			}
			IF = {
				limit = {
					has_dlc = "Arms Against Tyranny"
				}	
				custom_effect_tooltip = invites_mio_tt

				show_mio_tooltip = SOV_rubin_design_bureau_organization
				mio:SOV_rubin_design_bureau_organization = {
					add_mio_size = 3
				}

				show_mio_tooltip = SOV_mig_design_bureau_organization
				mio:SOV_mig_design_bureau_organization = {
					add_mio_size = 3
				}

				show_mio_tooltip = SOV_gaz_organization
				mio:SOV_gaz_organization = {
					add_mio_size = 3
				}

			}
			ELSE = {
				custom_effect_tooltip = available_designer
				show_ideas_tooltip = SOV_rubin_design_bureau
				show_ideas_tooltip = SOV_mig_design_bureau
				show_ideas_tooltip = SOV_gaz
			}
		}
	}

	focus = {
		id = BRA_kgbrazil
		icon = GFX_focus_BRA_kgbrazil
		x = 2
		y = 1
		relative_position_id = BRA_align_with_moscow
		prerequisite = { focus = BRA_align_with_moscow focus = BRA_oust_prestes focus = BRA_cangaco_coup }
		cost = 5
		ai_will_do = {
			factor = 3
		}
		available = {
		}

		search_filters = { }

		completion_reward = {
			IF = {
				limit = {
					has_dlc = "La Resistance" 
					has_intelligence_agency = no
				}
				create_intelligence_agency = { 
					name = "EICI"
					icon = GFX_intelligence_agency_logo_BRA_communist
				}
	
				create_operative_leader = {
					name = BRA_robert_ivanov 
					traits = { operative_tough }
					female = no
					bypass_recruitment = yes
					nationalities = { SOU }
					GFX = GFX_portrait_europe_generic_operative_male_5
				}
				create_operative_leader = {
					name = BRA_nadiya_morozova 
					traits = { operative_escape_artist }
					female = yes
					bypass_recruitment = yes
					nationalities = { SOU }
					GFX = GFX_portrait_europe_generic_operative_female_7
				}
				
			}
			ELSE_IF = {
				limit = {
					has_dlc = "La Resistance" 
					has_intelligence_agency = yes
				}

				create_operative_leader = {
					name = BRA_robert_ivanov 
					traits = { operative_tough }
					female = no
					bypass_recruitment = yes
					nationalities = { SOU }
					GFX = GFX_portrait_europe_generic_operative_male_5
				}

				create_operative_leader = {
					name = BRA_nadiya_morozova 
					traits = { operative_escape_artist }
					female = yes
					bypass_recruitment = yes
					nationalities = { SOU }
					GFX = GFX_portrait_europe_generic_operative_female_7
				}
			}
			ELSE = {
				add_tech_bonus = {
					name = BRA_kgbrazil_tech_bonus
					bonus = 1
					uses = 2
					category = electronics
				}
			}

			IF = {
				limit = { 
					has_dlc = "By Blood Alone" 
					has_dlc = "La Resistance"
				}
				set_technology = { photo_reconnaisance = 1 }
			}
		}
	}

	focus = {
		id = BRA_spread_the_revolution

		icon = GFX_focus_SOV_builder_of_the_red_army
		x = 0
		y = 6
		relative_position_id = BRA_launch_the_revolution
		prerequisite = { focus = BRA_soviet_arms_industry focus = BRA_equality_for_women }
		#mutually_exclusive = { focus = BRA_the_international_crisis }
		cost = 10
		ai_will_do = {
			factor = 15
		}
		available = {
			has_government = communism
			has_war_support > 0.6
			has_army_manpower = { size > 199999 }
		}

		search_filters = { }

		completion_reward = {
			add_timed_idea = {
				idea = BRA_expanding_the_revolution
				days = 1460
		}
	}
	}

	focus = {
		id = BRA_join_the_comintern
		icon = GFX_focus_generic_join_comintern
		x = -2
		y = 1
		relative_position_id = BRA_spread_the_revolution
		prerequisite = { focus = BRA_spread_the_revolution }
		mutually_exclusive = { focus = BRA_create_faction }
		cost = 10
		ai_will_do = {
			factor = 10
		}
		bypass = {
			is_in_faction_with = SOU
		}
		available = {
			is_subject = no
			is_in_faction = no
			SOV_comintern_joinable = yes 
			has_government = communism	
			SOU = {
				has_opinion = {
					target = ROOT
					value > 49
				}
			}
		}

		search_filters = { }

		completion_reward = {
			SOU = {
				country_event = { id = generic.2 hours = 4 }
			}
		}
	}

	focus = {
		id = BRA_smash_fascism
		icon = GFX_focus_generic_anti_fascist_diplomacy
		prerequisite = { focus = BRA_join_the_comintern focus = BRA_create_faction }
		x = -1
		y = 1
		relative_position_id = BRA_join_the_comintern
		cost = 10
		ai_will_do = {
			factor = 3
			modifier = {
				factor = 0
				has_war_with_major = yes
			}
		}
		available = {
			any_country = {
				capital_scope = {
					is_on_continent = south_america
				}
				has_government = fascism
				NOT = {
					OR = {
						original_tag = ELS
						original_tag = MEX
						original_tag = DOM
						original_tag = PAN
					}
				}
			}
		}
		search_filters = { FOCUS_FILTER_ANNEXATION }

		completion_reward = {
			hidden_effect = {
				every_other_country = {
					limit = {
						capital_scope = {
							is_on_continent = south_america
						}
						has_government = fascism
						NOT = {
							OR = {
								original_tag = ELS
								original_tag = MEX
								original_tag = DOM
								original_tag = PAN
							}
						}
					}
					ROOT = {
						create_wargoal = {
							type = puppet_wargoal_focus
							target = PREV
							expire = 0
						}
					}
				}
			}
			custom_effect_tooltip = BRA_no_fascism_in_south_america_tt
		} 
	}

	focus = {
		id = BRA_create_faction
		icon = GFX_focus_BRA_create_faction
		x = 2
		y = 1
		relative_position_id = BRA_spread_the_revolution
		prerequisite = { focus = BRA_spread_the_revolution }
		mutually_exclusive = { focus = BRA_join_the_comintern }
		cost = 10
		ai_will_do = {
			factor = 10
		}
		available = {
			is_subject = no
		}

		bypass = {
			is_in_faction = yes
			has_government = communism
		}

		search_filters = { }

		completion_reward = {

			set_rule = { can_create_factions = yes }
			create_faction_from_template = {
				template = faction_template_POR_popular_front_bloc
				name = BRA_socialist_latin_american_cooperative
				icon = GFX_faction_logo_generic_9
			}

		}
	}

	focus = {
		id = BRA_anti_imperialism
		icon = GFX_focus_ETH_freedom_at_gunpoint
		x = 1
		y = 1
		relative_position_id = BRA_join_the_comintern
		prerequisite = { focus = BRA_join_the_comintern focus = BRA_create_faction }
		cost = 10
		ai_will_do = {
			factor = 5
		}
		available = {
		}

		search_filters = { }

		completion_reward = {
			custom_effect_tooltip = BRA_anti_imperialism_tt
			BRA_setup_colonized_countries_to_liberate_array = yes #setting up the array with a scripted effect
		}
	}

	focus = {
		id = BRA_jaguar_diplomacy
		icon = GFX_focus_BRA_jaguar_diplomacy
		x = -1
		y = 1
		relative_position_id = BRA_create_faction
		prerequisite = { focus = BRA_create_faction focus = BRA_join_the_comintern }
		cost = 5
		available = {
		}

		search_filters = { }

		completion_reward = {
			custom_effect_tooltip = BRA_jaguar_diplomacy_tt
		}
	}

	focus = {
		id = BRA_sway_the_neighbors
		icon = GFX_focus_BRA_sway_the_neighbors
		x = 0
		y = 1
		relative_position_id = BRA_kgbrazil
		prerequisite = { focus = BRA_kgbrazil }
		cost = 5
		ai_will_do = {
			factor = 4
		}
		available = {
		}

		search_filters = { }

		completion_reward = {
			IF = {
				limit = {
					NOT = {
						has_dlc = "La Resistance"
					}
				}
				custom_effect_tooltip = BRA_sway_the_neighbors_tt
				set_country_flag = BRA_sway_the_neighbors_no_lar
			}
			ELSE = {
				# Add extra operative slot
				# Add character with propaganda bonus
				add_ideas = BRA_sway_the_neighbors_lar
				create_operative_leader = {
					name = BRA_julieta_soria
					traits = { operative_double_agent operative_natural_orator }
					female = yes
					bypass_recruitment = yes
					nationalities = { BRA ARG CHL}
					GFX = GFX_portrait_europe_generic_operative_female_9
				}
			}
			
		}
	}	

	focus = {
		id = BRA_union_of_latin_american_socialist_republics
		icon = GFX_focus_BRA_ulasr
		x = -2
		y = 2
		relative_position_id = BRA_create_faction
		prerequisite = { focus = BRA_create_faction focus = BRA_join_the_comintern }
		cost = 5
		ai_will_do = {
			factor = 15
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {
			set_cosmetic_tag = BRA_union_of_latin_american_socialist_republics_cos_tag
			every_state = {
				limit = {
					is_on_continent = south_america
				}
				add_core_of = ROOT
			}
		}
	}

	focus = {
		id = BRA_smash_democracy
		icon = GFX_focus_generic_strike_at_democracy2
		prerequisite = { focus = BRA_join_the_comintern focus = BRA_create_faction }
		x = 1
		y = 1
		relative_position_id = BRA_create_faction
		cost = 10
		ai_will_do = {
			factor = 3
			modifier = {
				factor = 0
				has_war_with_major = yes
			}
		}
		available = {
			any_country = {
				capital_scope = {
					is_on_continent = south_america
				}
				has_government = democratic
				NOT = {
					OR = {
						original_tag = ELS
						original_tag = MEX
						original_tag = DOM
						original_tag = PAN
					}
				}
			}
		}
		search_filters = { FOCUS_FILTER_ANNEXATION }

		completion_reward = {
			hidden_effect = {
				every_other_country = {
					limit = {
						capital_scope = {
							is_on_continent = south_america
						}
						OR = {
							has_government = democratic
							has_government = neutrality
						}
						NOT = {
							OR = {
								original_tag = ELS
								original_tag = MEX
								original_tag = DOM
								original_tag = PAN
							}
						}
					}
					ROOT = {
						create_wargoal = {
							type = puppet_wargoal_focus
							target = PREV
							expire = 0
						}
					}
				}
			}
			custom_effect_tooltip = BRA_anti_democracy_in_south_america_tt
		} 
	}

	#############################
	##### Monarchist Branch #####

	focus = {
		id = BRA_romanticize_the_old_empire
		icon = GFX_focus_por_reclaim_crown_jewel
		x = 4
		y = 1
		relative_position_id = BRA_end_the_state_of_emergency
		prerequisite = { focus = BRA_end_the_state_of_emergency }
		mutually_exclusive = { focus = BRA_repeal_the_national_security_law }
		cost = 10
		ai_will_do = {
			factor = 5
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {
			set_party_name = {
				ideology = neutrality
				name = BRA_monarchy_party_long
				long_name = BRA_monarchy_party
			}
			add_timed_idea = {
				idea = BRA_romanticize_the_old_empire_idea
				days = 365
			}
		}
	}

	focus = {
		id = BRA_vassouras_line
		icon = GFX_focus_BRA_pedro_henrique
		x = 2
		y = 1
		relative_position_id = BRA_romanticize_the_old_empire
		prerequisite = { focus = BRA_romanticize_the_old_empire }
		mutually_exclusive = { focus = BRA_petropolis_line }
		cost = 5
		ai_will_do = {
			factor = 20
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {
			add_political_power = 100
			custom_effect_tooltip = BRA_monarch_choice_2_tt
			show_ideas_tooltip = BRA_king_vassouras
		}
	}

	focus = {
		id = BRA_petropolis_line
		icon = GFX_focus_BRA_pedro_de_alcantara
		x = -2
		y = 1
		relative_position_id = BRA_romanticize_the_old_empire
		prerequisite = { focus = BRA_romanticize_the_old_empire }
		mutually_exclusive = { focus = BRA_vassouras_line }
		cost = 5
		ai_will_do = {
			factor = 5
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {
			add_political_power = 100
			custom_effect_tooltip = BRA_monarch_choice_1_tt
			show_ideas_tooltip = BRA_king_petropolis
		}
	}

	focus = {
		id = BRA_restore_the_coffee_barons
		icon = GFX_focus_BRA_cafe_com_leite_politics
		x = 2
		y = 1
		relative_position_id = BRA_petropolis_line
		prerequisite = { focus = BRA_vassouras_line focus = BRA_petropolis_line }
		cost = 5
		ai_will_do = {
			factor = 10
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {
			hidden_effect = {
				retire_country_leader = yes
			}			
			add_country_leader_role = {
			    character = BRA_arlindo_veiga_dos_santos
			    promote_leader = yes
			    country_leader = {
			        ideology = conservatism
			        expire = "1965.1.1.1"
			        traits = { staunch_monarchist }
			    }
			}
		}
	}

	focus = {
		id = BRA_constitutional_monarchy
		icon = GFX_focus_BRA_constitutional_monarchy
		x = 0
		y = 1
		relative_position_id = BRA_restore_the_coffee_barons
		prerequisite = { focus = BRA_restore_the_coffee_barons }
		cost = 10
		ai_will_do = {
			factor = 10
		}
		available = {
			neutrality > 0.3
		}

		search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {
			IF = {
				limit = {
					has_completed_focus = BRA_vassouras_line
				}
				add_ideas = BRA_king_vassouras
			}
			ELSE_IF = {
				limit = {
					has_completed_focus = BRA_petropolis_line
				}
				add_ideas = BRA_king_petropolis
			}
			ELSE = {
				custom_effect_tooltip = BRA_constitutional_monarchy_tt
				show_ideas_tooltip = BRA_king_vassouras
				custom_effect_tooltip = BRA_constitutional_monarchy_tt_2
				show_ideas_tooltip = BRA_king_petropolis
			}
			set_cosmetic_tag = BRA_const_kingdom
			add_political_power = 120
			hidden_effect = {
				news_event = { hours = 12 id =JUNO_brazil_news.2 }
			}
		}
	}

	focus = {
		id = BRA_undermine_democracy
		icon = GFX_focus_generic_strike_at_democracy2
		x = 0
		y = 1
		relative_position_id = BRA_constitutional_monarchy
		prerequisite = { focus = BRA_constitutional_monarchy }
		#prerequisite = { focus = BRA_court_the_military }
		#mutually_exclusive = { focus = BRA_bicarmel_legislature }
		cost = 10
		cancel_if_invalid = no
		ai_will_do = {
			factor = 10
		}
		available = {
			neutrality > 0.30
		}

		search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {
			add_timed_idea = {
				idea = BRA_undermine_democracy_idea
				days = 365
			}
		}
	}

	focus = {
		id = BRA_invest_in_the_armed_forces
		icon = GFX_goal_generic_military_deal
		x = -2
		y = 1
		relative_position_id = BRA_constitutional_monarchy
		prerequisite = { focus = BRA_constitutional_monarchy }
		
		cost = 10

		ai_will_do = {
			factor = 10
		}

		available = {
		
		}

		search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {
			remove_dynamic_modifier = {
				modifier = BRA_weak_government
			}
			random_core_state = {
				limit = {
					free_building_slots = {
						building = arms_factory
						size > 0 
						include_locked = yes
					}
					is_owned_and_controlled_by = ROOT
					NOT = {
						has_dynamic_modifier = { 
							modifier = BRA_neglected_state_dynamic_modifier
						}
						OR = {
							state = 961
							state = 962
							state = 963
							state = 964
							state = 965
							state = 966
							state = 967
							state = 968
						}
					}
				}
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = arms_factory
					level = 1
					instant_build = yes
				} 
			}
			random_owned_controlled_state = {
				limit = { 
					is_coastal = yes 
					free_building_slots = {
						building = dockyard
						size > 1
						include_locked = yes
					}
					NOT = {
						OR = {
							state = 961
							state = 962
							state = 963
							state = 964
							state = 965
							state = 966
							state = 967
							state = 968
						}
					}
				}
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = dockyard
					level = 1
					instant_build = yes
				}
				
			}
		}
	}

	focus = {
		id = BRA_royal_colleges
		icon = GFX_focus_research
		x = 0
		y = 1
		relative_position_id = BRA_invest_in_the_armed_forces
		prerequisite = { focus = BRA_invest_in_the_armed_forces }
		#prerequisite = { focus = BRA_court_the_military }
		#mutually_exclusive = { focus = BRA_undermine_democracy }
		cost = 10
		ai_will_do = {
			factor = 10
		}
		available = {
		
		}

		search_filters = { FOCUS_FILTER_RESEARCH }

		completion_reward = {
			add_research_slot = 1
		}
	}

	focus = {
		id = BRA_issue_lordships
		icon = GFX_focus_generic_monarchy_2
		x = 2
		y = 1
		relative_position_id = BRA_constitutional_monarchy
		prerequisite = { focus = BRA_constitutional_monarchy }
		#prerequisite = { focus = BRA_court_the_military }
		cost = 5
		ai_will_do = {
			factor = 10
		}
		available = {
			
		}

		search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {
			custom_effect_tooltip = BRA_posts_for_generals_tt
			every_army_leader = {
				limit = {
					NOT = {
						has_trait = politically_connected
					}
				}
				add_trait = { trait = politically_connected }
			}
		}
	}

	focus = {
		id = BRA_promote_agriculture
		icon = GFX_focus_generic_coffee
		x = 0
		y = 1
		relative_position_id = BRA_issue_lordships
		prerequisite = { focus = BRA_issue_lordships }
		#prerequisite = { focus = BRA_court_the_military }
		cost = 10
		ai_will_do = {
			factor = 10
		}
		available = {
			
		}

		search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {
			add_political_power = 100
			custom_effect_tooltip = BRA_promote_agriculture_tt
			show_ideas_tooltip = BRA_geremia_lunarelli
		}
	}

	focus = {
		id = BRA_use_the_national_security_law
		icon = GFX_focus_BRA_utilize_security_law
		x = 0
		y = 1
		relative_position_id = BRA_undermine_democracy
		prerequisite = { focus = BRA_undermine_democracy }
		#prerequisite = { focus = BRA_court_the_military }
		cost = 5
		cancel_if_invalid = no
		ai_will_do = {
			factor = 10
		}
		available = {
			neutrality > 0.5
		}

		search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {
			#drop_cosmetic_tag = yes
			set_politics = {
				ruling_party = neutrality
				last_election = "1938.1.1"
				election_frequency = 48
				elections_allowed = no
			}
			add_ideas = BRA_unwilling_subjects
			retire_country_leader = yes

			IF = {
				limit = {
					# Henrique spirit
					has_idea = BRA_king_vassouras
				}
				remove_ideas = BRA_king_vassouras
				BRA_pedro_henrique = {
					add_country_leader_role = {
						country_leader = {
							ideology = despotism
							expire = "1965.1.1.1"
							traits = { BRA_politically_educated }
						}
						promote_leader = yes
					} 
				}
			}
			if = {
				limit = {
					# Alcantara spirit
					has_idea = BRA_king_petropolis
				}
				remove_ideas = BRA_king_petropolis
				BRA_pedro_de_alcantara = {
					add_country_leader_role = {
						country_leader = {
							ideology = despotism
							expire = "1965.1.1.1"
							traits = { BRA_the_white_dove }
						}
						promote_leader = yes
					} 

				}
			}
		}
	}

	focus = {
		id = BRA_united_kingdom_of_brazil_and_portugal
		icon = GFX_focus_por_the_kingdom_reunited
		x = -2
		y = 1
		relative_position_id = BRA_use_the_national_security_law
		prerequisite = { focus = BRA_use_the_national_security_law }
		
		cost = 5
		ai_will_do = {
			factor = 5
			modifier = {
				factor = 0
				OR = {
					has_war_with_major = yes
					is_in_faction_with = POR
				}
			}
		}
		available = {
			any_other_country = {
				original_tag = POR
				exists = yes
				is_subject = no
			}
		}

		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_ANNEXATION }

		completion_reward = {
			custom_effect_tooltip = BRA_united_kingdom_of_brazil_and_portugal_tt
			POR = {
				country_event = {
					id = JUNO_brazil_events.60
					hours = 1
				}
			}
		}
	}

	focus = {
		id = BRA_penal_battalions
		icon = GFX_focus_SOV_penal_battalions
		x = 2
		y = 1
		relative_position_id = BRA_use_the_national_security_law
		prerequisite = { focus = BRA_use_the_national_security_law }
		#prerequisite = { focus = BRA_court_the_military }
		cost = 10
		ai_will_do = {
			factor = 15
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_MANPOWER }

		completion_reward = {
			custom_effect_tooltip = BRA_penal_battalions_tt
			hidden_effect = {
				division_template = {
					name = "Batalhões de Presos"
					#division_names_group = 
					is_locked = yes
					force_allow_recruiting = yes
					override_model = BRA_militia_alt_0_entity
					division_cap = 6
	
					regiments = {
						penal_battalion = { x = 0 y = 0 }
						penal_battalion = { x = 0 y = 1 }
						penal_battalion = { x = 0 y = 2 }
						penal_battalion = { x = 1 y = 0 }
						penal_battalion = { x = 1 y = 1 }
						penal_battalion = { x = 1 y = 2 }
					}
					support = {
						artillery = { x = 0 y = 0 }
					}
				}
				capital_scope = {
					create_unit = {
						division = "division_template = \"Batalhões de Presos\" start_experience_factor = 0 start_equipment_factor = 1.0"
						OWNER = ROOT
					}
					create_unit = {
						division = "division_template = \"Batalhões de Presos\" start_experience_factor = 0 start_equipment_factor = 1.0"
						OWNER = ROOT
					}
					create_unit = {
						division = "division_template = \"Batalhões de Presos\" start_experience_factor = 0 start_equipment_factor = 1.0"
						OWNER = ROOT
					}
					create_unit = {
						division = "division_template = \"Batalhões de Presos\" start_experience_factor = 0 start_equipment_factor = 1.0"
						OWNER = ROOT
					}
					create_unit = {
						division = "division_template = \"Batalhões de Presos\" start_experience_factor = 0 start_equipment_factor = 1.0"
						OWNER = ROOT
					}
					create_unit = {
						division = "division_template = \"Batalhões de Presos\" start_experience_factor = 0 start_equipment_factor = 1.0"
						OWNER = ROOT
					}
				}
			}
		}
	}

	focus = {
		id = BRA_amazonian_settlement
		icon = GFX_focus_BRA_amazon_colonization 
		x = 0
		y = 1
		relative_position_id = BRA_penal_battalions
		prerequisite = { focus = BRA_penal_battalions }
		#prerequisite = { focus = BRA_court_the_military }
		cost = 5
		ai_will_do = {
			factor = 10
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {
			#custom_effect_tooltip = "TODO: Add decision system for amazon state modifierers and maybe war goals against VEN, BOL etc."
			custom_effect_tooltip = BRA_amazonian_settlement_tt
		}
	}

	focus = {
		id = BRA_empire_of_brazil
		icon = GFX_focus_BRA_empire_of_brazil
		x = 0
		y = 2
		relative_position_id = BRA_use_the_national_security_law
		prerequisite = { focus = BRA_use_the_national_security_law }
		cost = 10
		ai_will_do = {
			factor = 15
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {
			hidden_effect = {
				drop_cosmetic_tag = yes
			}
			IF = {
				limit = {
					has_completed_focus = BRA_united_kingdom_of_brazil_and_portugal
				}
				set_cosmetic_tag = BRA_empire_of_brazil_and_portugal
			}
			ELSE = {
				set_cosmetic_tag = EOB_empire_brazil_neutrality
			}
			add_country_leader_trait = BRA_emperor_trait
		}
	}

	focus = {
		id = BRA_reclaim_territory_in_south_america
		icon = GFX_focus_generic_attack_uruguay
		x = -2
		y = 1
		relative_position_id = BRA_empire_of_brazil
		prerequisite = { focus = BRA_empire_of_brazil }
		cost = 5
		ai_will_do = {
			factor = 15
		}
		available = {
		}
		bypass = {
			URG = {
				OR = {
					exists = no
					is_subject_of = ROOT
				}
			}
		}

		search_filters = { FOCUS_FILTER_ANNEXATION }

		completion_reward = {
			create_wargoal = {
				target = URG
				type = annex_everything
			}
		}
	}

	focus = {
		id = BRA_spirit_of_acre_war
		icon = GFX_focus_generic_attack_bolivia
		x = 0
		y = 1
		relative_position_id = BRA_reclaim_territory_in_south_america
		prerequisite = { focus = BRA_demand_portugese_territory focus = BRA_demand_portugese_submission focus = BRA_reclaim_territory_in_south_america }
		cost = 5
		ai_will_do = {
			factor = 15
			modifier = {
				factor = 0
				OR = {
					has_war_with_major = yes
					is_in_faction_with = BOL
				}
			}
		}
		available = {
			any_other_country = {
				original_tag = BOL
				exists = yes
			}
		}

		search_filters = { FOCUS_FILTER_ANNEXATION }

		completion_reward = {
			create_wargoal = {
				target = BOL
				type = annex_everything
			}
		}
	}

	focus = {
		id = BRA_demand_portugese_territory
		icon = GFX_focus_por_luso_tropicalism
		x = 0
		y = 1
		relative_position_id = BRA_empire_of_brazil
		prerequisite = { focus = BRA_empire_of_brazil }
		mutually_exclusive = { focus = BRA_demand_portugese_submission }
		cost = 5
		ai_will_do = {
			factor = 13
			modifier = {
				factor = 0
				OR = {
					has_war_with_major = yes
					is_in_faction_with = POR
				}
			}
		}
		bypass = {
			POR = {
				OR = {
					exists = no
					is_subject_of = ROOT
				}
			}
		}
		will_lead_to_war_with = POR
		available = {
			any_other_country = {
				original_tag = POR
				exists = yes
			}
		}

		search_filters = { FOCUS_FILTER_ANNEXATION }

		completion_reward = {
			POR = {
				country_event = {
					id = JUNO_brazil_events.70
					hours = 1
				}
			}
		}
	}

	focus = {
		id = BRA_demand_portugese_submission
		icon = GFX_focus_generic_attack_portugal
		x = 2
		y = 1
		relative_position_id = BRA_empire_of_brazil
		prerequisite = { focus = BRA_empire_of_brazil }
		mutually_exclusive = { focus = BRA_demand_portugese_territory }
		cost = 10
		ai_will_do = {
			factor = 5
			modifier = {
				factor = 0
				OR = {
					has_war_with_major = yes
					is_in_faction_with = POR
				}
			}
		}
		bypass = {
			POR = {
				OR = {
					exists = no
					is_subject_of = ROOT
				}
			}
		}
		will_lead_to_war_with = POR
		available = {
			any_other_country = {
				original_tag = POR
				exists = yes
				OR = {
					is_subject = no
					is_subject_of = ROOT
				}				
			}
		}

		search_filters = { FOCUS_FILTER_ANNEXATION }

		completion_reward = {
			POR = {
				country_event = {
					id = JUNO_brazil_events.73
					hours = 1
				}
			}
		}
	}

	focus = {
		id = BRA_restoration_of_honor
		icon = GFX_focus_BRA_restore_brazilian_honor
		x = 0
		y = 1
		relative_position_id = BRA_demand_portugese_territory
		prerequisite = { focus = BRA_demand_portugese_territory focus = BRA_demand_portugese_submission focus = BRA_reclaim_territory_in_south_america }
		cost = 10
		ai_will_do = {
			factor = 30
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_WAR_SUPPORT }

		completion_reward = {
			remove_ideas = BRA_unwilling_subjects
			remove_ideas = BRA_separatism_idea
		}
	}

	focus = {
		id = BRA_expand_colonial_empire
		icon = GFX_focus_generic_africa_factory
		x = 2
		y = 1
		relative_position_id = BRA_demand_portugese_territory
		prerequisite = { focus = BRA_demand_portugese_territory focus = BRA_demand_portugese_submission focus = BRA_reclaim_territory_in_south_america }
		cost = 10
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				OR = {
					has_war_with_major = yes
				}
			}
		}
		available = {
			any_other_country = {
				capital_scope = {
					is_on_continent = africa
				}
				is_subject = no
			}
		}

		search_filters = { FOCUS_FILTER_ANNEXATION }

		completion_reward = {
			every_other_country	= {
				limit = {
					capital_scope = {
						is_on_continent = africa
					}
					is_subject = no
				}
				ROOT = {
					create_wargoal = {
						target = PREV
						type = annex_everything
					}
				}
			}
		}
	}

	focus = {
		id = BRA_support_the_landowners
		icon = GFX_focus_BRA_support_sugar_barons
		prerequisite = { focus = BRA_reward_army_loyalty focus = BRA_reinvigorate_the_navy }
		x = 4
		y = 1
		relative_position_id = BRA_reward_army_loyalty
		mutually_exclusive = { focus = BRA_support_rural_folk }
		cost = 10
		ai_will_do = {
			factor = 5
		}
		available = {
		}

		search_filters = { }

		completion_reward = {
			add_country_leader_trait = { 
				#character = BRA_getulio_vargas
				#ideology = despotism
				trait = BRA_sugar_king
			}
			ETH_add_random_civ_factory_effect = yes
		}
	}

	focus = {
		id = BRA_support_rural_folk
		icon = GFX_focus_BRA_father_of_the_poor
		prerequisite = { focus = BRA_reward_army_loyalty focus = BRA_reinvigorate_the_navy }
		mutually_exclusive = { focus = BRA_support_the_landowners }
		x = -3
		y = 1
		relative_position_id = BRA_reinvigorate_the_navy
		cost = 10
		ai_will_do = {
			factor = 10
		}
		available = {
		}

		search_filters = { FOCUS_FILTER_HISTORICAL }

		completion_reward = {
			add_country_leader_trait = { 
				#character = BRA_getulio_vargas
				#ideology = despotism
				trait = BRA_father_of_the_poor 
			}
			every_owned_state = {
				limit = {
					is_controlled_by = ROOT
					OR = {
						has_state_category = wasteland
						has_state_category = pastoral
						has_state_category = rural
					}
					NOT = {
						OR = {
							state = 961
							state = 962
							state = 963
							state = 964
							state = 965
							state = 966
							state = 967
							state = 968
						}
					}
				}
				add_extra_state_shared_building_slots = 1
			}
		}
	}

	focus = {
		id = BRA_support_industrialists
		icon = GFX_focus_generic_industrialists
		prerequisite = { focus = BRA_support_the_landowners focus = BRA_support_rural_folk }
		x = 2
		y = 1
		relative_position_id = BRA_support_the_landowners
		mutually_exclusive = { focus = BRA_consolidation_of_labor_laws }
		cost = 10
		ai_will_do = {
			factor = 5
		}
		available = {
		}

		search_filters = { }

		completion_reward = {
			random_core_state = {
				limit = {
					free_building_slots = {
						building = arms_factory
						size > 0
						include_locked = yes
					}
					is_owned_and_controlled_by = ROOT
					NOT = { 
						OR = {
							has_dynamic_modifier = {
								modifier = BRA_neglected_state_dynamic_modifier
							}
							state = 961
							state = 962
							state = 963
							state = 964
							state = 965
							state = 966
							state = 967
							state = 968
						}
						OR = {
							state = 961
							state = 962
							state = 963
							state = 964
							state = 965
							state = 966
							state = 967
							state = 968
						}
					}
				}
				add_extra_state_shared_building_slots = 2
				add_building_construction = {
					type = arms_factory
					level = 2
					instant_build = yes
				}
			}
		}
	}

	focus = {
		id = BRA_consolidation_of_labor_laws
		icon = GFX_focus_generic_workers
		prerequisite = { focus = BRA_support_the_landowners focus = BRA_support_rural_folk }
		x = 0
		y = 1
		relative_position_id = BRA_support_the_landowners
		mutually_exclusive = { focus = BRA_support_industrialists }
		cost = 10
		ai_will_do = {
			factor = 10
		}
		available = {
		}
	
		search_filters = { FOCUS_FILTER_HISTORICAL }
	
		completion_reward = {
			IF = {
				limit = {
					has_dynamic_modifier = {
						modifier = BRA_estado_novo_modifier
					}
				}
				custom_effect_tooltip = BRA_modify_estado_novo_ns_intro
				add_to_variable = {
					BRA_estado_novo_consumer_goods_factor = 0.05
					tooltip = consumer_goods_factor_tt
				}
				add_to_variable = {
					BRA_estado_novo_stability_factor = 0.03
					tooltip = stability_factor_tt
				}
				add_to_variable = {
					BRA_estado_novo_production_speed_buildings_factor = 0.1
					tooltip = production_speed_buildings_factor_tt
				}
			}
			ELSE_IF = {
				limit = {
					has_dynamic_modifier = {
						modifier = BRA_estado_moderno_modifier
					}
				}
				custom_effect_tooltip = BRA_modify_estado_moderno_ns_intro
				add_to_variable = {
					BRA_estado_moderno_consumer_goods_factor = -0.05
					tooltip = consumer_goods_factor_tt
				}
				add_to_variable = {
					BRA_estado_moderno_stability_factor = 0.03
					tooltip = stability_factor_tt

				}
				add_to_variable = {
					BRA_estado_moderno_production_speed_buildings_factor = 0.1
					tooltip = production_speed_buildings_factor_tt
				}
			}
			ELSE = {
				custom_effect_tooltip = BRA_consolidation_of_labor_laws_fallback_tt
				effect_tooltip = {
					add_to_variable = {
						BRA_estado_moderno_consumer_goods_factor = -0.05
						tooltip = consumer_goods_factor_tt
					}
					add_to_variable = {
						BRA_estado_moderno_stability_factor = 0.03
						tooltip = stability_factor_tt

					}
					add_to_variable = {
						BRA_estado_moderno_production_speed_buildings_factor = 0.1
						tooltip = production_speed_buildings_factor_tt
					}
				}
			}
		}
	}


	focus = {
		id = BRA_establish_caloi
		icon = GFX_focus_SWE_bicycle
		x = 2
		y = 1
		prerequisite = { focus = BRA_promote_resource_extraction focus = BRA_companhia_siderurgica_nacional }
		relative_position_id = BRA_promote_resource_extraction
		cost = 5
		available = {
		}
	
		search_filters = { FOCUS_FILTER_HISTORICAL }
	
		completion_reward = {
			set_technology = { bicycle_infantry = 1 popup = no }
			random_core_state = {
				limit = {
					free_building_slots = {
						building = arms_factory
						size > 0
						include_locked = yes
					}
					is_owned_and_controlled_by = ROOT
					NOT = { 
						OR = {
							has_dynamic_modifier = {
								modifier = BRA_neglected_state_dynamic_modifier
							}
							state = 961
							state = 962
							state = 963
							state = 964
							state = 965
							state = 966
							state = 967
							state = 968
						}
					}
				}
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = arms_factory
					level = 1
					instant_build = yes
				}
			}
		}
	}

	focus = {
		id = BRA_unify_south_america
		icon = GFX_focus_generic_south_america
		prerequisite = { 
			focus = BRA_german_cooperation
			focus = BRA_italian_cooperation
			focus = BRA_panama_push
		}
		x = 0
		y = 1
		search_filters = { FOCUS_FILTER_ANNEXATION }
		relative_position_id = BRA_italian_cooperation
		cost = 10
		ai_will_do = {
			factor = 20
		}
		available = {
			any_state = {
				is_on_continent = south_america
				NOT = {
					is_core_of = ROOT
				}
			}
		}

		search_filters = { }

		completion_reward = {
			set_cosmetic_tag = BRA_america_do_sul
			custom_effect_tooltip = BRA_unify_south_america_tt
		}
	}
}
