#pragma once

#include "vertex_engine/utils/utils.hpp" // IWYU pragma: keep
#include "icons.hpp" // IWYU pragma: keep
#include "fonts.hpp"

namespace VE::style
{
  inline void init()
  {
    /* use this - https://www.unknowncheats.me/forum/c-and-c-/189635-imgui-style-settings.html */
    ImGuiStyle& st = ImGui::GetStyle();

    st.WindowPadding                         = ImVec2(5.0f, 5.0f);
    st.WindowRounding                        = 0.0f;
    st.FramePadding                          = ImVec2(5.0f, 5.0f);
    st.FrameRounding                         = 0.0f;
    st.ItemSpacing                           = ImVec2(8.0f, 8.0f);
    st.ItemInnerSpacing                      = ImVec2(8.0f, 6.0f);
    st.IndentSpacing                         = 25.0f;
    st.ScrollbarSize                         = 12.0f;
    st.ScrollbarRounding                     = 0.0f;
    st.GrabMinSize                           = 5.0f;
    st.GrabRounding                          = 0.0f;
    st.TabRounding                           = 0.0f;
    st.WindowBorderSize                      = 0.0f;
    st.ChildRounding                         = 0.0f;
    st.PopupRounding                         = 0.0f;
    st.PopupBorderSize                       = 0.0f;
    st.WindowMenuButtonPosition              = ImGuiDir_None;

    /* tab */
    st.Colors[ImGuiCol_Tab]                  = ImVec4(0.10f, 0.09f, 0.12f, 1.00f);
    st.Colors[ImGuiCol_TabHovered]           = ImVec4(0.13f, 0.12f, 0.15f, 1.00f);
    st.Colors[ImGuiCol_TabActive]            = ImVec4(0.20f, 0.19f, 0.21f, 1.00f);

    /* title */
    st.Colors[ImGuiCol_TitleBg]              = ImVec4(0.10f, 0.09f, 0.12f, 1.00f);
    st.Colors[ImGuiCol_TitleBgCollapsed]     = ImVec4(0.10f, 0.09f, 0.12f, 1.00f);
    st.Colors[ImGuiCol_TitleBgActive]        = ImVec4(0.07f, 0.07f, 0.09f, 1.00f);

    st.Colors[ImGuiCol_Text]                 = ImVec4(0.80f, 0.80f, 0.83f, 1.00f);
    st.Colors[ImGuiCol_TextDisabled]         = ImVec4(0.13f, 0.12f, 0.15f, 1.00f);
    st.Colors[ImGuiCol_WindowBg]             = ImVec4(0.06f, 0.05f, 0.07f, 1.00f);
    st.Colors[ImGuiCol_ChildBg]              = ImVec4(0.06f, 0.05f, 0.07f, 1.00f);
    st.Colors[ImGuiCol_PopupBg]              = ImVec4(0.07f, 0.07f, 0.09f, 1.00f);
    st.Colors[ImGuiCol_Border]               = ImVec4(0.80f, 0.80f, 0.83f, 0.88f);
    st.Colors[ImGuiCol_BorderShadow]         = ImVec4(0.92f, 0.91f, 0.88f, 0.00f);
    st.Colors[ImGuiCol_FrameBg]              = ImVec4(0.10f, 0.09f, 0.12f, 1.00f);
    st.Colors[ImGuiCol_FrameBgHovered]       = ImVec4(0.13f, 0.12f, 0.15f, 1.00f);
    st.Colors[ImGuiCol_FrameBgActive]        = ImVec4(0.13f, 0.12f, 0.15f, 1.00f);

    // st.Colors[ImGuiCol_MenuBarBg]            = ImVec4(0.07f, 0.07f, 0.09f, 1.00f);
    // st.Colors[ImGuiCol_MenuBarBg]            = ImVec4(0.06f, 0.05f, 0.07f, 1.00f);
    st.Colors[ImGuiCol_MenuBarBg]            = ImVec4(0.10f, 0.09f, 0.12f, 1.00f);

    st.Colors[ImGuiCol_ScrollbarBg]          = ImVec4(0.10f, 0.09f, 0.12f, 1.00f);
    st.Colors[ImGuiCol_ScrollbarGrab]        = ImVec4(0.80f, 0.80f, 0.83f, 0.31f);
    st.Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.13f, 0.12f, 0.15f, 1.00f);
    st.Colors[ImGuiCol_ScrollbarGrabActive]  = ImVec4(0.06f, 0.05f, 0.07f, 1.00f);
    st.Colors[ImGuiCol_CheckMark]            = ImVec4(0.80f, 0.80f, 0.83f, 0.31f);
    st.Colors[ImGuiCol_SliderGrab]           = ImVec4(0.80f, 0.80f, 0.83f, 0.31f);
    st.Colors[ImGuiCol_SliderGrabActive]     = ImVec4(0.06f, 0.05f, 0.07f, 1.00f);
    st.Colors[ImGuiCol_Button]               = ImVec4(0.10f, 0.09f, 0.12f, 1.00f);
    st.Colors[ImGuiCol_ButtonHovered]        = ImVec4(0.13f, 0.12f, 0.15f, 1.00f);
    st.Colors[ImGuiCol_ButtonActive]         = ImVec4(0.12f, 0.11f, 0.14f, 1.00f);
    st.Colors[ImGuiCol_Header]               = ImVec4(0.13f, 0.12f, 0.15f, 1.00f);
    st.Colors[ImGuiCol_HeaderActive]         = ImVec4(0.06f, 0.05f, 0.07f, 1.00f);
    st.Colors[ImGuiCol_Separator]            = ImVec4(0.13f, 0.12f, 0.15f, 1.00f);
    st.Colors[ImGuiCol_SeparatorHovered]     = ImVec4(0.13f, 0.12f, 0.15f, 1.00f);
    st.Colors[ImGuiCol_SeparatorActive]      = ImVec4(0.13f, 0.12f, 0.15f, 1.00f);
    st.Colors[ImGuiCol_ResizeGrip]           = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
    st.Colors[ImGuiCol_ResizeGripHovered]    = ImVec4(0.13f, 0.12f, 0.15f, 1.00f);
    st.Colors[ImGuiCol_ResizeGripActive]     = ImVec4(0.06f, 0.05f, 0.07f, 1.00f);
    st.Colors[ImGuiCol_PlotLines]            = ImVec4(0.40f, 0.39f, 0.38f, 0.63f);
    st.Colors[ImGuiCol_PlotLinesHovered]     = ImVec4(0.25f, 1.00f, 0.00f, 1.00f);
    st.Colors[ImGuiCol_PlotHistogram]        = ImVec4(0.40f, 0.39f, 0.38f, 0.63f);
    st.Colors[ImGuiCol_PlotHistogramHovered] = ImVec4(0.25f, 1.00f, 0.00f, 1.00f);
    st.Colors[ImGuiCol_TextSelectedBg]       = ImVec4(0.25f, 1.00f, 0.00f, 0.43f);
    st.Colors[ImGuiCol_ModalWindowDimBg]     = ImVec4(1.00f, 0.98f, 0.95f, 0.73f);
    st.Colors[ImGuiCol_HeaderHovered]        = ImVec4(0.13f, 0.12f, 0.15f, 1.00f);

    fonts::init();
  };
};
