local addonName, NS = ...

-- Define the Constants table within the Namespace
NS.Constants = {}

NS.Constants.CLASS_LIST = {
    "Death Knight", "Demon Hunter", "Druid", "Evoker", "Hunter", 
    "Mage", "Monk", "Paladin", "Priest", "Rogue", 
    "Shaman", "Warlock", "Warrior"
}

-- Localized class names for /who queries (indexed by WoW client locale)
-- Key format: LOCALIZED_CLASSES[locale][englishClassName] = localizedClassName
NS.Constants.LOCALIZED_CLASSES = {
    ["enUS"] = {
        ["Death Knight"] = "Death Knight", ["Demon Hunter"] = "Demon Hunter", ["Druid"] = "Druid",
        ["Evoker"] = "Evoker", ["Hunter"] = "Hunter", ["Mage"] = "Mage", ["Monk"] = "Monk",
        ["Paladin"] = "Paladin", ["Priest"] = "Priest", ["Rogue"] = "Rogue",
        ["Shaman"] = "Shaman", ["Warlock"] = "Warlock", ["Warrior"] = "Warrior"
    },
    ["enGB"] = {
        ["Death Knight"] = "Death Knight", ["Demon Hunter"] = "Demon Hunter", ["Druid"] = "Druid",
        ["Evoker"] = "Evoker", ["Hunter"] = "Hunter", ["Mage"] = "Mage", ["Monk"] = "Monk",
        ["Paladin"] = "Paladin", ["Priest"] = "Priest", ["Rogue"] = "Rogue",
        ["Shaman"] = "Shaman", ["Warlock"] = "Warlock", ["Warrior"] = "Warrior"
    },
    ["deDE"] = {
        ["Death Knight"] = "Todesritter", ["Demon Hunter"] = "Dämonenjäger", ["Druid"] = "Druide",
        ["Evoker"] = "Rufer", ["Hunter"] = "Jäger", ["Mage"] = "Magier", ["Monk"] = "Mönch",
        ["Paladin"] = "Paladin", ["Priest"] = "Priester", ["Rogue"] = "Schurke",
        ["Shaman"] = "Schamane", ["Warlock"] = "Hexenmeister", ["Warrior"] = "Krieger"
    },
    ["esES"] = {
        ["Death Knight"] = "Caballero de la Muerte", ["Demon Hunter"] = "Cazador de Demonios", ["Druid"] = "Druida",
        ["Evoker"] = "Evocador", ["Hunter"] = "Cazador", ["Mage"] = "Mago", ["Monk"] = "Monje",
        ["Paladin"] = "Paladín", ["Priest"] = "Sacerdote", ["Rogue"] = "Pícaro",
        ["Shaman"] = "Chamán", ["Warlock"] = "Brujo", ["Warrior"] = "Guerrero"
    },
    ["esMX"] = {
        ["Death Knight"] = "Caballero de la Muerte", ["Demon Hunter"] = "Cazador de Demonios", ["Druid"] = "Druida",
        ["Evoker"] = "Evocador", ["Hunter"] = "Cazador", ["Mage"] = "Mago", ["Monk"] = "Monje",
        ["Paladin"] = "Paladín", ["Priest"] = "Sacerdote", ["Rogue"] = "Pícaro",
        ["Shaman"] = "Chamán", ["Warlock"] = "Brujo", ["Warrior"] = "Guerrero"
    },
    ["frFR"] = {
        ["Death Knight"] = "Chevalier de la mort", ["Demon Hunter"] = "Chasseur de démons", ["Druid"] = "Druide",
        ["Evoker"] = "Évocateur", ["Hunter"] = "Chasseur", ["Mage"] = "Mage", ["Monk"] = "Moine",
        ["Paladin"] = "Paladin", ["Priest"] = "Prêtre", ["Rogue"] = "Voleur",
        ["Shaman"] = "Chaman", ["Warlock"] = "Démoniste", ["Warrior"] = "Guerrier"
    },
    ["itIT"] = {
        ["Death Knight"] = "Cavaliere della Morte", ["Demon Hunter"] = "Cacciatore di Demoni", ["Druid"] = "Druido",
        ["Evoker"] = "Invocatore", ["Hunter"] = "Cacciatore", ["Mage"] = "Mago", ["Monk"] = "Monaco",
        ["Paladin"] = "Paladino", ["Priest"] = "Sacerdote", ["Rogue"] = "Ladro",
        ["Shaman"] = "Sciamano", ["Warlock"] = "Stregone", ["Warrior"] = "Guerriero"
    },
    ["ptBR"] = {
        ["Death Knight"] = "Cavaleiro da Morte", ["Demon Hunter"] = "Caçador de Demônios", ["Druid"] = "Druida",
        ["Evoker"] = "Evocador", ["Hunter"] = "Caçador", ["Mage"] = "Mago", ["Monk"] = "Monge",
        ["Paladin"] = "Paladino", ["Priest"] = "Sacerdote", ["Rogue"] = "Ladino",
        ["Shaman"] = "Xamã", ["Warlock"] = "Bruxo", ["Warrior"] = "Guerreiro"
    },
    ["ruRU"] = {
        ["Death Knight"] = "Рыцарь смерти", ["Demon Hunter"] = "Охотник на демонов", ["Druid"] = "Друид",
        ["Evoker"] = "Пробудитель", ["Hunter"] = "Охотник", ["Mage"] = "Маг", ["Monk"] = "Монах",
        ["Paladin"] = "Паладин", ["Priest"] = "Жрец", ["Rogue"] = "Разбойник",
        ["Shaman"] = "Шаман", ["Warlock"] = "Чернокнижник", ["Warrior"] = "Воин"
    },
    ["koKR"] = {
        ["Death Knight"] = "죽음의 기사", ["Demon Hunter"] = "악마사냥꾼", ["Druid"] = "드루이드",
        ["Evoker"] = "기원사", ["Hunter"] = "사냥꾼", ["Mage"] = "마법사", ["Monk"] = "수도사",
        ["Paladin"] = "성기사", ["Priest"] = "사제", ["Rogue"] = "도적",
        ["Shaman"] = "주술사", ["Warlock"] = "흑마법사", ["Warrior"] = "전사"
    },
    ["zhCN"] = {
        ["Death Knight"] = "死亡骑士", ["Demon Hunter"] = "恶魔猎手", ["Druid"] = "德鲁伊",
        ["Evoker"] = "唤魔师", ["Hunter"] = "猎人", ["Mage"] = "法师", ["Monk"] = "武僧",
        ["Paladin"] = "圣骑士", ["Priest"] = "牧师", ["Rogue"] = "潜行者",
        ["Shaman"] = "萨满祭司", ["Warlock"] = "术士", ["Warrior"] = "战士"
    },
    ["zhTW"] = {
        ["Death Knight"] = "死亡騎士", ["Demon Hunter"] = "惡魔獵手", ["Druid"] = "德魯伊",
        ["Evoker"] = "喚能師", ["Hunter"] = "獵人", ["Mage"] = "法師", ["Monk"] = "武僧",
        ["Paladin"] = "聖騎士", ["Priest"] = "牧師", ["Rogue"] = "盜賊",
        ["Shaman"] = "薩滿", ["Warlock"] = "術士", ["Warrior"] = "戰士"
    },
}

NS.Constants.RACES = {
    ["Alliance"] = {"Human", "Dwarf", "Night Elf", "Gnome", "Draenei", "Worgen", "Pandaren", "Void Elf", "Lightforged Draenei", "Dark Iron Dwarf", "Kul Tiran", "Mechagnome", "Dracthyr", "Earthen"},
    ["Horde"] = {"Orc", "Undead", "Tauren", "Troll", "Blood Elf", "Goblin", "Pandaren", "Nightborne", "Highmountain Tauren", "Mag'har Orc", "Zandalari Troll", "Vulpera", "Dracthyr", "Earthen"}
}

NS.Constants.TABS = {
    { id = 1, title = "Guild Recruiter System", titleKey = "TAB_GUILD_RECRUITER", icon = "Interface\\AddOns\\GuildRecruiterManagement\\Icons\\Guild Recruitment System.tga" },
    { id = 2, title = "Recruitment Blacklist", titleKey = "TAB_BLACKLIST", icon = "Interface\\AddOns\\GuildRecruiterManagement\\Icons\\Recruitment Blacklist.tga" },
    { id = 3, title = "Recruitment requirements", titleKey = "TAB_REQUIREMENTS", icon = "Interface\\AddOns\\GuildRecruiterManagement\\Icons\\Recruitment requirements.tga" },
    { id = 4, title = "Recruitment History", titleKey = "TAB_HISTORY", icon = "Interface\\AddOns\\GuildRecruiterManagement\\Icons\\Recruitment History.tga" },
    { id = 5, title = "Guild Roster", titleKey = "TAB_GUILD_ROSTER", icon = "Interface\\AddOns\\GuildRecruiterManagement\\Icons\\Guild Roster.tga" },
    { id = 6, title = "Raid Roster", titleKey = "TAB_RAID_ROSTER", icon = "Interface\\AddOns\\GuildRecruiterManagement\\Icons\\Raid Roster.tga" },
    { id = 7, title = "Settings", titleKey = "TAB_SETTINGS", icon = "Interface\\AddOns\\GuildRecruiterManagement\\Icons\\Settings.tga" },
    
    -- =========================================================================
    -- [MANDATE: THIS TAB MUST ALWAYS BE THE LAST TAB IN THE LIST]
    -- Do not place any new tabs below this line.
    -- =========================================================================
    { id = 8, title = "MVP", titleKey = "TAB_MVP", icon = "Interface\\AddOns\\GuildRecruiterManagement\\Icons\\mvp.tga" }
}

-- Helper function to get localized tab title
function NS.GetTabTitle(tabData)
    if NS.L and tabData.titleKey and NS.L[tabData.titleKey] then
        return NS.L[tabData.titleKey]
    end
    return tabData.title -- Fallback to hardcoded English
end

NS.Constants.DEFAULTS = {
    debugMode = false,
    remixMode = "OFF", 
    scanDelay = 0.8,
    levelMin = 1,
    levelMax = 999,
    templates = NS.Data and NS.Data.DefaultTemplates or {["Default"] = "Hello!"}, 
    blacklist = {},
    permaBlacklist = {}, -- [[ NEW: PERMANENT BLACKLIST ]]
    recentHistory = {},
    messageTemplate = "M+ Focused",
    customFilters = {},
    scale = 1.0,
    alpha = 1.0, 
    windowWidth = 1280,
    windowHeight = 720,
    
    -- Whisper Pane Defaults
    showRepliesOnly = false,

    -- Blacklist Automation Defaults
    automateReset = false,
    resetDuration = 604800, -- Default 1 Week (in seconds)

    -- Custom Backgrounds (New Panel)
    customBackgrounds = {
        enabled = false,
        directory = "Interface\\AddOns\\GuildRecruiterManagement\\Media",
        files = {
            ["GuildChat"] = "Background_G-chat.tga"
        }
    }
}