<Window x:Class="TeamsISO.App.AboutWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:shell="clr-namespace:System.Windows.Shell;assembly=PresentationFramework"
        Title="About TeamsISO"
        Icon="/Assets/teamsiso.ico"
        Width="460" Height="500"
        WindowStartupLocation="CenterOwner"
        WindowStyle="None"
        ResizeMode="NoResize"
        Background="{DynamicResource Wd.Canvas}"
        UseLayoutRounding="True"
        TextOptions.TextFormattingMode="Ideal"
        TextOptions.TextRenderingMode="ClearType">

    <shell:WindowChrome.WindowChrome>
        <shell:WindowChrome
            CaptionHeight="32"
            ResizeBorderThickness="0"
            CornerRadius="0"
            GlassFrameThickness="0"
            UseAeroCaptionButtons="False"/>
    </shell:WindowChrome.WindowChrome>

    <Border BorderBrush="{DynamicResource Wd.Border}" BorderThickness="1">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <!-- Caption -->
            <Grid Grid.Row="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <TextBlock Text="About TeamsISO"
                           Style="{StaticResource Wd.Text.Caption}"
                           Margin="20,12,0,0"
                           VerticalAlignment="Center"/>
                <Button Grid.Column="1"
                        Style="{StaticResource Wd.Button.CaptionClose}"
                        Click="OnClose"
                        shell:WindowChrome.IsHitTestVisibleInChrome="True">
                    <Path Data="M 0,0 L 10,10 M 10,0 L 0,10"
                          Stroke="{DynamicResource Wd.Text.Primary}"
                          StrokeThickness="1.2"
                          Width="10" Height="10"
                          Stretch="None"/>
                </Button>
            </Grid>

            <!-- Body -->
            <StackPanel Grid.Row="1"
                        Margin="32,16,32,16"
                        VerticalAlignment="Top">
                <Image Source="/Assets/dragon-mark.png"
                       Width="80" Height="80"
                       HorizontalAlignment="Center"
                       Margin="0,0,0,16"
                       RenderOptions.BitmapScalingMode="HighQuality"/>

                <TextBlock Text="TeamsISO"
                           Style="{StaticResource Wd.Text.Title}"
                           FontSize="28"
                           HorizontalAlignment="Center"/>

                <TextBlock Text="Per-participant NDI ISO Controller for Microsoft Teams"
                           Style="{StaticResource Wd.Text.Subtle}"
                           Foreground="{DynamicResource Wd.Text.Tertiary}"
                           HorizontalAlignment="Center"
                           TextAlignment="Center"
                           Margin="0,4,0,0"
                           TextWrapping="Wrap"/>

                <Border Style="{StaticResource Wd.Card}"
                        Margin="0,20,0,0"
                        Padding="16">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>

                        <TextBlock Grid.Row="0" Grid.Column="0" Text="Version"
                                   Style="{StaticResource Wd.Text.Subtle}"
                                   Foreground="{DynamicResource Wd.Text.Tertiary}"
                                   Margin="0,0,16,4"/>
                        <TextBlock Grid.Row="0" Grid.Column="1"
                                   x:Name="VersionText"
                                   Style="{StaticResource Wd.Text.Mono}"
                                   FontSize="11"
                                   Foreground="{DynamicResource Wd.Text.Primary}"
                                   TextWrapping="Wrap"
                                   Margin="0,0,0,4"/>

                        <TextBlock Grid.Row="1" Grid.Column="0" Text=".NET"
                                   Style="{StaticResource Wd.Text.Subtle}"
                                   Foreground="{DynamicResource Wd.Text.Tertiary}"
                                   Margin="0,0,16,4"/>
                        <TextBlock Grid.Row="1" Grid.Column="1"
                                   x:Name="RuntimeText"
                                   Style="{StaticResource Wd.Text.Mono}"
                                   FontSize="11"
                                   Foreground="{DynamicResource Wd.Text.Primary}"
                                   Margin="0,0,0,4"/>

                        <TextBlock Grid.Row="2" Grid.Column="0" Text="OS"
                                   Style="{StaticResource Wd.Text.Subtle}"
                                   Foreground="{DynamicResource Wd.Text.Tertiary}"
                                   Margin="0,0,16,4"/>
                        <TextBlock Grid.Row="2" Grid.Column="1"
                                   x:Name="OsText"
                                   Style="{StaticResource Wd.Text.Mono}"
                                   FontSize="11"
                                   Foreground="{DynamicResource Wd.Text.Primary}"
                                   Margin="0,0,0,4"/>

                        <TextBlock Grid.Row="3" Grid.Column="0" Text="NDI runtime"
                                   Style="{StaticResource Wd.Text.Subtle}"
                                   Foreground="{DynamicResource Wd.Text.Tertiary}"
                                   Margin="0,0,16,0"/>
                        <TextBlock Grid.Row="3" Grid.Column="1"
                                   x:Name="NdiText"
                                   Style="{StaticResource Wd.Text.Mono}"
                                   FontSize="11"
                                   Foreground="{DynamicResource Wd.Text.Primary}"
                                   TextWrapping="Wrap"/>
                    </Grid>
                </Border>

                <!-- Quick-jump shortcuts to the data directories -->
                <StackPanel Orientation="Horizontal"
                            HorizontalAlignment="Center"
                            Margin="0,12,0,0">
                    <Button Style="{StaticResource Wd.Button.Ghost}"
                            Content="Logs"
                            Click="OnOpenLogs"
                            Padding="14,6"
                            Margin="0,0,8,0"
                            ToolTip="Open %LOCALAPPDATA%\TeamsISO\Logs in Explorer"/>
                    <Button Style="{StaticResource Wd.Button.Ghost}"
                            Content="Recordings"
                            Click="OnOpenRecordings"
                            Padding="14,6"
                            Margin="0,0,8,0"
                            ToolTip="Open the configured recording directory in Explorer (defaults to %USERPROFILE%\Videos\TeamsISO)"/>
                    <Button Style="{StaticResource Wd.Button.Ghost}"
                            Content="Notes"
                            Click="OnOpenNotes"
                            Padding="14,6"
                            ToolTip="Open %LOCALAPPDATA%\TeamsISO\Notes in Explorer"/>
                </StackPanel>
            </StackPanel>

            <!-- Footer -->
            <Border Grid.Row="2"
                    BorderBrush="{DynamicResource Wd.Border}"
                    BorderThickness="0,1,0,0"
                    Padding="20,12">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    <TextBlock Style="{StaticResource Wd.Text.Mono}"
                               Foreground="{DynamicResource Wd.Text.Tertiary}"
                               VerticalAlignment="Center">
                        <Hyperlink x:Name="WebsiteLink"
                                   Foreground="{DynamicResource Wd.Accent.Cyan}"
                                   TextDecorations="None"
                                   Click="OnWebsiteClick">
                            wilddragon.net
                        </Hyperlink>
                        <Run Text=" · © Wild Dragon LLC"/>
                    </TextBlock>
                    <StackPanel Grid.Column="1" Orientation="Horizontal">
                        <Button Style="{StaticResource Wd.Button.Ghost}"
                                Content="Export diagnostics"
                                Click="OnExportDiagnostics"
                                MinWidth="150"
                                Margin="0,0,8,0"
                                ToolTip="Bundle logs + config + presets into a zip in your Downloads folder. Attach the zip to a bug report."/>
                        <Button Style="{StaticResource Wd.Button.Ghost}"
                                Content="Check for updates"
                                Click="OnCheckUpdate"
                                x:Name="UpdateButton"
                                MinWidth="140"
                                Margin="0,0,8,0"
                                ToolTip="Ask forge.wilddragon.net whether a newer release tag exists than the one you're running."/>
                        <Button Style="{StaticResource Wd.Button.Ghost}"
                                Content="Show welcome"
                                Click="OnShowOnboarding"
                                MinWidth="120"
                                Margin="0,0,8,0"
                                ToolTip="Re-open the first-launch welcome dialog with the setup checklist."/>
                        <Button Style="{StaticResource Wd.Button.Ghost}"
                                Content="Close"
                                Click="OnClose"
                                MinWidth="80"/>
                    </StackPanel>
                </Grid>
            </Border>
        </Grid>
    </Border>
</Window>
