-- Diffview.nvim highlights for Forest Night theme
local M = {}

-- Helper function to set highlights
local function hl(group, opts)
    vim.api.nvim_set_hl(0, group, opts)
end

function M.apply(colors, config)
    -- Diffview panel
    hl('DiffviewNormal', { fg = colors.fg, bg = colors.bg })
    hl('DiffviewCursorLine', { bg = colors.bg_highlight })
    hl('DiffviewVertSplit', { fg = colors.border })
    hl('DiffviewSignColumn', { bg = colors.bg })
    hl('DiffviewStatusLine', { fg = colors.fg, bg = colors.bg_alt })
    hl('DiffviewStatusLineNC', { fg = colors.comment, bg = colors.bg_alt })
    hl('DiffviewEndOfBuffer', { fg = colors.bg })
    hl('DiffviewFilePanelTitle', { fg = colors.func, bold = true })
    hl('DiffviewFilePanelCounter', { fg = colors.number, bold = true })
    hl('DiffviewFilePanelFileName', { fg = colors.string })
    hl('DiffviewFilePanelPath', { fg = colors.comment })
    hl('DiffviewFilePanelInsertions', { fg = colors.git_add })
    hl('DiffviewFilePanelDeletions', { fg = colors.git_delete })
    hl('DiffviewFilePanelRootPath', { fg = colors.type, bold = true })
    hl('DiffviewFilePanelSelected', { fg = colors.func, bold = true })
    hl('DiffviewFilePanelConflicts', { fg = colors.error })
    hl('DiffviewReference', { fg = colors.property })
    hl('DiffviewPrimary', { fg = colors.func })
    hl('DiffviewSecondary', { fg = colors.property })
    hl('DiffviewDim1', { fg = colors.comment })
    hl('DiffviewFolderName', { fg = colors.type })
    hl('DiffviewFolderSign', { fg = colors.comment })
    hl('DiffviewHash', { fg = colors.comment })
    hl('DiffviewStatusAdded', { fg = colors.git_add })
    hl('DiffviewStatusUntracked', { fg = colors.git_add })
    hl('DiffviewStatusModified', { fg = colors.git_change })
    hl('DiffviewStatusRenamed', { fg = colors.warning })
    hl('DiffviewStatusCopied', { fg = colors.info })
    hl('DiffviewStatusTypeChange', { fg = colors.warning })
    hl('DiffviewStatusUnmerged', { fg = colors.error })
    hl('DiffviewStatusUnknown', { fg = colors.comment })
    hl('DiffviewStatusDeleted', { fg = colors.git_delete })
    hl('DiffviewStatusBroken', { fg = colors.error })
    hl('DiffviewStatusIgnored', { fg = colors.comment })
    hl('DiffviewFilePanelStaged', { fg = colors.info })
    hl('DiffviewFilePanelUnstaged', { fg = colors.warning })
    hl('DiffviewFilePanelWorking', { fg = colors.fg })
    hl('DiffviewFilePanelIndex', { fg = colors.info })
    hl('DiffviewFilePanelMerging', { fg = colors.error })
    hl('DiffviewFilePanelCommit', { fg = colors.func })
    hl('DiffviewFilePanelBranch', { fg = colors.property })
    hl('DiffviewFilePanelHead', { fg = colors.func, bold = true })
    hl('DiffviewFilePanelUpstream', { fg = colors.type })
    hl('DiffviewFilePanelReadOnly', { fg = colors.comment })
    hl('DiffviewFilePanelLoadMore', { fg = colors.info })
    hl('DiffviewFilePanelLoading', { fg = colors.warning })
    hl('DiffviewFilePanelEmpty', { fg = colors.comment })
    hl('DiffviewFilePanelEmptyFolder', { fg = colors.comment })
    hl('DiffviewFilePanelEmptyMessage', { fg = colors.comment, italic = true })
    hl('DiffviewFilePanelBinary', { fg = colors.comment })
    hl('DiffviewFilePanelSymlink', { fg = colors.info })
    hl('DiffviewFilePanelSubmodule', { fg = colors.type })
    hl('DiffviewFilePanelIgnored', { fg = colors.comment })
    hl('DiffviewFilePanelClean', { fg = colors.info })
    hl('DiffviewFilePanelDirty', { fg = colors.warning })
    hl('DiffviewFilePanelUnknown', { fg = colors.comment })
    hl('DiffviewFilePanelError', { fg = colors.error })
    hl('DiffviewFilePanelWarning', { fg = colors.warning })
    hl('DiffviewFilePanelInfo', { fg = colors.info })
    hl('DiffviewFilePanelHint', { fg = colors.hint })
    hl('DiffviewFilePanelOk', { fg = colors.info })
    hl('DiffviewFilePanelMoved', { fg = colors.property })
    hl('DiffviewFilePanelMoved2', { fg = colors.type })
    hl('DiffviewFilePanelMoved3', { fg = colors.warning })
    hl('DiffviewFilePanelMoved4', { fg = colors.error })
    hl('DiffviewFilePanelMoved5', { fg = colors.info })
    hl('DiffviewFilePanelMoved6', { fg = colors.func })
    hl('DiffviewFilePanelMoved7', { fg = colors.keyword })
    hl('DiffviewFilePanelMoved8', { fg = colors.string })
    hl('DiffviewFilePanelMoved9', { fg = colors.property })
    hl('DiffviewFilePanelMoved10', { fg = colors.type })
end

return M
