<Window x:Class="MossyUpdater.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:MossyUpdater"
        Title="MossyUpdater" Height="450" Width="550" MinHeight="400" MinWidth="500" ResizeMode="CanResize"
        Icon="pack://application:,,,/MossyUpdater;component/favicon.ico">
    <Grid Margin="10">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <!-- 0: label -->
            <RowDefinition Height="Auto"/>
            <!-- 1: URL textbox -->
            <RowDefinition Height="Auto"/>
            <!-- 2: folder picker -->
            <RowDefinition Height="Auto"/>
            <!-- 3: filename -->
            <RowDefinition Height="Auto"/>
            <!-- 4: update status -->
            <RowDefinition Height="Auto"/>
            <!-- 5: download buttons -->
            <RowDefinition Height="Auto"/>
            <!-- 6: progress bar -->
            <RowDefinition Height="Auto"/>
            <!-- 7: status text -->
            <RowDefinition Height="*"/>
            <!-- 8: image (fills rest) -->
        </Grid.RowDefinitions>

        <!-- 0 -->
        <TextBlock Text="MosswartMassacre URL to DLL:" Grid.Row="0" Margin="0,0,0,5"/>

        <!-- 1 -->
        <TextBox Grid.Row="1"
                 Height="25"
                 Margin="0,0,0,10"
                 Text="{Binding Url, UpdateSourceTrigger=PropertyChanged}"
                 IsEnabled="{Binding CanInteract}"/>

        <!-- 2 -->
        <StackPanel Grid.Row="2" Orientation="Horizontal" Margin="0,0,0,10">
            <TextBox Width="350"
                     Height="25"
                     Margin="0,0,5,0"
                     Text="{Binding Folder, UpdateSourceTrigger=PropertyChanged}"
                     IsEnabled="{Binding CanInteract}"/>
            <Button Content="Browse"
                    Width="75"
                    Command="{Binding BrowseCommand}"
                    IsEnabled="{Binding CanInteract}"/>
        </StackPanel>

        <!-- 3 -->
        <StackPanel Grid.Row="3" Orientation="Horizontal" Margin="0,0,0,10">
            <TextBlock Text="Filename:"
                       VerticalAlignment="Center"
                       Margin="0,0,5,0"/>
            <TextBox Width="200"
                     Text="{Binding Filename, UpdateSourceTrigger=PropertyChanged}"
                     IsEnabled="{Binding CanInteract}"/>
            <Button Content="Check Updates"
                    Width="100"
                    Margin="10,0,0,0"
                    Command="{Binding CheckUpdatesCommand}"
                    IsEnabled="{Binding CanInteract}"/>
        </StackPanel>

        <!-- 4 -->
        <TextBlock Grid.Row="4"
                   Text="{Binding UpdateStatus}"
                   Margin="0,0,0,10"/>

        <!-- 5 -->
        <StackPanel Grid.Row="5" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,0,10">
            <Button Content="Download &amp; Unblock"
                    Width="150"
                    Margin="0,0,10,0"
                    Command="{Binding DownloadCommand}"/>
            <Button Content="Cancel"
                    Width="75"
                    Command="{Binding CancelCommand}"/>
        </StackPanel>

        <!-- 6 -->
        <ProgressBar Grid.Row="6"
                     Height="20"
                     Margin="0,0,0,10"
                     Value="{Binding ProgressValue}"/>

        <!-- 7 -->
        <TextBlock Grid.Row="7"
                   Text="{Binding StatusMessage}"
                   Margin="0,0,0,10"
                   TextWrapping="Wrap"
                   Foreground="{Binding StatusColor}"/>

        <!-- 8: Quote display with image -->
        <Grid Grid.Row="8" Margin="0,10,0,0">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            
            <!-- Quote -->
            <TextBlock Grid.Row="0"
                       Text="{Binding CurrentQuote}"
                       Opacity="{Binding QuoteOpacity}"
                       TextWrapping="Wrap"
                       FontStyle="Italic"
                       FontSize="12"
                       Foreground="DarkSlateGray"
                       HorizontalAlignment="Center"
                       TextAlignment="Center"
                       Margin="10,0,10,10"/>
            
            <!-- Image -->
            <Image Grid.Row="1"
                   Source="pack://application:,,,/MossyUpdater;component/Mosswart_Mask_Live.png"
                   Stretch="Uniform"
                   HorizontalAlignment="Center"
                   VerticalAlignment="Top"
                   MaxHeight="100"/>
        </Grid>
    </Grid>
</Window>
