-- HDG_HT_LayoutConfig.lua
-- Single source of truth for all dashboard widget dimensions.
-- Edit this file to rearrange/resize widgets; /reload to apply.
-- See: docs/superpowers/specs/2026-04-28-hdg-house-tab-cockpit-design.md
--
-- Layout reflects runtime tweaks graduated from the in-game picker. The
-- 4 source widgets folded into decoratorProfile (xpHero, decoratorTitle,
-- styleAffinity, trophyShelf) are no longer enumerated here; the composite
-- carries them. Widget files remain on disk + registered for picker reuse.

local _, privateDB = ...
privateDB.HDG_HT = privateDB.HDG_HT or {}

local LAYOUT_CONFIG = {
    -- Grid: HDG MainFrame is 870×704; tab content is 862×606. With a 22px
    -- scrollbar reserved inside the tab area, cards land in 840px width.
    -- Minimum padding (per Vamoose): padding=1, gutter=2 → column = 278 exactly.
    -- ((840 - 2*1 - 2*2) / 3 = 834 / 3 = 278.)
    cards = {
        bodyPaddingX   = 2,
        bodyPaddingY   = 2,
        footerHeight   = 18,
        titleBarHeight = 24,
    },
    grid = {
        cols       = 3,
        gapFill    = "strict",
        gutter     = 2,
        padding    = 1,
        totalWidth = 840,
    },
    widgets = {
        -- ---- Composite hero (1) — Blizzard level ring + title + trophy ----
        decoratorProfile = {
            chrome = "cardPlain",
            growBehavior = "topAlign",
            iconGap = 0,
            iconSize = 30,
            iconDrop = 12,
            minHeight = 170,
            order = 1,
            phase = "v2.38b",
            showHeader = false,  -- TrophyShelf renders without "Trophy shelf X/Y" header
            specRef = "COMPOSITE — Blizzard level ring + title + trophy",
            width = "full",
        },

        -- ---- Style affinity (2) — full-width slim strip under the hero ----
        styleAffinity = {
            chrome = "cardPlain",  -- no title bar; widget owns its inline row
            growBehavior = "topAlign",
            labelFont = 11,
            minHeight = 18,
            order = 2,
            phase = "v2.38b",
            specRef = "B3 (inline row)",
            width = "full",
        },

        -- ---- Donut row (3-4) ----
        sourceDonut = {
            centerFont = 14,
            donutSize = 120,
            growBehavior = "topAlign",
            holeSize = 60,
            legendFont = 10,
            minHeight = 180,
            order = 3,
            phase = "v2.38b",
            specRef = "EXISTING",
            width = "third",
        },
        expansionDonut = {
            centerFont = 14,
            donutSize = 120,
            growBehavior = "topAlign",
            holeSize = 60,
            legendFont = 10,
            minHeight = 228,
            order = 4,
            phase = "v2.38b",
            specRef = "EXISTING",
            width = "third",
        },

        -- ---- Inventory + currency row (5-7) ----
        hotPicks = {
            growBehavior = "fill",
            iconSize = 22,
            minHeight = 120,
            order = 5,
            phase = "v2.38b",
            rowHeight = 26,
            specRef = "B1",
            width = "third",
            xpFont = 11,
        },
        lumberWallet = {
            chipFont = 11,
            chipGap = 4,
            chipHeight = 22,
            growBehavior = "topAlign",
            minHeight = 224,
            order = 6,
            phase = "v2.38b",
            specRef = "C4a",
            width = "third",
        },
        decorCurrency = {
            chipFont = 11,
            chipGap = 4,
            chipHeight = 22,
            growBehavior = "topAlign",
            minHeight = 100,
            order = 7,
            phase = "v2.38b",
            specRef = "C4b",
            width = "twoThirds",
        },

        -- ---- Account row (8-10) ----
        multiHouse = {
            barHeight = 6,
            cardBarSegments = 5,
            chrome = "cardPlain",
            growBehavior = "topAlign",
            houseCardWidth = 140,
            levelBadgeFont = 12,
            minHeight = 86,
            order = 8,
            phase = "v2.38b-test",
            specRef = "A3",
            width = "third",
        },
        recentActivity = {
            growBehavior = "fill",
            iconSize = 22,
            minHeight = 140,
            order = 9,
            phase = "v2.38b",
            rowHeight = 28,
            specRef = "C2",
            timestampFont = 10,
            width = "third",
        },
        capacity = {
            barGradient = true,
            barSegments = 10,
            barStyle = "circles",
            fillbarHeight = 16,
            fillbarPadding = 6,
            growBehavior = "topAlign",
            minHeight = 120,
            order = 10,
            phase = "v2.38b",
            specRef = "A1 (+B4)",
            subFont = 10,
            titleFont = 13,
            valueFont = 11,
            width = "third",
        },
        velocity = {
            growBehavior = "topAlign",
            minHeight    = 120,
            order        = 10.5,           -- right after capacity
            phase        = "v2.43",
            specRef      = "Playtester ROI -- Collection Velocity",
            subFont      = 10,
            titleFont    = 13,
            valueFont    = 14,
            width        = "third",
        },

        -- ---- Closest to complete (11) — full-width strip ----
        closeCards = {
            barHeight = 6,
            cardCount = 3,
            cardGap = 6,
            chrome = "cardPlain",
            growBehavior = "topAlign",
            minHeight = 80,
            order = 11,
            phase = "v2.38b",
            specRef = "EXISTING",
            width = "full",
        },

        -- ---- Event row (12-14) ----
        ritualSites = {
            growBehavior = "fill",
            iconGap = 4,
            iconSize = 24,
            minHeight = 96,
            order = 12,
            phase = "v2.38b",
            specRef = "EVENT",
            width = "third",
        },
        abyssAnglers = {
            growBehavior = "fill",
            iconGap = 4,
            iconSize = 24,
            minHeight = 96,
            order = 13,
            phase = "v2.38b",
            specRef = "EVENT",
            width = "third",
        },
        decorDuels = {
            growBehavior = "fill",
            iconGap = 4,
            iconSize = 24,
            minHeight = 96,
            order = 14,
            phase = "v2.38b",
            specRef = "EVENT",
            width = "third",
        },

        -- ---- Featured + planning (15-17) ----
        featured = {
            growBehavior = "topAlign",
            iconSize = 48,
            minHeight = 80,
            order = 15,
            phase = "v2.38b",
            specRef = "EXISTING",
            subFont = 10,
            titleFont = 13,
            width = "full",
        },
        nextRewards = {
            growBehavior = "topAlign",
            headerFont = 12,
            iconSize = 24,
            minHeight = 120,
            order = 16,
            phase = "v2.38b",
            rowHeight = 28,
            specRef = "A2",
            width = "third",
        },
        craftableNow = {
            bigNumberFont = 22,
            growBehavior = "topAlign",
            minHeight = 160,
            order = 17,
            phase = "v2.38b",
            specRef = "C1",
            subFont = 11,
            width = "third",
        },

        -- ---- Goblin / collection row (18-20) ----
        goblinTopLumber = {
            growBehavior = "fill",
            iconSize = 22,
            minHeight = 144,
            order = 18,
            phase = "v2.38b",
            rowHeight = 26,
            specRef = "GOBLIN",
            width = "third",
        },
        topVendors = {
            growBehavior = "fill",
            iconSize = 22,
            minHeight = 144,
            order = 19,
            phase = "v2.38b",
            rowHeight = 26,
            specRef = "TOPVENDORS",
            width = "third",
        },
        favorites = {
            growBehavior = "fill",
            iconSize = 18,
            minHeight = 200,
            order = 20,
            phase = "v2.38b",
            rowHeight = 22,
            specRef = "FAVORITES",
            width = "third",
        },

        -- ---- Tail (21-22) — long-tail / off-by-default ----
        records = {
            defaultEnabled = false,  -- off until logs are dense enough to be useful
            growBehavior = "topAlign",
            minHeight = 100,
            order = 21,
            phase = "v2.39",
            specRef = "D2",
            statFont = 11,
            statRowHeight = 18,
            width = "third",
        },
        themedSets = {
            barHeight = 8,
            cardBarGradient = true,
            cardBarGradientReverse = true,  -- amber → green (progress filling up)
            cardBarHeight = 10,
            cardBarSegments = 10,
            cardBarStyle = "circles",
            cardCount = 4,
            cardGap = 6,
            growBehavior = "fill",
            minHeight = 110,
            order = 22,
            phase = "v2.39",
            specRef = "C3",
            width = "full",
        },
    },
}

privateDB.HDG_HT.LayoutConfig = LAYOUT_CONFIG
