{
  config,
  lib,
  namespace,
  ...
}:
with lib;
let
  cfg = config.${namespace}.programs.wofi;
in
{
  imports = [ ./options.nix ];

  config = mkIf cfg.enable {
    programs.wofi = {
      enable = true;
      style = ''
        * {
          font-family: "${cfg.fontName}", monospace;
          font-size: 14px;
        }

        /* Window */
        window {
          margin: 0px;
          padding: 10px;
          border: 0.16em solid ${config.lib.stylix.colors.base0E};
          border-radius: 0.1em;
          background-color: ${config.lib.stylix.colors.base00};
        }

        /* Inner Box */
        #inner-box {
          margin: 5px;
          padding: 10px;
          border: none;
          background-color: ${config.lib.stylix.colors.base00};
        }

        /* Outer Box */
        #outer-box {
          margin: 5px;
          padding: 10px;
          border: none;
          background-color: ${config.lib.stylix.colors.base00};
        }

        /* Scroll */
        #scroll {
          margin: 0px;
          padding: 10px;
          border: none;
          background-color: ${config.lib.stylix.colors.base00};
        }

        /* Input */
        #input {
          margin: 5px 20px;
          padding: 10px;
          border: none;
          border-radius: 0.1em;
          color: ${config.lib.stylix.colors.base06};
          background-color: ${config.lib.stylix.colors.base00};
        }

        #input image {
          border: none;
          color: ${config.lib.stylix.colors.base08};
        }

        #input * {
          outline: 4px solid ${config.lib.stylix.colors.base08}!important;
        }

        /* Text */
        #text {
          margin: 5px;
          border: none;
          color: ${config.lib.stylix.colors.base06};
        }

        #entry {
          background-color: ${config.lib.stylix.colors.base00};
        }

        #entry arrow {
          border: none;
          color: ${config.lib.stylix.colors.base0E};
        }

        /* Selected Entry */
        #entry:selected {
          border: 0.11em solid ${config.lib.stylix.colors.base0E};
        }

        #entry:selected #text {
          color: ${config.lib.stylix.colors.base0C};
        }

        #entry:drop(active) {
          background-color: ${config.lib.stylix.colors.base0E}!important;
        }
      '';
    };
  };
}
