<UserControl x:Class="AxCopilot.Views.Controls.AgentInputArea"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <!-- Phase 17-UI-E: 멀티기능 입력 영역 (Claude.ai + Codex 스타일)
         IsToolbarOnly=True 시 Row 0 (@ / 스킬 / 첨부)만 표시.
         ChatWindow에서는 툴바 행만 사용하여 기존 InputBox 위에 배치. -->

    <Border x:Name="OuterBorder"
            Background="{DynamicResource LauncherBackground}"
            BorderBrush="{DynamicResource BorderColor}" BorderThickness="0,1,0,0"
            Padding="16,8">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <!-- Row 0: 상단 툴바 — @ / 스킬 / 첨부 (IsToolbarOnly=True에서도 표시) -->
            <StackPanel Grid.Row="0" Orientation="Horizontal" Margin="0,0,0,6">
                <!-- @ 멘션 -->
                <Border CornerRadius="4" Padding="6,3" Margin="0,0,6,0" Cursor="Hand"
                        MouseLeftButtonUp="BtnMention_Click">
                    <Border.Style>
                        <Style TargetType="Border">
                            <Setter Property="Background" Value="Transparent"/>
                            <Style.Triggers>
                                <Trigger Property="IsMouseOver" Value="True">
                                    <Setter Property="Background" Value="#18FFFFFF"/>
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </Border.Style>
                    <TextBlock Text="@ 멘션" FontSize="11" Foreground="{DynamicResource SecondaryText}"/>
                </Border>

                <!-- / 스킬 -->
                <Border CornerRadius="4" Padding="6,3" Margin="0,0,6,0" Cursor="Hand"
                        MouseLeftButtonUp="BtnSkill_Click">
                    <Border.Style>
                        <Style TargetType="Border">
                            <Setter Property="Background" Value="Transparent"/>
                            <Style.Triggers>
                                <Trigger Property="IsMouseOver" Value="True">
                                    <Setter Property="Background" Value="#18FFFFFF"/>
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </Border.Style>
                    <TextBlock Text="/ 스킬" FontSize="11" Foreground="{DynamicResource SecondaryText}"/>
                </Border>

                <!-- 첨부 -->
                <Border CornerRadius="4" Padding="6,3" Cursor="Hand"
                        MouseLeftButtonUp="BtnAttach_Click">
                    <Border.Style>
                        <Style TargetType="Border">
                            <Setter Property="Background" Value="Transparent"/>
                            <Style.Triggers>
                                <Trigger Property="IsMouseOver" Value="True">
                                    <Setter Property="Background" Value="#18FFFFFF"/>
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </Border.Style>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="&#xE723;" FontFamily="Segoe MDL2 Assets" FontSize="11"
                                   Foreground="#FFB74D" VerticalAlignment="Center"/>
                        <TextBlock Text=" 첨부" FontSize="11" Foreground="{DynamicResource SecondaryText}"
                                   Margin="2,0,0,0"/>
                    </StackPanel>
                </Border>

                <!-- 첨부 파일 표시 영역 -->
                <StackPanel x:Name="AttachmentChips" Orientation="Horizontal" Margin="8,0,0,0"/>
            </StackPanel>

            <!-- Row 1: 텍스트 입력 (IsToolbarOnly=True 시 Collapsed) -->
            <Border x:Name="InputTextBoxRow" Grid.Row="1"
                    Background="{DynamicResource ItemBackground}"
                    CornerRadius="12" Padding="12,8" Margin="0,0,0,6">
                <TextBox x:Name="InputBox" FontSize="13" AcceptsReturn="True"
                         TextWrapping="Wrap" MinHeight="40" MaxHeight="200"
                         Background="Transparent" BorderThickness="0"
                         Foreground="{DynamicResource PrimaryText}"
                         VerticalScrollBarVisibility="Auto"
                         KeyDown="InputBox_KeyDown"
                         TextChanged="InputBox_TextChanged">
                </TextBox>
            </Border>

            <!-- Row 2: 하단 칩 + 전송 버튼 (IsToolbarOnly=True 시 Collapsed) -->
            <Grid x:Name="ChipsSendRow" Grid.Row="2">
                <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                    <!-- 모델명 칩 -->
                    <Border CornerRadius="10" Padding="8,3" Margin="0,0,6,0"
                            Background="{DynamicResource ItemBackground}">
                        <TextBlock x:Name="TxtModelChip" Text="llama3" FontSize="10"
                                   Foreground="{DynamicResource SecondaryText}"/>
                    </Border>

                    <!-- 권한 칩 -->
                    <Border CornerRadius="10" Padding="8,3" Margin="0,0,6,0"
                            Background="{DynamicResource ItemBackground}">
                        <TextBlock x:Name="TxtPermissionChip" Text="Ask" FontSize="10"
                                   Foreground="#4FC3F7"/>
                    </Border>

                    <!-- Plan 칩 -->
                    <Border CornerRadius="10" Padding="8,3"
                            Background="{DynamicResource ItemBackground}">
                        <TextBlock x:Name="TxtPlanChip" Text="Plan: Off" FontSize="10"
                                   Foreground="{DynamicResource SecondaryText}"/>
                    </Border>
                </StackPanel>

                <!-- 전송/중단 버튼 -->
                <Border x:Name="BtnSend" HorizontalAlignment="Right" VerticalAlignment="Center"
                        CornerRadius="8" Padding="14,6" Cursor="Hand"
                        MouseLeftButtonUp="BtnSend_Click">
                    <Border.Style>
                        <Style TargetType="Border">
                            <Setter Property="Background" Value="{DynamicResource AccentColor}"/>
                            <Style.Triggers>
                                <Trigger Property="IsMouseOver" Value="True">
                                    <Setter Property="Opacity" Value="0.85"/>
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </Border.Style>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock x:Name="IconSend" Text="&#xE724;" FontFamily="Segoe MDL2 Assets"
                                   FontSize="12" Foreground="White" VerticalAlignment="Center"/>
                        <TextBlock x:Name="TxtSendLabel" Text=" 전송" FontSize="12"
                                   Foreground="White" FontWeight="Medium"/>
                    </StackPanel>
                </Border>
            </Grid>
        </Grid>
    </Border>
</UserControl>
