--[[
    Commander 3.0 - TUI Symbols

    Box drawing characters and symbol sets for borders.
    WoW supports UTF-8, so we can use Unicode box drawing.

    Available sets:
    - SINGLE: Standard single-line box (┌─┐)
    - DOUBLE: Double-line box (╔═╗)
    - ROUNDED: Rounded corners (╭─╮)
    - THICK: Bold/thick lines (┏━┓)
    - NONE: No borders (spaces)
]]

local ADDON_NAME, C3 = ...

C3.TUI = C3.TUI or {}
C3.TUI.Symbols = {}

local Symbols = C3.TUI.Symbols

-------------------------------------------------------------------------------
-- Border Sets
-------------------------------------------------------------------------------

-- Single-line box (most common, clean look)
Symbols.SINGLE = {
    topLeft = "┌",
    topRight = "┐",
    bottomLeft = "└",
    bottomRight = "┘",
    horizontal = "─",
    vertical = "│",
    verticalLeft = "┤",
    verticalRight = "├",
    horizontalDown = "┬",
    horizontalUp = "┴",
    cross = "┼",
}

-- Double-line box (emphasis, dialogs)
Symbols.DOUBLE = {
    topLeft = "╔",
    topRight = "╗",
    bottomLeft = "╚",
    bottomRight = "╝",
    horizontal = "═",
    vertical = "║",
    verticalLeft = "╣",
    verticalRight = "╠",
    horizontalDown = "╦",
    horizontalUp = "╩",
    cross = "╬",
}

-- Rounded corners (modern, friendly)
Symbols.ROUNDED = {
    topLeft = "╭",
    topRight = "╮",
    bottomLeft = "╰",
    bottomRight = "╯",
    horizontal = "─",
    vertical = "│",
    verticalLeft = "┤",
    verticalRight = "├",
    horizontalDown = "┬",
    horizontalUp = "┴",
    cross = "┼",
}

-- Thick/bold box (emphasis)
Symbols.THICK = {
    topLeft = "┏",
    topRight = "┓",
    bottomLeft = "┗",
    bottomRight = "┛",
    horizontal = "━",
    vertical = "┃",
    verticalLeft = "┫",
    verticalRight = "┣",
    horizontalDown = "┳",
    horizontalUp = "┻",
    cross = "╋",
}

-- No border (plain text areas)
Symbols.NONE = {
    topLeft = " ",
    topRight = " ",
    bottomLeft = " ",
    bottomRight = " ",
    horizontal = " ",
    vertical = " ",
    verticalLeft = " ",
    verticalRight = " ",
    horizontalDown = " ",
    horizontalUp = " ",
    cross = " ",
}

-- ASCII fallback (if Unicode doesn't render)
Symbols.ASCII = {
    topLeft = "+",
    topRight = "+",
    bottomLeft = "+",
    bottomRight = "+",
    horizontal = "-",
    vertical = "|",
    verticalLeft = "+",
    verticalRight = "+",
    horizontalDown = "+",
    horizontalUp = "+",
    cross = "+",
}

-------------------------------------------------------------------------------
-- Progress Bar Symbols
-------------------------------------------------------------------------------

Symbols.BAR = {
    full = "█",
    sevenEighths = "▉",
    threeQuarters = "▊",
    fiveEighths = "▋",
    half = "▌",
    threeEighths = "▍",
    quarter = "▎",
    eighth = "▏",
    empty = " ",
}

-- Horizontal bar (for vertical gauges)
Symbols.BAR_H = {
    full = "█",
    sevenEighths = "▇",
    threeQuarters = "▆",
    fiveEighths = "▅",
    half = "▄",
    threeEighths = "▃",
    quarter = "▂",
    eighth = "▁",
    empty = " ",
}

-- Simple ASCII progress bar
Symbols.BAR_ASCII = {
    full = "#",
    empty = "-",
    left = "[",
    right = "]",
}

-------------------------------------------------------------------------------
-- Scrollbar Symbols
-------------------------------------------------------------------------------

Symbols.SCROLLBAR = {
    up = "▲",
    down = "▼",
    left = "◄",
    right = "►",
    track = "│",
    trackH = "─",
    thumb = "█",
    thumbSmall = "┃",
}

-------------------------------------------------------------------------------
-- Selection/Markers
-------------------------------------------------------------------------------

Symbols.MARKERS = {
    selected = "●",
    unselected = "○",
    checked = "✓",
    unchecked = "☐",
    bullet = "•",
    arrow = "→",
    arrowLeft = "←",
    arrowUp = "↑",
    arrowDown = "↓",
    pointer = "▶",
    pointerLeft = "◀",
    diamond = "◆",
    diamondEmpty = "◇",
    star = "★",
    starEmpty = "☆",
}

-------------------------------------------------------------------------------
-- Spinners (for loading animations)
-------------------------------------------------------------------------------

Symbols.SPINNER = {
    dots = { "⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏" },
    line = { "-", "\\", "|", "/" },
    block = { "▖", "▘", "▝", "▗" },
}

-------------------------------------------------------------------------------
-- Block Elements (for graphics)
-------------------------------------------------------------------------------

Symbols.BLOCKS = {
    full = "█",
    upperHalf = "▀",
    lowerHalf = "▄",
    leftHalf = "▌",
    rightHalf = "▐",
    light = "░",
    medium = "▒",
    dark = "▓",
}

-------------------------------------------------------------------------------
-- Helper Functions
-------------------------------------------------------------------------------

---Get a border set by name
---@param name string "single", "double", "rounded", "thick", "none", "ascii"
---@return table
function Symbols.GetBorder(name)
    local map = {
        single = Symbols.SINGLE,
        double = Symbols.DOUBLE,
        rounded = Symbols.ROUNDED,
        thick = Symbols.THICK,
        none = Symbols.NONE,
        ascii = Symbols.ASCII,
    }
    return map[name:lower()] or Symbols.SINGLE
end

return Symbols
