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

    <!-- Phase 17-UI-C: 세션 헤더 바 — ChatWindow Row 1 에 임베드.
         배경/테두리는 부모(Row 1 Border)가 담당하므로 이 컨트롤은 투명. -->

    <Border Background="Transparent" BorderThickness="0">
        <Grid Margin="4,0">

            <!-- 좌측: 현재 탭 레이블 (탭 이름 또는 대화 제목) -->
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center">
                <TextBlock x:Name="TxtTabLabel" Text="Chat" FontSize="11" FontWeight="SemiBold"
                           Foreground="{DynamicResource SecondaryText}" Margin="4,0,8,0"/>
            </StackPanel>

            <!-- 중앙: 모델/Plan/권한 칩 -->
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">

                <!-- 모델 칩 -->
                <Border x:Name="ChipModel" CornerRadius="10" Padding="8,3" Margin="3,0"
                        Cursor="Hand" MouseLeftButtonUp="ChipModel_Click">
                    <Border.Style>
                        <Style TargetType="Border">
                            <Setter Property="Background" Value="{DynamicResource ItemBackground}"/>
                            <Style.Triggers>
                                <Trigger Property="IsMouseOver" Value="True">
                                    <Setter Property="Background" Value="{DynamicResource ItemHoverBackground}"/>
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </Border.Style>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="&#xEA86;" FontFamily="Segoe MDL2 Assets" FontSize="10"
                                   Foreground="{DynamicResource AccentColor}" VerticalAlignment="Center"/>
                        <TextBlock x:Name="TxtModelChip" Text="llama3" FontSize="11" Margin="4,0,2,0"
                                   Foreground="{DynamicResource PrimaryText}"/>
                        <TextBlock Text="&#xE70D;" FontFamily="Segoe MDL2 Assets" FontSize="8"
                                   Foreground="{DynamicResource SecondaryText}" VerticalAlignment="Center"/>
                    </StackPanel>
                </Border>

                <!-- Plan 모드 칩 (3-state: Off/Auto/Always) -->
                <Border x:Name="ChipPlan" CornerRadius="10" Padding="8,3" Margin="3,0"
                        Cursor="Hand" MouseLeftButtonUp="ChipPlan_Click">
                    <Border.Style>
                        <Style TargetType="Border">
                            <Setter Property="Background" Value="{DynamicResource ItemBackground}"/>
                            <Style.Triggers>
                                <Trigger Property="IsMouseOver" Value="True">
                                    <Setter Property="Background" Value="{DynamicResource ItemHoverBackground}"/>
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </Border.Style>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock x:Name="PlanIcon" Text="&#xE9D9;" FontFamily="Segoe MDL2 Assets" FontSize="10"
                                   Foreground="{DynamicResource SecondaryText}" VerticalAlignment="Center"/>
                        <TextBlock x:Name="TxtPlanChip" Text="Plan: Off" FontSize="11" Margin="4,0,0,0"
                                   Foreground="{DynamicResource PrimaryText}"/>
                    </StackPanel>
                </Border>

                <!-- 권한 모드 칩 -->
                <Border x:Name="ChipPermission" CornerRadius="10" Padding="8,3" Margin="3,0"
                        Cursor="Hand" MouseLeftButtonUp="ChipPermission_Click">
                    <Border.Style>
                        <Style TargetType="Border">
                            <Setter Property="Background" Value="{DynamicResource ItemBackground}"/>
                            <Style.Triggers>
                                <Trigger Property="IsMouseOver" Value="True">
                                    <Setter Property="Background" Value="{DynamicResource ItemHoverBackground}"/>
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </Border.Style>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock x:Name="PermIcon" Text="&#xE72E;" FontFamily="Segoe MDL2 Assets" FontSize="10"
                                   Foreground="#4FC3F7" VerticalAlignment="Center"/>
                        <TextBlock x:Name="TxtPermissionChip" Text="Ask" FontSize="11" Margin="4,0,0,0"
                                   Foreground="{DynamicResource PrimaryText}"/>
                    </StackPanel>
                </Border>
            </StackPanel>

            <!-- 우측: 설정 패널 토글 버튼 -->
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
                <Border CornerRadius="6" Padding="6,3" Cursor="Hand" Margin="0,0,4,0"
                        MouseLeftButtonUp="BtnSettings_Click"
                        ToolTip="에이전트 설정 패널">
                    <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="&#xE713;" FontFamily="Segoe MDL2 Assets" FontSize="13"
                               Foreground="{DynamicResource SecondaryText}"/>
                </Border>
            </StackPanel>
        </Grid>
    </Border>
</UserControl>
