\newlength{\colDist}
\newlength{\rowSpace}
\setlength{\colDist}{2.8cm} 
\setlength{\rowSpace}{1cm}

\begin{tikzpicture}[
    node distance=\rowSpace and \colDist,
    % Styles
    stage/.style={rectangle, draw=gray!80, thick, fill=blue!5, text width=2cm, align=center, minimum height=0.6cm, font=\small\sffamily, rounded corners=2pt},
    engine/.style={diamond, draw=orange!80, thick, fill=orange!10, text width=1.1cm, aspect=1.5, align=center, inner sep=0pt, font=\scriptsize\sffamily},
    output/.style={rectangle, rounded corners=10pt, draw=green!60!black, thick, fill=green!5, text width=2cm, align=center, font=\small\sffamily, minimum height=0.8cm},
    header/.style={font=\footnotesize\bfseries\sffamily, gray!80},
    % Arrow Styles
    basearrow/.style={-Stealth, thick, shorten >=2pt, shorten <=2pt, draw=black!80},
    % Diamond Styles
    base diamond/.style={diamond, draw=black!80, minimum size=8pt, inner sep=0pt, thin, solid},
    splitdiamond/.style={
        base diamond,
        path picture={
            \fill[red!70!black] (path picture bounding box.north) -- (path picture bounding box.west) -- (path picture bounding box.south) -- cycle;
            \fill[blue!60!black] (path picture bounding box.north) -- (path picture bounding box.east) -- (path picture bounding box.south) -- cycle;
        }
    },
    bluediamond/.style={base diamond, fill=blue!60!black}
]

% --- HEADERS ---
\node[header] (h1) {INPUT TYPE};
\node[header, right=\colDist of h1] (h3) {STRATEGY};
\node[header, right=1.3\colDist of h3] (h5) {OUTPUT};

% --- COLUMN 1: Input ---
\node[stage, below=0.2cm of h1] (raw) {Raw Text};
\node[stage, below=\rowSpace of raw] (simp) {Simplified Text};
\node[stage, below=\rowSpace of simp] (trans) {Translation};

% --- COLUMN 2: Strategy ---
\node[stage, below=0.2cm of h3] (dni) {\textbf{DNI}};
\node[stage, below=\rowSpace of dni] (tbi_syl) {\textbf{TBI-SYL}\\ \scriptsize Aristotelian Triples};
\node[stage, below=\rowSpace of tbi_syl] (tbi_fol) {\textbf{TBI-FOL}\\ \scriptsize FOL Formulas};

% --- COLUMN 3: Engines ---
\node[engine, right=0.2\colDist of tbi_syl] (prolog) {Prolog\\KB};
\node[engine, right=0.2\colDist of tbi_fol] (otter) {Otter\\Prover};

% --- COLUMN 4: Output ---
\node[output] at ($(h5) + (0,-1.8)$ ) (val) {Validity Label};
\node[output, below=1cm of val] (prem) {Relevant Premises};

% --- CONNECTIONS ---

% Input Internal
\draw[basearrow] (raw) to node[midway, bluediamond] {} (simp);
\draw[basearrow] (trans) to node[midway, bluediamond] {} (simp);
\draw[basearrow] (raw.west) to [bend right=25] (trans.west);

% To DNI
\draw[basearrow] (raw.east) to [bend left=10] node[midway, bluediamond] {} (dni.west);

% To TBI-SYL
\draw[basearrow] (raw.east) to [bend left=15] node[pos=0.4, splitdiamond] {} (tbi_syl.west);
\draw[basearrow] (simp.east) to node[pos=0.5, splitdiamond] {} (tbi_syl.west);
\draw[basearrow] (trans.east) to [bend right=15] node[pos=0.4, splitdiamond] {} (tbi_syl.west);

% To TBI-FOL
\draw[basearrow] (raw.east) to [bend left=30] node[pos=0.3, splitdiamond] {} (tbi_fol.west);
\draw[basearrow] (simp.east) to [bend left=15] node[pos=0.4, splitdiamond] {} (tbi_fol.west);
\draw[basearrow] (trans.east) to [bend right=10] node[pos=0.6, splitdiamond] {} (tbi_fol.west);

% Strategy to Engines
\draw[basearrow] (tbi_syl) -- (prolog);
\draw[basearrow] (tbi_fol) -- (otter);

% Final Outputs
\draw[basearrow] (dni.east) to [bend left=15] (val.west);
\draw[basearrow] (prolog.east) to [bend left=10] (val.west);
\draw[basearrow] (otter.east) to [bend right=10] (val.west);
\draw[basearrow] (otter.east) to [bend right=25] (prem.west);

% --- LEGEND ---
\node[draw, dashed, gray, font=\scriptsize\sffamily, below=0.3cm of trans, xshift=1cm, inner sep=5pt] (legend) {
    \begin{tabular}{ll}
    \tikz[baseline=-0.5ex]\node[bluediamond, scale=0.8]{}; LLM Prompting & 
    \tikz[baseline=-0.5ex]\node[splitdiamond, scale=0.8]{};LLM + rule based)
    \end{tabular}
};
\end{tikzpicture}

