<Window x:Class="ReAct_PME.ParametresFactures"
        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:ReAct_PME"
        mc:Ignorable="d"
        Title="Parametres Factures PDF to XML" Height="250" Width="500" Background="#FFF0F0F0">
    <Window.Resources>
        <DropShadowEffect x:Key="ShadowEffect"
                  BlurRadius="8"
                  ShadowDepth="2"
                  Opacity="0.4"
                  Direction="270"/>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="60"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Popup x:Name="ToastPopup"
               Placement="Bottom"
               PlacementTarget="{Binding ElementName=MainGrid}" 
               StaysOpen="False"
               AllowsTransparency="True"
               PopupAnimation="Fade"
               HorizontalOffset="0"
               VerticalOffset="-30">

            <Border Background="#FF323232"
                    CornerRadius="8"
                    Padding="16"
                    Margin="10"
                    Effect="{DynamicResource ShadowEffect}">
                <TextBlock x:Name="ToastMessage"
                           Foreground="White"
                           FontWeight="Bold"
                           FontSize="14"
                           TextWrapping="Wrap"
                           MaxWidth="300"/>
            </Border>
        </Popup>

        <TextBlock Text="Répertoire PDF :" Grid.Row="0" VerticalAlignment="Center" Margin="5,0,0,0"/>
        <TextBox Text="{Binding InputPath, Mode=TwoWay}"  MaxLength="255"  Grid.Row="0" Margin="100,0,5,2"/>

        <TextBlock Text="Répertoire XML :" Grid.Row="1" VerticalAlignment="Center" Margin="5,0,0,0"/>
        <TextBox Text="{Binding OutputPath, Mode=TwoWay}" MaxLength="255" Grid.Row="1" Margin="100,0,5,2"  />

        <CheckBox x:Name="ChkApiExterne" Content="API Externe ?" Grid.Row="2" Margin="100,0,0,0" IsChecked="{Binding IsApiExterne}" Style="{DynamicResource SimpleCheckBox}" Width="100" HorizontalAlignment="Left" ToolTip="Vous faites appel à une API Externe (ex : OpenAI pour ChatGPT)" />

        <TextBlock x:Name="Message" Text="..." Grid.Row="3" VerticalAlignment="Center" Margin="5,0,0,0"/>

        <StackPanel Orientation="Vertical" Grid.Row="4" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,0,0">
            <Button 
                x:Name="Btn_Traitement"
                Content="Lancer le traitement" Width="120" Margin="5" 
                Style="{DynamicResource ButtonStyle}" 
                Click="Button_Click_2"
                />
            <Button 
                x:Name="Btn_Save"
                Content="Sauvegarder" Width="120" Margin="5" 
                Style="{DynamicResource ButtonStyle}" 
                Click="Button_Click"
                />
            <Button Content="Fermer" Width="120" Margin="5" 
                Style="{DynamicResource ButtonStyle}" 
                Click="Button_Click_1"  />
        </StackPanel>
    </Grid>
</Window>