-- =============================================================================
-- Core/Pages/BlackoutMods.lua - Blackout Mods Placeholder Page
-- =============================================================================

local AddonName, _ns = ...
if type(_G.ArenaCore) ~= "table" then _G.ArenaCore = {} end
local AC = _G.ArenaCore

-- Localization helper
local function L(key)
    if AC.UILocalization then
        return AC.UILocalization:Get("BLACKOUT_MODS", key, key)
    end
    return key
end

function AC:CreateBlackoutModsPage(parent)
  -- Ensure motto strip
  if AC.Vanity and AC.Vanity.EnsureMottoStrip then 
    AC.Vanity:EnsureMottoStrip(parent) 
  end

  -- Coming Soon Section
  local comingSoonGroup = CreateFrame("Frame", nil, parent, "BackdropTemplate")
  comingSoonGroup:SetPoint("TOPLEFT", parent._mottoStrip or parent, "BOTTOMLEFT", 10, -10)
  comingSoonGroup:SetPoint("TOPRIGHT", parent._mottoStrip or parent, "BOTTOMRIGHT", -10, -10)
  comingSoonGroup:SetPoint("BOTTOMLEFT", 10, 0)
  comingSoonGroup:SetPoint("BOTTOMRIGHT", -10, 0)
  comingSoonGroup:SetBackdrop({
    bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
    edgeFile = "Interface\\ChatFrame\\ChatFrameBackground",
    tile = true, tileSize = 16, edgeSize = 1,
  })
  comingSoonGroup:SetBackdropColor(0.1, 0.1, 0.1, 0.8)
  comingSoonGroup:SetBackdropBorderColor(0.3, 0.3, 0.3, 1)

  local comingSoonTitle = AC:CreateStyledText(comingSoonGroup, L("page_title"), 16, AC.COLORS.PRIMARY, "OVERLAY", "")
  comingSoonTitle:SetPoint("TOP", 0, -30)

  -- Main message
  local comingSoonDesc = AC:CreateStyledText(comingSoonGroup, L("coming_soon"), 14, AC.COLORS.TEXT, "OVERLAY", "")
  comingSoonDesc:SetPoint("TOP", 0, -80)
  comingSoonDesc:SetJustifyH("CENTER")
  comingSoonDesc:SetWordWrap(true)

  -- Additional info
  local infoDesc = AC:CreateStyledText(comingSoonGroup, L("description"), 11, AC.COLORS.TEXT_MUTED, "OVERLAY", "")
  infoDesc:SetPoint("TOP", 0, -120)
  infoDesc:SetPoint("LEFT", 30, 0)
  infoDesc:SetPoint("RIGHT", -30, 0)
  infoDesc:SetJustifyH("CENTER")
  infoDesc:SetWordWrap(true)

  -- Decorative icon
  local icon = comingSoonGroup:CreateTexture(nil, "ARTWORK")
  icon:SetSize(64, 64)
  icon:SetPoint("TOP", 0, -180)
  icon:SetAtlas("Tormentors-Event")
  icon:SetVertexColor(0.4, 1.0, 0.6, 0.8)
end

--- Register the page with the AC system
AC:RegisterPage("BlackoutMods", function(parent)
  return AC:CreateBlackoutModsPage(parent)
end)
