<UserControl x:Class="SharepointToolbox.Views.Tabs.TransferView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:loc="clr-namespace:SharepointToolbox.Localization">
    <DockPanel Margin="10">
        <!-- Options Panel (Left) -->
        <StackPanel DockPanel.Dock="Left" Width="340" Margin="0,0,10,0">
            <!-- Source -->
            <GroupBox Header="{Binding Source={x:Static loc:TranslationSource.Instance}, Path=[transfer.sourcesite]}"
                      Margin="0,0,0,10">
                <StackPanel Margin="5">
                    <TextBox Text="{Binding SourceSiteUrl, UpdateSourceTrigger=PropertyChanged}"
                             IsReadOnly="True" Margin="0,0,0,5" />
                    <Button Content="{Binding Source={x:Static loc:TranslationSource.Instance}, Path=[transfer.browse]}"
                            Click="BrowseSource_Click" Margin="0,0,0,5" />
                    <TextBlock Text="{Binding SourceLibrary}" FontWeight="SemiBold" />
                    <TextBlock Text="{Binding SourceFolderPath}" Foreground="Gray" />
                </StackPanel>
            </GroupBox>

            <!-- Destination -->
            <GroupBox Header="{Binding Source={x:Static loc:TranslationSource.Instance}, Path=[transfer.destsite]}"
                      Margin="0,0,0,10">
                <StackPanel Margin="5">
                    <TextBox Text="{Binding DestSiteUrl, UpdateSourceTrigger=PropertyChanged}"
                             IsReadOnly="True" Margin="0,0,0,5" />
                    <Button Content="{Binding Source={x:Static loc:TranslationSource.Instance}, Path=[transfer.browse]}"
                            Click="BrowseDest_Click" Margin="0,0,0,5" />
                    <TextBlock Text="{Binding DestLibrary}" FontWeight="SemiBold" />
                    <TextBlock Text="{Binding DestFolderPath}" Foreground="Gray" />
                </StackPanel>
            </GroupBox>

            <!-- Transfer Mode -->
            <GroupBox Header="{Binding Source={x:Static loc:TranslationSource.Instance}, Path=[transfer.mode]}"
                      Margin="0,0,0,10">
                <StackPanel Margin="5">
                    <RadioButton Content="{Binding Source={x:Static loc:TranslationSource.Instance}, Path=[transfer.mode.copy]}"
                                 IsChecked="{Binding TransferMode, Converter={StaticResource EnumBoolConverter}, ConverterParameter=Copy}"
                                 Margin="0,0,0,3" />
                    <RadioButton Content="{Binding Source={x:Static loc:TranslationSource.Instance}, Path=[transfer.mode.move]}"
                                 IsChecked="{Binding TransferMode, Converter={StaticResource EnumBoolConverter}, ConverterParameter=Move}" />
                </StackPanel>
            </GroupBox>

            <!-- Conflict Policy -->
            <GroupBox Header="{Binding Source={x:Static loc:TranslationSource.Instance}, Path=[transfer.conflict]}"
                      Margin="0,0,0,10">
                <ComboBox SelectedIndex="0" x:Name="ConflictCombo" SelectionChanged="ConflictCombo_SelectionChanged">
                    <ComboBoxItem Content="{Binding Source={x:Static loc:TranslationSource.Instance}, Path=[transfer.conflict.skip]}" />
                    <ComboBoxItem Content="{Binding Source={x:Static loc:TranslationSource.Instance}, Path=[transfer.conflict.overwrite]}" />
                    <ComboBoxItem Content="{Binding Source={x:Static loc:TranslationSource.Instance}, Path=[transfer.conflict.rename]}" />
                </ComboBox>
            </GroupBox>

            <!-- Actions -->
            <Button Content="{Binding Source={x:Static loc:TranslationSource.Instance}, Path=[transfer.start]}"
                    Command="{Binding RunCommand}" Margin="0,0,0,5"
                    IsEnabled="{Binding IsRunning, Converter={StaticResource InverseBoolConverter}}" />
            <Button Content="{Binding Source={x:Static loc:TranslationSource.Instance}, Path=[status.cancelled]}"
                    Command="{Binding CancelCommand}"
                    Visibility="{Binding IsRunning, Converter={StaticResource BoolToVisibilityConverter}}" />

            <!-- Progress -->
            <ProgressBar Height="20" Margin="0,10,0,5"
                         Value="{Binding ProgressValue}"
                         Visibility="{Binding IsRunning, Converter={StaticResource BoolToVisibilityConverter}}" />
            <TextBlock Text="{Binding StatusMessage}" TextWrapping="Wrap" />

            <!-- Results -->
            <TextBlock Text="{Binding ResultSummary}" FontWeight="Bold" Margin="0,10,0,5"
                       Visibility="{Binding ResultSummary, Converter={StaticResource StringToVisibilityConverter}}" />
            <Button Content="{Binding Source={x:Static loc:TranslationSource.Instance}, Path=[bulk.exportfailed]}"
                    Command="{Binding ExportFailedCommand}"
                    Visibility="{Binding HasFailures, Converter={StaticResource BoolToVisibilityConverter}}" />
        </StackPanel>

        <!-- Right panel placeholder for future enhancements -->
        <Border />
    </DockPanel>
</UserControl>
