-- Theme registry
-- Standalone themes: bearded-arc (dark), bearded-arc-light
-- Legacy variants: moon, dawn

local main = require('theme/bearded-arc')
local light = require('theme/bearded-arc-light')

-- Moon variant (kept here for backward compat)
local moon = {}

local moon_palette = {
    base = '#1a212f',
    overlay = '#253043',
    muted = '#4a5e84',
    text = '#afbbd2',
    red = '#FF738A',
    yellow = '#EACD61',
    orange = '#FF955C',
    green = '#3CEC85',
    cyan = '#69C3FF',
    purple = '#B78AFF',
    highlight = '#8196b5',
}

local moon_active_tab = {
    bg_color = moon_palette.overlay,
    fg_color = moon_palette.text,
}

local moon_inactive_tab = {
    bg_color = moon_palette.base,
    fg_color = moon_palette.muted,
}

function moon.colors()
    return {
        foreground = moon_palette.text,
        background = moon_palette.base,
        cursor_bg = moon_palette.yellow,
        cursor_border = moon_palette.yellow,
        cursor_fg = moon_palette.text,
        selection_bg = moon_palette.overlay,
        selection_fg = moon_palette.text,

        ansi = {
            moon_palette.overlay,
            moon_palette.red,
            moon_palette.green,
            moon_palette.yellow,
            moon_palette.cyan,
            moon_palette.purple,
            moon_palette.orange,
            moon_palette.text,
        },

        brights = {
            moon_palette.muted,
            moon_palette.red,
            moon_palette.green,
            moon_palette.yellow,
            moon_palette.cyan,
            moon_palette.purple,
            moon_palette.orange,
            moon_palette.text,
        },

        tab_bar = {
            background = moon_palette.base,
            active_tab = moon_active_tab,
            inactive_tab = moon_inactive_tab,
            inactive_tab_hover = moon_active_tab,
            new_tab = moon_inactive_tab,
            new_tab_hover = moon_active_tab,
            inactive_tab_edge = moon_palette.muted,
        },
    }
end

function moon.window_frame()
    return {
        active_titlebar_bg = moon_palette.base,
        inactive_titlebar_bg = moon_palette.base,
    }
end

-- Dawn variant (kept here for backward compat)
local dawn = {}

local dawn_palette = {
    base = '#151b26',
    overlay = '#1a212f',
    muted = '#4a5e84',
    text = '#d0d7e4',
    red = '#E35535',
    yellow = '#FF955C',
    magenta = '#F38CEC',
    green = '#3CEC85',
    cyan = '#69C3FF',
    purple = '#B78AFF',
    highlight = '#405275',
}

local dawn_active_tab = {
    bg_color = dawn_palette.overlay,
    fg_color = dawn_palette.text,
}

local dawn_inactive_tab = {
    bg_color = dawn_palette.base,
    fg_color = dawn_palette.muted,
}

function dawn.colors()
    return {
        foreground = dawn_palette.text,
        background = dawn_palette.base,
        cursor_bg = dawn_palette.muted,
        cursor_border = dawn_palette.muted,
        cursor_fg = dawn_palette.text,
        selection_bg = dawn_palette.overlay,
        selection_fg = dawn_palette.text,

        ansi = {
            dawn_palette.overlay,
            dawn_palette.red,
            dawn_palette.green,
            dawn_palette.yellow,
            dawn_palette.cyan,
            dawn_palette.purple,
            dawn_palette.magenta,
            dawn_palette.text,
        },

        brights = {
            dawn_palette.muted,
            dawn_palette.red,
            dawn_palette.green,
            dawn_palette.yellow,
            dawn_palette.cyan,
            dawn_palette.purple,
            dawn_palette.magenta,
            dawn_palette.text,
        },

        tab_bar = {
            background = dawn_palette.base,
            active_tab = dawn_active_tab,
            inactive_tab = dawn_inactive_tab,
            inactive_tab_hover = dawn_active_tab,
            new_tab = dawn_inactive_tab,
            new_tab_hover = dawn_active_tab,
            inactive_tab_edge = dawn_palette.muted,
        },
    }
end

function dawn.window_frame()
    return {
        active_titlebar_bg = dawn_palette.base,
        inactive_titlebar_bg = dawn_palette.base,
    }
end

return {
    main = main,
    light = light,
    moon = moon,
    dawn = dawn,
}
