--------------------------------------------------------------------------
--
--              ██████╗██╗  ██╗ █████╗ ██████╗ ██████╗  ██████╗
--             ██╔════╝██║  ██║██╔══██╗██╔══██╗██╔══██╗██╔════╝
--             ██║     ███████║███████║██║  ██║██████╔╝██║
--             ██║     ██╔══██║██╔══██║██║  ██║██╔══██╗██║
--             ╚██████╗██║  ██║██║  ██║██████╔╝██║  ██║╚██████╗
--              ╚═════╝╚═╝  ╚═╝╚═╝  ╚═╝╚═════╝ ╚═╝  ╚═╝ ╚═════╝
--
--------------------------------------------------------------------------

---@type ChadrcConfig
local options = {

    ui = {
        ------------------------------- nvchad_ui modules -----------------------------
        statusline = {
            enabled = true,
            theme = "default", -- default/vscode/vscode_colored/minimal
            -- default/round/block/arrow separators work only for default statusline theme
            -- round and block will work for minimal theme only
            separator_style = "arrow",
            order = nil,
            modules = nil,
        },

        -- lazyload it when there are 1+ buffers
        tabufline = {
            enabled = true,
            lazyload = true,
            order = { "treeOffset", "buffers", "tabs", "btns" },
            modules = nil,
        },

        telescope = { style = "bordered" }, -- borderless / bordered

        cmp = {
            icons = true,
            icons_left = false, -- only for non-atom styles!
            lspkind_text = true,
            style = "default", -- default/flat_light/flat_dark/atom/atom_colored
            format_colors = {
                tailwind = false, -- will work for css lsp too
                icon = "󱓻",
            },
        },
    },

    nvdash = {
        load_on_startup = true,
        header = {
            "  I use                                                                ",
            "  ██████   █████                   █████   █████  ███                  ",
            " ░░██████ ░░███                   ░░███   ░░███  ░░░                   ",
            "  ░███░███ ░███   ██████   ██████  ░███    ░███  ████  █████████████   ",
            "  ░███░░███░███  ███░░███ ███░░███ ░███    ░███ ░░███ ░░███░░███░░███  ",
            "  ░███ ░░██████ ░███████ ░███ ░███ ░░███   ███   ░███  ░███ ░███ ░███  ",
            "  ░███  ░░█████ ░███░░░  ░███ ░███  ░░░█████░    ░███  ░███ ░███ ░███  ",
            "  █████  ░░█████░░██████ ░░██████     ░░███      █████ █████░███ █████ ",
            " ░░░░░    ░░░░░  ░░░░░░   ░░░░░░       ░░░      ░░░░░ ░░░░░ ░░░ ░░░░░  ",
            "                                                                   btw ",
        },
        buttons = {
            { txt = "  Find file", keys = ", f f", cmd = "Telescope find_files" },
            { txt = "󰈚  Recent Files", keys = ", f o", cmd = "Telescope oldfiles" },
            { txt = "󰈭  Find Word", keys = ", f w", cmd = "Telescope live_grep" },
            { txt = "  Bookmarks", keys = ", m a", cmd = "Telescope marks" },
            { txt = "  Themes", keys = ", t h", cmd = "Telescope themes" },
            { txt = "  Mappings", keys = ", c h", cmd = "NvCheatsheet" },
            { txt = "─", hl = "NvDashFooter", no_gap = true, rep = true },

            {
                txt = function()
                    local stats = require("lazy").stats()
                    local ms = math.floor(stats.startuptime) .. " ms"
                    return "  Loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms
                end,
                hl = "NvDashFooter",
                no_gap = true,
            },

            { txt = "─", hl = "NvDashFooter", no_gap = true, rep = true },
        },
    },

    term = {
        winopts = { number = false, relativenumber = false },
        sizes = { sp = 0.3, vsp = 0.2, ["bo sp"] = 0.3, ["bo vsp"] = 0.2 },
        float = {
            relative = "editor",
            row = 0.3,
            col = 0.25,
            width = 0.5,
            height = 0.4,
            border = "single",
        },
    },

    lsp = {
        signature = true,
        semantic_tokens = false,
    },

    cheatsheet = { theme = "grid" }, -- simple/grid

    base46 = {
        integrations = {
            "codeactionmenu",
            "cmp",
            "dap",
            "defaults",
            "devicons",
            "git",
            "lsp",
            "lspsaga",
            "markview",
            "mason",
            "notify",
            "nvcheatsheet",
            "nvimtree",
            "statusline",
            "syntax",
            "treesitter",
            "trouble",
            "tbline",
            "telescope",
            "whichkey",
        },

        theme = "gruvbox", -- default theme

        hl_override = {
            Comment = { fg = "#928374" },
            ["@comment"] = { fg = "#928374" },
            LineNr = { fg = "#928374" },
        },
        transparency = true,
    },

    colorify = {
        enabled = true,
        mode = "virtual", -- fg, bg, virtual
        virt_text = "󱓻 ",
        highlight = { hex = true, lspvars = true },
    },
}

local status, chadrc = pcall(require, "chadrc")
return vim.tbl_deep_extend("force", options, status and chadrc or {})
