local addonName, NS = ...

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

-- TBC ERA CLASS LIST (No DK, DH, Evoker, Monk)
NS.Constants.CLASS_LIST = {
    "Druid", "Hunter", "Mage", "Paladin", "Priest", 
    "Rogue", "Shaman", "Warlock", "Warrior"
}

-- Localized class names for /who queries (TBC Classes Only)
NS.Constants.LOCALIZED_CLASSES = {
    ["enUS"] = {
        ["Druid"] = "Druid", ["Hunter"] = "Hunter", ["Mage"] = "Mage",
        ["Paladin"] = "Paladin", ["Priest"] = "Priest", ["Rogue"] = "Rogue",
        ["Shaman"] = "Shaman", ["Warlock"] = "Warlock", ["Warrior"] = "Warrior"
    },
    ["enGB"] = {
        ["Druid"] = "Druid", ["Hunter"] = "Hunter", ["Mage"] = "Mage",
        ["Paladin"] = "Paladin", ["Priest"] = "Priest", ["Rogue"] = "Rogue",
        ["Shaman"] = "Shaman", ["Warlock"] = "Warlock", ["Warrior"] = "Warrior"
    },
    ["deDE"] = {
        ["Druid"] = "Druide", ["Hunter"] = "Jäger", ["Mage"] = "Magier",
        ["Paladin"] = "Paladin", ["Priest"] = "Priester", ["Rogue"] = "Schurke",
        ["Shaman"] = "Schamane", ["Warlock"] = "Hexenmeister", ["Warrior"] = "Krieger"
    },
    ["esES"] = {
        ["Druid"] = "Druida", ["Hunter"] = "Cazador", ["Mage"] = "Mago",
        ["Paladin"] = "Paladín", ["Priest"] = "Sacerdote", ["Rogue"] = "Pícaro",
        ["Shaman"] = "Chamán", ["Warlock"] = "Brujo", ["Warrior"] = "Guerrero"
    },
    ["esMX"] = {
        ["Druid"] = "Druida", ["Hunter"] = "Cazador", ["Mage"] = "Mago",
        ["Paladin"] = "Paladín", ["Priest"] = "Sacerdote", ["Rogue"] = "Pícaro",
        ["Shaman"] = "Chamán", ["Warlock"] = "Brujo", ["Warrior"] = "Guerrero"
    },
    ["frFR"] = {
        ["Druid"] = "Druide", ["Hunter"] = "Chasseur", ["Mage"] = "Mage",
        ["Paladin"] = "Paladin", ["Priest"] = "Prêtre", ["Rogue"] = "Voleur",
        ["Shaman"] = "Chaman", ["Warlock"] = "Démoniste", ["Warrior"] = "Guerrier"
    },
    ["itIT"] = {
        ["Druid"] = "Druido", ["Hunter"] = "Cacciatore", ["Mage"] = "Mago",
        ["Paladin"] = "Paladino", ["Priest"] = "Sacerdote", ["Rogue"] = "Ladro",
        ["Shaman"] = "Sciamano", ["Warlock"] = "Stregone", ["Warrior"] = "Guerriero"
    },
    ["ptBR"] = {
        ["Druid"] = "Druida", ["Hunter"] = "Caçador", ["Mage"] = "Mago",
        ["Paladin"] = "Paladino", ["Priest"] = "Sacerdote", ["Rogue"] = "Ladino",
        ["Shaman"] = "Xamã", ["Warlock"] = "Bruxo", ["Warrior"] = "Guerreiro"
    },
    ["ruRU"] = {
        ["Druid"] = "Друид", ["Hunter"] = "Охотник", ["Mage"] = "Маг",
        ["Paladin"] = "Паладин", ["Priest"] = "Жрец", ["Rogue"] = "Разбойник",
        ["Shaman"] = "Шаман", ["Warlock"] = "Чернокнижник", ["Warrior"] = "Воин"
    },
    ["koKR"] = {
        ["Druid"] = "드루이드", ["Hunter"] = "사냥꾼", ["Mage"] = "마법사",
        ["Paladin"] = "성기사", ["Priest"] = "사제", ["Rogue"] = "도적",
        ["Shaman"] = "주술사", ["Warlock"] = "흑마법사", ["Warrior"] = "전사"
    },
    ["zhCN"] = {
        ["Druid"] = "德鲁伊", ["Hunter"] = "猎人", ["Mage"] = "法师",
        ["Paladin"] = "圣骑士", ["Priest"] = "牧师", ["Rogue"] = "潜行者",
        ["Shaman"] = "萨满祭司", ["Warlock"] = "术士", ["Warrior"] = "战士"
    },
    ["zhTW"] = {
        ["Druid"] = "德魯伊", ["Hunter"] = "獵人", ["Mage"] = "法師",
        ["Paladin"] = "聖騎士", ["Priest"] = "牧師", ["Rogue"] = "盜賊",
        ["Shaman"] = "薩滿", ["Warlock"] = "術士", ["Warrior"] = "戰士"
    },
}

-- TBC ERA RACE LIST
NS.Constants.RACES = {
    ["Alliance"] = {"Human", "Dwarf", "Night Elf", "Gnome", "Draenei"},
    ["Horde"] = {"Orc", "Undead", "Tauren", "Troll", "Blood Elf"}
}

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,
    minLevel = 1,
    maxLevel = 70, -- TBC Cap
    templates = NS.Data and NS.Data.DefaultTemplates or {["Default"] = "Hello!"}, 
    blacklist = {},
    permaBlacklist = {},
    recentHistory = {},
    messageTemplate = "Default",
    customFilters = {},
    scale = 1.0,
    alpha = 1.0, 
    sendMode = "MESSAGE", -- MESSAGE, INVITE, or BOTH
    windowWidth = 1280,
    windowHeight = 720,
    
    -- Whisper Pane Defaults
    showRepliesOnly = false,

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

    -- Language Setting
    language = GetLocale() -- Default to client locale
}