<Window x:Class="dealer.VehicleDetailWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:dealer"
    mc:Ignorable="d"
    Title="Detail vozidla" Height="600" Width="500"
    WindowStartupLocation="CenterOwner"
    ResizeMode="NoResize">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <ScrollViewer Grid.Row="0" VerticalScrollBarVisibility="Auto">
            <StackPanel Margin="20">
                <TextBlock Text="Detail vozidla"
                    FontSize="20"
                    FontWeight="Bold"
                    Margin="0,0,0,20"
                    HorizontalAlignment="Center" />

                <!-- Fotografie -->
                <Border BorderBrush="Gray" BorderThickness="1" Margin="0,0,0,20" HorizontalAlignment="Center">
                    <Image Name="VehicleImage"
                        Width="300"
                        Height="200"
                        Stretch="Uniform" />
                </Border>
                <TextBlock Name="NoPhotoTextBlock"
                    Text="Zadna fotografie"
                    FontStyle="Italic"
                    Foreground="Gray"
                    HorizontalAlignment="Center"
                    Margin="0,0,0,20"
                    Visibility="Collapsed" />

                <!-- SPZ -->
                <Grid Margin="0,5">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="120" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="SPZ:" FontSize="14" FontWeight="SemiBold" />
                    <TextBlock Name="SpzTextBlock" Grid.Column="1" FontSize="14" />
                </Grid>

                <!-- Znacka -->
                <Grid Margin="0,5">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="120" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="Znacka:" FontSize="14" FontWeight="SemiBold" />
                    <TextBlock Name="ZnackaTextBlock" Grid.Column="1" FontSize="14" />
                </Grid>

                <!-- Model -->
                <Grid Margin="0,5">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="120" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="Model:" FontSize="14" FontWeight="SemiBold" />
                    <TextBlock Name="ModelTextBlock" Grid.Column="1" FontSize="14" />
                </Grid>

                <!-- Barva -->
                <Grid Margin="0,5">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="120" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="Barva:" FontSize="14" FontWeight="SemiBold" />
                    <StackPanel Grid.Column="1" Orientation="Horizontal">
                        <Border Name="ColorPreviewBorder"
                            Width="20"
                            Height="20"
                            BorderBrush="Gray"
                            BorderThickness="1"
                            Margin="0,0,8,0" />
                        <TextBlock Name="ColorTextBlock" FontSize="14" VerticalAlignment="Center" />
                    </StackPanel>
                </Grid>

                <!-- Rok vyroby -->
                <Grid Margin="0,5">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="120" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="Rok vyroby:" FontSize="14" FontWeight="SemiBold" />
                    <TextBlock Name="YearTextBlock" Grid.Column="1" FontSize="14" />
                </Grid>

                <!-- Palivo -->
                <Grid Margin="0,5">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="120" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="Palivo:" FontSize="14" FontWeight="SemiBold" />
                    <TextBlock Name="PalivoTextBlock" Grid.Column="1" FontSize="14" />
                </Grid>

                <!-- Najete km -->
                <Grid Margin="0,5">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="120" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="Najete km:" FontSize="14" FontWeight="SemiBold" />
                    <TextBlock Name="MileageTextBlock" Grid.Column="1" FontSize="14" />
                </Grid>

                <!-- Cena -->
                <Grid Margin="0,5">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="120" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="Cena:" FontSize="14" FontWeight="SemiBold" />
                    <TextBlock Name="PriceTextBlock" Grid.Column="1" FontSize="14" />
                </Grid>

                <Separator Margin="0,15,0,15" />

                <TextBlock Text="Vlastnik" FontSize="16" FontWeight="Bold" Margin="0,0,0,10" />

                <!-- Vlastnik Jmeno -->
                <Grid Margin="0,5">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="120" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="Jmeno a Prijmeni:" FontSize="14" FontWeight="SemiBold" />
                    <TextBlock Name="OwnerNameTextBlock" Grid.Column="1" FontSize="14" />
                </Grid>

                <!-- Adresa -->
                <Grid Margin="0,5">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="120" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="Adresa:" FontSize="14" FontWeight="SemiBold" />
                    <TextBlock Name="AddressTextBlock" Grid.Column="1" FontSize="14" TextWrapping="Wrap" />
                </Grid>

                <!-- Telefon -->
                <Grid Margin="0,5">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="120" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="Telefon:" FontSize="14" FontWeight="SemiBold" />
                    <TextBlock Name="PhoneTextBlock" Grid.Column="1" FontSize="14" />
                </Grid>

                <!-- Email -->
                <Grid Margin="0,5">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="120" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="Email:" FontSize="14" FontWeight="SemiBold" />
                    <TextBlock Name="EmailTextBlock" Grid.Column="1" FontSize="14" />
                </Grid>
            </StackPanel>
        </ScrollViewer>

        <Border Grid.Row="1"
            BorderBrush="LightGray"
            BorderThickness="0,1,0,0"
            Background="WhiteSmoke">
            <StackPanel Orientation="Horizontal"
                HorizontalAlignment="Center"
                Margin="0,15">
                <Button Name="EditButton"
                    Content="Upravit"
                    Width="100"
                    Height="35"
                    Margin="5"
                    FontSize="14"
                    Click="EditButton_Click" />
                <Button Name="DeleteButton"
                    Content="Smazat"
                    Width="100"
                    Height="35"
                    Margin="5"
                    FontSize="14"
                    Click="DeleteButton_Click" />
                <Button Name="CloseButton"
                    Content="Zavrit"
                    Width="100"
                    Height="35"
                    Margin="5"
                    FontSize="14"
                    Click="CloseButton_Click" />
            </StackPanel>
        </Border>
    </Grid>
</Window>


