\ProvidesPackage{komageneral}

% Base packages
\usepackage{fontspec}
\usepackage{geometry}
\usepackage{scrlayer-scrpage}
\usepackage{titlesec}
\usepackage{enumitem}
\usepackage{caption}
\usepackage{fancyhdr}
\usepackage{microtype}
\usepackage{biblatex}
\usepackage{graphicx} % Added for including images
\addbibresource{yourbibliography.bib}

% Font settings
\defaultfontfeatures{Ligatures=TeX, RawFeature={+zero, +liga}}
\setmainfont{Noto Serif Regular}[BoldFont={Noto Serif Bold}, ItalicFont={Noto Serif Italic}]
\setsansfont{Noto Sans Regular}[BoldFont={Noto Sans Bold}, ItalicFont={Noto Sans Italic}]
\setmonofont{Noto Sans Mono}[BoldFont={Noto Sans Mono Bold}, Scale=0.8]

% Geometry settings
\geometry{a4paper, left=2cm, right=2cm, top=1.6cm, bottom=1.6cm}

% Header and footer settings with fancyhdr
\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{\nouppercase{\leftmark}}
\fancyhead[R]{\thepage}

% Section formatting with titlesec
\titleformat{\section}{\Large\bfseries\sffamily}{\thesection}{1em}{}
\titleformat{\subsection}{\large\bfseries\sffamily}{\thesubsection}{1em}{}
\titleformat{\subsubsection}{\normalsize\bfseries\sffamily}{\thesubsubsection}{1em}{}

% List formatting with enumitem
\setlist[itemize]{noitemsep, topsep=0pt}
\setlist[enumerate]{noitemsep, topsep=0pt}

% Caption settings
\captionsetup{font=small, labelfont=bf}

% Custom quote environment
\usepackage{etoolbox}
\AtBeginEnvironment{quote}{\itshape}

% Custom formatting commands
\newcommand{\important}[1]{\textbf{#1}}
\newcommand{\code}[1]{\texttt{#1}}

% Title page settings
\newcommand{\TitlePage}[2]{ % #1 - Logo file, #2 - Company name
  \begin{titlepage}
    \centering
    \vspace*{1cm}
    \includegraphics[width=0.3\textwidth]{#1}\par\vspace{1cm}
    {\Huge\bfseries\sffamily #2\par}
    \vspace{2cm}
    {\Large\itshape An Elegant and Professional Document\par}
    \vfill
    {\large \today\par}
  \end{titlepage}
}
