local addonName, NS = ...
local GR = NS.GR

-- =========================================================================
-- UI: MVP VIEW
-- =========================================================================

function GR:BuildMVPView()
    -- Defined as ID 8 in Constants.lua
    local viewId = 8 
    local parent = CreateFrame("Frame", "GRS_MVPView", self.ViewContainer)
    parent:SetAllPoints()
    parent:Hide()
    if not self.views then self.views = {} end
    self.views[viewId] = parent
    
    -- Main Container Box
    local content = CreateFrame("Frame", nil, parent)
    -- Anchors to stretch horizontally across the parent (Maximum Width)
    content:SetPoint("TOPLEFT", 0, 0)
    content:SetPoint("BOTTOMRIGHT", 0, -1) 
    
    -- [[ BACKGROUND LOGIC ]]
    -- 1. Create Pure Black Backdrop (Sublayer -1)
    local bg = content:CreateTexture(nil, "BACKGROUND", nil, -1)
    bg:SetAllPoints()
    bg:SetColorTexture(0, 0, 0, 0.75) -- Pure Black

    -- 2. Create Logo Texture (Sublayer 1)
    local logo = content:CreateTexture(nil, "BACKGROUND", nil, 1)
    logo:SetPoint("CENTER")
    logo:SetSize(512, 512) -- Standard large icon size to act as wallpaper
    -- Dynamic path using the addonName variable
    logo:SetTexture("Interface\\AddOns\\" .. addonName .. "\\media\\AXIOM_Logo.tga")

    -- Title: MVP's
    local title = content:CreateFontString(nil, "OVERLAY", "GameFontNormalHuge")
    title:SetPoint("TOP", 0, -30)
    title:SetText(NS.L["MVP_TITLE"] or "MVP's")
    title:SetTextColor(1, 0.82, 0) -- Gold Color
    
    -- Appreciation Note (Re-inserted)
    local subTitle = content:CreateFontString(nil, "OVERLAY", "GameFontHighlightMedium")
    subTitle:SetPoint("TOP", title, "BOTTOM", 0, -15)
    subTitle:SetWidth(600) -- Allow wrapping if necessary
    subTitle:SetText(NS.L["MVP_SUBTITLE"] or "A special thank you to the legends who helped shape this project.\nYour support has been invaluable.")
    subTitle:SetTextColor(0.9, 0.9, 0.9) -- Soft White
    
    -- The List of MVP Names
    local mvpList = {
        "Malthred",
        "Hahaheehee",
        "Getras",
        "Emaenno",
        "Niels",
        "Blladee",
		"GankerMaster",
		"Messami",
		"Nyx",
		"Frazic",
		"[Ben]",
		"Unknownhealz"
    }
    
    -- [[ CHANGED: HORIZONTAL LIST AT BOTTOM ]]
    -- Concatenate names with a separator
    local namesStr = table.concat(mvpList, "   •   ")
    
    local nameText = content:CreateFontString(nil, "OVERLAY", "GameFontNormalLarge")
    nameText:SetPoint("BOTTOM", 0, 60) -- Positioned at the bottom
    nameText:SetWidth(1000) -- Ensure it has space (though auto-width is default)
    nameText:SetText(namesStr)
    nameText:SetTextColor(0.6, 0.8, 1) -- Aesthetic Light Blue
end