local addonName, privateDB = ...

-- ============================================================================
-- CORE MODULE
-- Defines global namespace and shared data structures
-- ============================================================================

-- Global addon table
HousingDecorGuide = {}
_G.HousingDecorGuide = HousingDecorGuide

-- Expose to private namespace for other modules
privateDB.HDG = HousingDecorGuide

-- Initialize modules table if not already
privateDB.modules = privateDB.modules or {}

-- ============================================================================
-- DECOR ID LOOKUPS (lazy-built from HDG_AllDecorDB)
-- ============================================================================

function HousingDecorGuide.BuildDecorLookups()
    if HousingDecorGuide._decorToItem then return end
    local d2i, i2d = {}, {}
    if HDG_AllDecorDB then
        for itemID, entry in pairs(HDG_AllDecorDB) do
            local decorID = entry[1]
            if decorID and decorID > 0 then
                d2i[decorID] = itemID
                i2d[itemID] = decorID
            end
        end
    end
    HousingDecorGuide._decorToItem = d2i
    HousingDecorGuide._itemToDecor = i2d
end

