<?xml version="1.0" encoding="utf-8"?>
<ContentDialog
    x:Class="TeamsISO.App.WinUI.Views.HelpDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Keyboard shortcuts"
    PrimaryButtonText="Close"
    DefaultButton="Primary"
    Background="{ThemeResource BgElevated}"
    BorderBrush="{ThemeResource BorderStrong}">

    <ScrollViewer MaxHeight="540" VerticalScrollBarVisibility="Auto">
        <StackPanel Spacing="6" MinWidth="420">

            <TextBlock Style="{StaticResource TextCaption}"
                       Text="GLOBAL"
                       Margin="0,4,0,4"/>
            <Grid Padding="0,4">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="180"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" Text="F1" Style="{StaticResource TextMono}"/>
                <TextBlock Grid.Column="1" Text="Open this help dialog" Style="{StaticResource TextBody}"/>
            </Grid>
            <Grid Padding="0,4">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="180"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" Text="Ctrl + K" Style="{StaticResource TextMono}"/>
                <TextBlock Grid.Column="1" Text="Open the command palette" Style="{StaticResource TextBody}"/>
            </Grid>
            <Grid Padding="0,4">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="180"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" Text="Ctrl + Shift + S" Style="{StaticResource TextMono}"/>
                <TextBlock Grid.Column="1" Text="Stop every running ISO (panic)" Style="{StaticResource TextBody}"/>
            </Grid>
            <Grid Padding="0,4">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="180"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" Text="Ctrl + R" Style="{StaticResource TextMono}"/>
                <TextBlock Grid.Column="1" Text="Refresh NDI discovery" Style="{StaticResource TextBody}"/>
            </Grid>
            <Grid Padding="0,4">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="180"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" Text="Ctrl + M" Style="{StaticResource TextMono}"/>
                <TextBlock Grid.Column="1" Text="Drop a recording marker" Style="{StaticResource TextBody}"/>
            </Grid>

            <TextBlock Style="{StaticResource TextCaption}"
                       Text="PARTICIPANTS"
                       Margin="0,16,0,4"/>
            <Grid Padding="0,4">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="180"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" Text="NumPad 1-9 / 1-9" Style="{StaticResource TextMono}"/>
                <TextBlock Grid.Column="1" Text="Toggle ISO for the Nth visible participant" Style="{StaticResource TextBody}"/>
            </Grid>
            <Grid Padding="0,4">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="180"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" Text="Right-click row" Style="{StaticResource TextMono}"/>
                <TextBlock Grid.Column="1" Text="Open preview, rename output, restart pipeline" Style="{StaticResource TextBody}"/>
            </Grid>

            <TextBlock Style="{StaticResource TextCaption}"
                       Text="LOOK"
                       Margin="0,16,0,4"/>
            <Grid Padding="0,4">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="180"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" Text="Theme toggle" Style="{StaticResource TextMono}"/>
                <TextBlock Grid.Column="1" Text="Title-bar sun/moon icon swaps dark / light" Style="{StaticResource TextBody}"/>
            </Grid>
            <Grid Padding="0,4">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="180"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" Text="Active speaker" Style="{StaticResource TextMono}"/>
                <TextBlock Grid.Column="1" Text="Row highlights with a cyan left border" Style="{StaticResource TextBody}"/>
            </Grid>

            <TextBlock Style="{StaticResource TextCaption}"
                       Text="CONTROL SURFACE"
                       Margin="0,16,0,4"/>
            <TextBlock Style="{StaticResource TextBody}"
                       TextWrapping="Wrap">
                External control via REST + WebSocket on 127.0.0.1:9755 and OSC on UDP 127.0.0.1:9000.
                Self-contained HTML panel at /ui. Use Bitfocus Companion or TouchOSC. See
                docs/CONTROL-SURFACE.md for the command vocabulary.
            </TextBlock>
        </StackPanel>
    </ScrollViewer>
</ContentDialog>
