using System.Collections.Generic;
using System.Linq;

namespace Model.Glossary;

public static class GlossaryData
{
    public static Dictionary<string, GlossaryTermModel> GetTerms()
    {
        var terms = new List<GlossaryTermModel>
        {
            // Resources
            new()
            {
                Id = "glossary_alloy", Term = "Alloy", Category = "Resource",
                ShortDefinition = "Primary mineral resource used for constructing buildings and training units.",
                LongDefinition =
                    "**Alloy** is the primary mineral resource in IMMORTAL: Gates of Pyre. It is harvested from Alloy nodes by workers and is required for nearly all buildings, units, and upgrades. Managing your Alloy income is fundamental to a strong economy.",
                RelatedEntityIds = new List<string> { "STARTING_Bastion" }
            },
            new()
            {
                Id = "glossary_ether", Term = "Ether", Category = "Resource",
                ShortDefinition = "Secondary resource used for advanced units, research, and abilities.",
                LongDefinition =
                    "**Ether** is a secondary resource harvested from Ether nodes. It is used to train advanced units, research upgrades, and power certain abilities. Ether income typically comes online after establishing your economy.",
                RelatedEntityIds = new List<string> { "STARTING_Bastion" }
            },
            new()
            {
                Id = "glossary_pyre", Term = "Pyre", Category = "Resource",
                ShortDefinition =
                    "A powerful third resource earned through combat and map control, used for Immortals and spells.",
                LongDefinition =
                    "**Pyre** is a unique resource earned by defeating enemy units, capturing Pyre Camps, and taking Pyre Miners. It is used to summon Immortals, cast Pyre Spells, and activate powerful global effects. Unlike Alloy and Ether, Pyre is not harvested from static nodes — it requires active map presence.",
                RelatedTermIds = new List<string> { "glossary_immortal", "glossary_pyrespells" },
                RelatedEntityIds = new List<string> { "NEUTRAL_PyreCamp", "NEUTRAL_PyreMiner" }
            },
            new()
            {
                Id = "glossary_energy", Term = "Energy", Category = "Resource",
                ShortDefinition = "Resource used by certain units to activate abilities.",
                LongDefinition =
                    "**Energy** is a resource that certain units (such as spellcasters) use to activate their abilities. Energy regenerates over time and can be boosted by specific upgrades or structures."
            },
            new()
            {
                Id = "glossary_supply", Term = "Supply", Category = "Mechanic",
                ShortDefinition = "Population cap. Each unit takes Supply, each Stronghold grants Supply.",
                LongDefinition =
                    "**Supply** represents your population capacity. Most units consume Supply when trained, while certain buildings (primarily Strongholds) grant additional Supply. Running out of Supply prevents further unit training until you build more Supply-generating structures.",
                RelatedEntityIds = new List<string> { "BUILDING_Acropolis" }
            },

            // Core Mechanics
            new()
            {
                Id = "glossary_immortal", Term = "Immortal", Category = "Mechanic",
                ShortDefinition =
                    "Powerful hero units summoned using Pyre, each with unique abilities and vanguard units.",
                LongDefinition =
                    "**Immortals** are powerful hero-like units summoned by spending Pyre. Each Immortal has a unique set of abilities and grants access to **Vanguard** units — upgraded versions of standard units. Immortals can also cast powerful Pyre Spells, making them centerpieces of late-game armies. Current Immortals include Orzum, Ajari, Atzlan, Mala, and Xol.",
                RelatedTermIds = new List<string> { "glossary_pyre", "glossary_vanguard", "glossary_pyrespells" }
            },
            new()
            {
                Id = "glossary_vanguard", Term = "Vanguard", Category = "Mechanic",
                ShortDefinition = "Elite unit variants unlocked by summoning a specific Immortal.",
                LongDefinition =
                    "**Vanguard** units are enhanced variants of standard units that become available when a specific Immortal is summoned. For example, summoning Orzum upgrades Sipari into Zentari. Vanguard units retain the same hotkeys as their base versions but have improved stats and sometimes additional abilities.",
                RelatedTermIds = new List<string> { "glossary_immortal" }
            },
            new()
            {
                Id = "glossary_pyrespells", Term = "Pyre Spells", Category = "Mechanic",
                ShortDefinition = "Powerful global abilities unlocked by summoning an Immortal, cast using Pyre.",
                LongDefinition =
                    "**Pyre Spells** are powerful global effects that can be cast after summoning an Immortal. Each Immortal has a unique Pyre Spell associated with them, and casting it consumes Pyre. Examples include Summon Citadel and other game-changing effects.",
                RelatedTermIds = new List<string> { "glossary_pyre", "glossary_immortal" }
            },
            new()
            {
                Id = "glossary_morph", Term = "Morph", Category = "Mechanic",
                ShortDefinition = "A building or unit conversion that transforms one entity into another.",
                LongDefinition =
                    "**Morph** is a conversion mechanic where one building or unit transforms into a different entity. For example, a Mining Level 2 upgrade morphs from the Acropolis. Morphs typically have a cost and build time but allow upgrading existing structures rather than building new ones."
            },
            new()
            {
                Id = "glossary_harass", Term = "Harass", Category = "Mechanic",
                ShortDefinition = "A strategy focused on disrupting the opponent's economy and early game.",
                LongDefinition =
                    "**Harass** refers to early-game attacks aimed at disrupting the opponent's economy, worker count, or map control rather than delivering a killing blow. Successful harass can put the opponent behind by delaying their tech or denying resources.",
                RelatedTermIds = new List<string> { "glossary_timing" }
            },
            new()
            {
                Id = "glossary_timing", Term = "Timing", Category = "Mechanic",
                ShortDefinition = "A specific moment in the game where your army is stronger relative to the opponent.",
                LongDefinition =
                    "A **timing** attack is a push designed to hit at a moment when your army composition, upgrades, or economy give you a temporary advantage. Timing attacks are often built around completing a key upgrade or reaching a critical mass of a specific unit type.",
                RelatedTermIds = new List<string> { "glossary_harass" }
            },
            new()
            {
                Id = "glossary_tier", Term = "Tier", Category = "Mechanic",
                ShortDefinition = "Progression level indicating how advanced a unit, building, or upgrade is.",
                LongDefinition =
                    "**Tier** is a numeric progression level assigned to entities. Higher-tier units and buildings generally require more advanced infrastructure and resources. Tier 1 is the early game, Tier 2 is mid-game, and Tier 3 is late-game."
            },
            new()
            {
                Id = "glossary_tech", Term = "Tech", Category = "Mechanic",
                ShortDefinition = "Upgrades and research that unlock new units, abilities, or improve existing ones.",
                LongDefinition =
                    "**Tech** encompasses all upgrades and research available in the game. Tech upgrades can improve unit stats, unlock new abilities, or enable advanced buildings. Managing your tech progression efficiently is key to a successful build order."
            },

            // Role / Descriptive Types
            new()
            {
                Id = "glossary_frontliner", Term = "Frontliner", Category = "Role",
                ShortDefinition = "A durable unit designed to absorb damage and hold the front line.",
                LongDefinition =
                    "**Frontliner** units are tough, high-health units designed to absorb enemy damage and protect more vulnerable units behind them. They typically have high armor and HP but deal moderate damage.",
                RelatedTermIds = new List<string> { "glossary_skirmisher", "glossary_support" }
            },
            new()
            {
                Id = "glossary_skirmisher", Term = "Skirmisher", Category = "Role",
                ShortDefinition = "A mobile unit that excels at hit-and-run tactics and flanking.",
                LongDefinition =
                    "**Skirmisher** units are fast, mobile units that excel at hit-and-run tactics. They typically have moderate health and high damage output, and are effective at flanking, chasing down retreating units, and harassing worker lines.",
                RelatedTermIds = new List<string> { "glossary_frontliner", "glossary_harass" }
            },
            new()
            {
                Id = "glossary_support", Term = "Support", Category = "Role",
                ShortDefinition = "A unit that provides healing, buffs, or utility rather than direct damage.",
                LongDefinition =
                    "**Support** units provide healing, buffs, debuffs, or other utility to allied units. They typically have low HP and damage but can swing fights with their abilities.",
                RelatedTermIds = new List<string> { "glossary_frontliner" }
            },
            new()
            {
                Id = "glossary_generalist", Term = "Generalist", Category = "Role",
                ShortDefinition = "A versatile unit with balanced stats, effective in many situations.",
                LongDefinition =
                    "**Generalist** units have balanced stats and no extreme strengths or weaknesses. They are reliable in a variety of situations but may be outclassed by specialized units in their specific roles."
            },

            // Armor and Defense
            new()
            {
                Id = "glossary_armor_light", Term = "Light Armor", Category = "Mechanic",
                ShortDefinition = "Armor type with low HP but high speed; vulnerable to certain damage types.",
                LongDefinition =
                    "**Light Armor** units are fast but fragile. They take reduced damage from some attack types but are vulnerable to others. Common on scout units and workers."
            },
            new()
            {
                Id = "glossary_armor_medium", Term = "Medium Armor", Category = "Mechanic",
                ShortDefinition = "Balanced armor type with moderate HP and speed.",
                LongDefinition =
                    "**Medium Armor** provides a balance of protection and mobility. Most front-line combat units have Medium Armor."
            },
            new()
            {
                Id = "glossary_armor_heavy", Term = "Heavy Armor", Category = "Mechanic",
                ShortDefinition = "High-durability armor on slow, tough units and structures.",
                LongDefinition =
                    "**Heavy Armor** is found on durable units and buildings. It provides significant damage reduction but units with Heavy Armor are typically slow. Structures like Strongholds have Heavy Armor.",
                RelatedEntityIds = new List<string> { "BUILDING_Acropolis" }
            },
            new()
            {
                Id = "glossary_armor_etheric", Term = "Etheric Armor", Category = "Mechanic",
                ShortDefinition = "Magical armor that provides resistance to spell-type damage.",
                LongDefinition =
                    "**Etheric Armor** provides protection against magical and energy-based attacks. Units with Etheric Armor are typically spellcasters or high-tech units."
            },
            new()
            {
                Id = "glossary_shield", Term = "Shield", Category = "Mechanic",
                ShortDefinition = "An additional HP layer that regenerates over time when not taking damage.",
                LongDefinition =
                    "**Shields** provide an additional layer of hit points on top of base health. Shield HP regenerates over time when the unit has not taken damage recently, making shielded units strong in hit-and-run engagements."
            },
            new()
            {
                Id = "glossary_overgrowth", Term = "Overgrowth", Category = "Mechanic",
                ShortDefinition = "A defensive mechanism that heals structures over time.",
                LongDefinition =
                    "**Overgrowth** is a defensive layer unique to certain factions that slowly regenerates the health of structures, making base defenses more resilient over time."
            },

            // Factions
            new()
            {
                Id = "glossary_faction_aru", Term = "Aru", Category = "Faction",
                ShortDefinition = "A faction themed around fire, demons, and aggressive play.",
                LongDefinition =
                    "The **Aru** are a demonic faction focused on aggressive, high-damage play. Their units emphasize raw firepower and mobility. Their Immortals include Atzlan, Mala, and Xol.",
                RelatedTermIds = new List<string> { "glossary_immortal" },
                RelatedEntityIds = new List<string> { "FACTION_Aru" }
            },
            new()
            {
                Id = "glossary_faction_qrath", Term = "Q'Rath", Category = "Faction",
                ShortDefinition = "A faction themed around order, light, and defensive play.",
                LongDefinition =
                    "The **Q'Rath** are an angelic/order-themed faction focused on defensive play and sustained engagements. Their units emphasize durability and support. Their Immortals include Orzum and Ajari.",
                RelatedTermIds = new List<string> { "glossary_immortal" },
                RelatedEntityIds = new List<string> { "FACTION_QRath" }
            },

            // Movement
            new()
            {
                Id = "glossary_movement_ground", Term = "Ground", Category = "Mechanic",
                ShortDefinition = "Units that move along the ground and can be blocked by terrain.",
                LongDefinition =
                    "**Ground** units move along the terrain surface and can be blocked by obstacles, buildings, and other units. Most melee units are Ground units."
            },
            new()
            {
                Id = "glossary_movement_hover", Term = "Hover", Category = "Mechanic",
                ShortDefinition = "Units that float above the ground and ignore terrain obstacles.",
                LongDefinition =
                    "**Hover** units float above the ground, allowing them to pass over obstacles and terrain features that would block Ground units. They cannot be blocked by units."
            },
            new()
            {
                Id = "glossary_movement_air", Term = "Air", Category = "Mechanic",
                ShortDefinition = "Flying units that ignore all terrain and can attack from above.",
                LongDefinition =
                    "**Air** units fly over all terrain and obstacles. They can only be attacked by units that target Air. Air units provide excellent map control and mobility."
            },

            // Target Types
            new()
            {
                Id = "glossary_target_ground", Term = "Ground Target", Category = "Mechanic",
                ShortDefinition = "Attacks or abilities that only hit ground units.",
                LongDefinition =
                    "**Ground Target** attacks and abilities can only affect units on the ground. Anti-air units require the ability to target Air units."
            },
            new()
            {
                Id = "glossary_target_air", Term = "Air Target", Category = "Mechanic",
                ShortDefinition = "Attacks or abilities that only hit air units.",
                LongDefinition = "**Air Target** attacks and abilities can only affect flying units."
            }
        };

        return terms.ToDictionary(t => t.Id);
    }
}