<UserControl x:Class="NexusShell.Views.NexusConsoleView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             Background="Transparent">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <!-- Header -->
        <Border Grid.Row="0" Style="{StaticResource NexusGlassPanelStyle}" Padding="14,10" Margin="0,0,0,10">
            <Border.Effect>
                <DropShadowEffect Color="#00D9FF" BlurRadius="16" ShadowDepth="0" Opacity="0.35"/>
            </Border.Effect>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Nexus Console" FontSize="16" FontWeight="SemiBold"
                               Foreground="{StaticResource NexusTextPrimaryBrush}"/>
                    <Border Width="1" Height="14" Background="#33FFFFFF" Margin="14,0"/>
                    <TextBlock Foreground="{StaticResource NexusAccentCyanBrush}" FontSize="12" VerticalAlignment="Center">
                        <Run Text="Role: "/>
                        <Run Text="{Binding RoleLabel}" FontWeight="SemiBold"/>
                    </TextBlock>
                </StackPanel>
                <TextBlock Grid.Column="2" FontSize="11" VerticalAlignment="Center"
                           Foreground="{StaticResource NexusTextMutedBrush}">
                    <Run Text="Session: "/>
                    <Run Text="{Binding SessionLabel}"/>
                </TextBlock>
            </Grid>
        </Border>

        <!-- Output log -->
        <Border Grid.Row="1" Style="{StaticResource NexusGlassPanelStyle}" Padding="0">
            <Border.Background>
                <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                    <GradientStop Color="#180A1020" Offset="0"/>
                    <GradientStop Color="#22081828" Offset="1"/>
                </LinearGradientBrush>
            </Border.Background>
            <ScrollViewer x:Name="OutputScroll" VerticalScrollBarVisibility="Auto" Padding="14,12">
                <ItemsControl ItemsSource="{Binding OutputLines}">
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding}" FontFamily="Consolas, Cascadia Mono, Courier New"
                                       FontSize="12.5" Foreground="#C8E6FF" TextWrapping="Wrap"
                                       Margin="0,0,0,2"/>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>
            </ScrollViewer>
        </Border>

        <!-- Command input -->
        <Border Grid.Row="2" Style="{StaticResource NexusGlassPanelStyle}" Padding="12,10" Margin="0,10,0,0">
            <Border.Effect>
                <DropShadowEffect Color="#8A4FFF" BlurRadius="12" ShadowDepth="0" Opacity="0.25"/>
            </Border.Effect>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <TextBlock Text="nexus&gt;" FontFamily="Consolas, Cascadia Mono, Courier New"
                           FontSize="13" FontWeight="SemiBold"
                           Foreground="{StaticResource NexusAccentCyanBrush}"
                           VerticalAlignment="Center" Margin="0,0,10,0"/>
                <TextBox x:Name="CommandBox" Grid.Column="1"
                         Text="{Binding CommandInput, UpdateSourceTrigger=PropertyChanged}"
                         FontFamily="Consolas, Cascadia Mono, Courier New"
                         FontSize="13" Foreground="{StaticResource NexusTextPrimaryBrush}"
                         Background="Transparent" BorderThickness="0" CaretBrush="#00D9FF"
                         KeyDown="CommandBox_OnKeyDown"/>
            </Grid>
        </Border>
    </Grid>
</UserControl>
