\documentclass[a4paper,landscape]{article}
\usepackage[utf8]{inputenc}
\usepackage[czech]{babel}
\usepackage{tikz}
\usepackage[margin=1cm]{geometry}
\usetikzlibrary{calc,patterns,decorations.pathmorphing,decorations.markings}

\begin{document}

\title{Půdorys konstrukční haly - Patagonie}
\author{Technická dokumentace}
\date{\today}
\maketitle

\begin{center}
\begin{tikzpicture}[scale=0.4]
    % Grid and coordinates
    \draw[help lines, color=gray!30] (-1,-1) grid (21,15);
    
    % Main building outline - 20.7m x 14.45m
    \draw[very thick, black] (0,0) rectangle (20.7,14.45);
    
    % Section dividers
    % Vertical dividers (West-East)
    \draw[thick, blue] (6.6,0) -- (6.6,14.45);   % Between D and C sections
    \draw[thick, blue] (13.7,0) -- (13.7,14.45); % Between C and B sections (6.6+7.1=13.7)
    
    % Horizontal dividers (North-South) 
    \draw[thick, blue] (0,7.2) -- (20.7,7.2);    % Between sections 1 and 2
    
    % Columns (S1-S12) with exact positions
    % Eastern side columns (top row in diagram)
    \filldraw[red] (0,14.45) circle (0.15) node[above] {S1};       % NE corner
    \filldraw[red] (6.6,14.45) circle (0.15) node[above] {S2};     % Between D2-C2
    \filldraw[red] (13.7,14.45) circle (0.15) node[above] {S3};    % Between C2-B2
    \filldraw[red] (20.7,14.45) circle (0.15) node[above] {S4};    % SE corner
    
    % Middle row columns
    \filldraw[red] (0,7.2) circle (0.15) node[left] {S5};         % North middle
    \filldraw[red] (6.6,7.2) circle (0.15) node[above] {S6};      % Center D/C
    \filldraw[red] (13.7,7.2) circle (0.15) node[above] {S7};     % Center C/B
    \filldraw[red] (20.7,7.2) circle (0.15) node[right] {S8};     % South middle
    
    % Western side columns (bottom row in diagram) - GATE SIDE
    \filldraw[red] (0,0) circle (0.15) node[below] {S9};          % NW corner
    \filldraw[red] (6.6,0) circle (0.15) node[below] {S10};       % Between D1-C1
    \filldraw[red] (13.7,0) circle (0.15) node[below] {S11};      % Between C1-B1
    \filldraw[red] (20.7,0) circle (0.15) node[below] {S12};      % SW corner
    
    % Section labels with dimensions
    \node at (3.3,10.825) {\textbf{D2}};
    \node at (3.3,10.325) {6.6×7.25m};
    \node at (3.3,9.825) {Severovýchodní};
    
    \node at (10.15,10.825) {\textbf{C2}};
    \node at (10.15,10.325) {7.1×7.25m};
    \node at (10.15,9.825) {Středovýchodní};
    
    \node at (17.2,10.825) {\textbf{B2}};
    \node at (17.2,10.325) {7.0×7.25m};
    \node at (17.2,9.825) {Jihovýchodní};
    
    \node at (3.3,3.6) {\textbf{D1}};
    \node at (3.3,3.1) {6.6×7.2m};
    \node at (3.3,2.6) {Severozápadní};
    
    \node at (10.15,3.6) {\textbf{C1}};
    \node at (10.15,3.1) {7.1×7.2m};
    \node at (10.15,2.6) {Středozápadní};
    
    \node at (17.2,3.6) {\textbf{B1}};
    \node at (17.2,3.1) {7.0×7.2m};
    \node at (17.2,2.6) {Jihozápadní};
    
    % Gates on western side (bottom)
    \draw[very thick, green] (1,0) -- (5.6,0);     % Gate D1
    \draw[very thick, green] (7.6,0) -- (12.7,0);  % Gate C1  
    \draw[very thick, green] (14.7,0) -- (19.7,0); % Gate B1
    
    % Gate labels
    \node at (3.3,-0.5) {Vrata D1};
    \node at (10.15,-0.5) {Vrata C1};
    \node at (17.2,-0.5) {Vrata B1};
    
    % External bracing (diagonal lines)
    % Eastern side bracing
    \draw[thick, orange] (0,14.45) -- (-2,16.45);    % S1 NE
    \draw[thick, orange] (6.6,14.45) -- (4.6,16.45);  % S2
    \draw[thick, orange] (13.7,14.45) -- (11.7,16.45); % S3  
    \draw[thick, orange] (20.7,14.45) -- (22.7,16.45); % S4 SE
    
    % Northern side bracing  
    \draw[thick, orange] (0,14.45) -- (-2,16.45);    % S1 (already drawn)
    \draw[thick, orange] (0,7.2) -- (-2,9.2);        % S5
    \draw[thick, orange] (0,0) -- (-2,2);            % S9 (only corner)
    
    % Southern side bracing
    \draw[thick, orange] (20.7,14.45) -- (22.7,16.45); % S4 (already drawn)
    \draw[thick, orange] (20.7,7.2) -- (22.7,9.2);     % S8  
    \draw[thick, orange] (20.7,0) -- (22.7,2);         % S12 (only corner)
    
    % Concrete footings for bracing (squares)
    \draw[thick, brown] (-2.2,16.25) rectangle (-1.8,16.65);   % S1 footing
    \draw[thick, brown] (4.4,16.25) rectangle (4.8,16.65);     % S2 footing
    \draw[thick, brown] (11.5,16.25) rectangle (11.9,16.65);   % S3 footing
    \draw[thick, brown] (22.5,16.25) rectangle (22.9,16.65);   % S4 footing
    \draw[thick, brown] (-2.2,9.0) rectangle (-1.8,9.4);       % S5 footing
    \draw[thick, brown] (22.5,9.0) rectangle (22.9,9.4);       % S8 footing
    \draw[thick, brown] (-2.2,1.8) rectangle (-1.8,2.2);       % S9 footing
    \draw[thick, brown] (22.5,1.8) rectangle (22.9,2.2);       % S12 footing
    
    % Auxiliary support posts (yellow marks on walls)
    \filldraw[yellow] (3.3,14.45) circle (0.08);   % Middle of D2-C2 wall
    \filldraw[yellow] (10.15,14.45) circle (0.08); % Middle of C2-B2 wall
    \filldraw[yellow] (0,10.825) circle (0.08);    % Middle of D1-D2 wall
    \filldraw[yellow] (20.7,10.825) circle (0.08); % Middle of B1-B2 wall
    
    % Dimension lines and labels
    \draw[<->] (0,-2) -- (6.6,-2);
    \node at (3.3,-2.5) {6.6m};
    \draw[<->] (6.6,-2) -- (13.7,-2);
    \node at (10.15,-2.5) {7.1m};
    \draw[<->] (13.7,-2) -- (20.7,-2);
    \node at (17.2,-2.5) {7.0m};
    
    \draw[<->] (-2,0) -- (-2,7.2);
    \node[rotate=90] at (-2.5,3.6) {7.2m};
    \draw[<->] (-2,7.2) -- (-2,14.45);
    \node[rotate=90] at (-2.5,10.825) {7.25m};
    
    % Total dimensions
    \draw[<->] (0,-4) -- (20.7,-4);
    \node at (10.35,-4.5) {\textbf{20.7m celkem}};
    \draw[<->] (-4,0) -- (-4,14.45);
    \node[rotate=90] at (-4.5,7.225) {\textbf{14.45m celkem}};
    
    % Compass
    \draw[->, very thick] (18,1) -- (18,2.5);
    \node at (18,2.8) {S};
    \draw[->, very thick] (18,1) -- (19.5,1);
    \node at (19.8,1) {V};
    \node at (17.2,0.5) {Kompas};
    
    % Legend
    \node[anchor=north west] at (-1,17) {
        \begin{minipage}{8cm}
            \textbf{Legenda:}\\
            \textcolor{red}{●} Sloupy (S1-S12)\\
            \textcolor{blue}{—} Dělící linie sekcí\\
            \textcolor{green}{—} Vrata (pouze západní strana)\\
            \textcolor{orange}{—} Vnější diagonální zavětrování 45°\\
            \textcolor{brown}{▢} Betonové sokly (50×50×80cm)\\
            \textcolor{yellow}{●} Pomocné sloupky\\
        \end{minipage}
    };
    
\end{tikzpicture}
\end{center}

\vfill

\begin{center}
\textbf{Poznámky:}\\
\begin{tabular}{|l|l|}
\hline
Celkové rozměry & 20.7m × 14.45m \\
\hline
Orientace & Východ nahoře, západ dole (vrata) \\
\hline
Sekce & 6 kvadrantů (D1,D2,C1,C2,B1,B2) \\
\hline
Sloupy & 12 hlavních sloupů (S1-S12) \\
\hline
Zavětrování & Diagonály 45° na 3 stranách (bez vrat) \\
\hline
Betonové sokly & 50×50×80cm pro diagonální kotvy \\
\hline
\end{tabular}
\end{center}

\end{document}