-------------------------
-- AiB Core Config
-------------------------
-- Version 2.0.0 für WoW 12.0.0 (Midnight)

AiB = AiB or {}
AiB.Config = {}

-- Version Info
AiB.Config.VERSION = "2.0.1.0"
AiB.Config.BUILD = "120000"
AiB.Config.AUTHOR = "Rinova"

-- Schriftarten
AiB.Config.FONTS = {
    PRIMARY = "Fonts\\ARIALN.TTF",
    SECONDARY = "Interface\\AddOns\\aib\\fonts\\Fast_Respond.otf",
    HEADER = "Fonts\\FRIZQT__.TTF",
}

-- UI Dimensionen
AiB.Config.UI = {
    MAIN_WIDTH = 1200,
    MAIN_HEIGHT = 900,
    BANNER_HEIGHT = 175,
    TAB_HEIGHT = 28,
    TAB_SPACING = 2,
    BUTTON_SIZE = 30,
    MINIMAP_SIZE = 32,
}

-- Animation Settings
AiB.Config.ANIMATION = {
    FADE_DURATION = 0.3,
    SLIDE_DURATION = 0.25,
    TAB_HOVER_SCALE = 1.05,
    BUTTON_HOVER_SCALE = 1.1,
}

-- Raid Tabs (Midnight Expansion)
AiB.Config.RAID_TABS = {
    "Raid Allgemein",
    "Imperator Averzian",
    "Vorasius",
    "Fallen-King Salhadaar",
    "Vaelgor & Ezzorak",
    "Lightblinded Vanguard",
    "Crown of the Cosmos",
    "Chimaerus, the Undreamt God",
    "Belo'ren, Child of Al'ar",
    "Midnight Falls"
}

-- Dungeon Tabs (Midnight Dungeons)
AiB.Config.DUNGEON_TABS = {
    "Dungeon Allgemein",
    "Magister's Terrace",
    "Maisara Caverns",
    "Nexus-Point Xenas",
    "Windrunner Spire",
    "Algeth'ar Academy",
    "Seat of the Triumvirate",
    "Skyreach",
    "Pit of Saron"
}

-- Midnight Season Info (Beispiel für zukünftige Seasons)
AiB.Config.MIDNIGHT_SEASON = {
    NAME = "Midnight Season 1",
    DUNGEONS = {}, -- Wird später gefüllt
    RAID = "To be announced",
}

-- Default Settings
AiB.Config.DEFAULTS = {
    mode = "Raid",
    theme = "Dark",
    animations_enabled = true,
    background_enabled = true,
    minimap_position = 0,
    window_scale = 1.0,
    blur_enabled = true,
    roles = {
        tank = true,
        healer = false,
        dps = false
    }
}

-- Portal Categories
AiB.Config.PORTAL_CATEGORIES = {
    "Season 2",
    "The War Within",
    "Dragonflight",
    "Shadowlands",
    "Battle for Azeroth",
    "Legion",
    "Warlords of Draenor",
    "Mists of Pandaria",
    "Cataclysm"
}

-- Utility Functions
function AiB.Config:GetFont(fontType)
    return self.FONTS[fontType] or self.FONTS.PRIMARY
end

function AiB.Config:GetUIValue(key)
    return self.UI[key] or 0
end

function AiB.Config:GetAnimationDuration(type)
    return self.ANIMATION[type] or 0.3
end

-- Debug Mode
AiB.Config.DEBUG = false

function AiB.Config:Print(msg)
    if self.DEBUG then
        print("|cFF00FF00[AiB Debug]|r " .. tostring(msg))
    end
end

function AiB.Config:Log(category, msg)
    if self.DEBUG then
        print(string.format("|cFF00FF00[AiB %s]|r %s", category, tostring(msg)))
    end
end

-- Event System
AiB.Events = CreateFrame("Frame")
AiB.Events.listeners = {}

function AiB.Events:RegisterCallback(event, callback)
    if not self.listeners[event] then
        self.listeners[event] = {}
    end
    table.insert(self.listeners[event], callback)
end

function AiB.Events:FireCallback(event, ...)
    if self.listeners[event] then
        for _, callback in ipairs(self.listeners[event]) do
            callback(...)
        end
    end
end

