-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
541 lines (509 loc) · 33.5 KB
/
MainWindow.xaml
File metadata and controls
541 lines (509 loc) · 33.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
<Window x:Class="GraTechCommander.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="clr-namespace:GraTechCommander.ViewModels"
Title="🔥 GraTech Commander - سليمان الشمري"
Height="900" Width="1500"
MinHeight="700" MinWidth="1100"
WindowStartupLocation="CenterScreen"
WindowStyle="None"
AllowsTransparency="True"
Background="Transparent"
MouseLeftButtonDown="Window_MouseLeftButtonDown">
<Window.DataContext>
<vm:MainViewModel/>
</Window.DataContext>
<Window.Resources>
<!-- Colors - Modern Dark Theme -->
<SolidColorBrush x:Key="Purple" Color="#8B5CF6"/>
<SolidColorBrush x:Key="PurpleGlow" Color="#A78BFA"/>
<SolidColorBrush x:Key="Pink" Color="#EC4899"/>
<SolidColorBrush x:Key="Green" Color="#10B981"/>
<SolidColorBrush x:Key="Cyan" Color="#22D3EE"/>
<SolidColorBrush x:Key="Orange" Color="#F59E0B"/>
<SolidColorBrush x:Key="Red" Color="#EF4444"/>
<SolidColorBrush x:Key="BgDark" Color="#09090b"/>
<SolidColorBrush x:Key="BgCard" Color="#18181b"/>
<SolidColorBrush x:Key="BgHover" Color="#1f1f23"/>
<SolidColorBrush x:Key="Border" Color="#27272a"/>
<SolidColorBrush x:Key="BorderLight" Color="#3f3f46"/>
<SolidColorBrush x:Key="TextW" Color="#fafafa"/>
<SolidColorBrush x:Key="TextG" Color="#a1a1aa"/>
<SolidColorBrush x:Key="TextMuted" Color="#71717a"/>
<!-- Gradient Brushes -->
<LinearGradientBrush x:Key="GradientPurple" StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="#8B5CF6" Offset="0"/>
<GradientStop Color="#EC4899" Offset="1"/>
</LinearGradientBrush>
<LinearGradientBrush x:Key="GradientCyan" StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="#22D3EE" Offset="0"/>
<GradientStop Color="#10B981" Offset="1"/>
</LinearGradientBrush>
<!-- Modern Button Style -->
<Style x:Key="Btn" TargetType="Button">
<Setter Property="Background" Value="{StaticResource GradientPurple}"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="20,12"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="bd" Background="{TemplateBinding Background}"
CornerRadius="12" Padding="{TemplateBinding Padding}">
<Border.Effect>
<DropShadowEffect Color="#8B5CF6" BlurRadius="20" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="bd" Property="Effect">
<Setter.Value>
<DropShadowEffect Color="#8B5CF6" BlurRadius="30" Opacity="0.5" ShadowDepth="0"/>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.5"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Ghost Button Style -->
<Style x:Key="BtnGhost" TargetType="Button">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="{StaticResource TextG}"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="12,8"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="bd" Background="{TemplateBinding Background}"
CornerRadius="8" Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="bd" Property="Background" Value="{StaticResource BgHover}"/>
<Setter Property="Foreground" Value="{StaticResource TextW}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Icon Button Style -->
<Style x:Key="BtnIcon" TargetType="Button">
<Setter Property="Background" Value="{StaticResource BgCard}"/>
<Setter Property="Foreground" Value="{StaticResource TextG}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="BorderBrush" Value="{StaticResource Border}"/>
<Setter Property="Width" Value="40"/>
<Setter Property="Height" Value="40"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="bd" Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="10">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="bd" Property="Background" Value="{StaticResource BgHover}"/>
<Setter TargetName="bd" Property="BorderBrush" Value="{StaticResource Purple}"/>
<Setter Property="Foreground" Value="{StaticResource Purple}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Modern TextBox Style -->
<Style x:Key="Input" TargetType="TextBox">
<Setter Property="Background" Value="{StaticResource BgCard}"/>
<Setter Property="Foreground" Value="{StaticResource TextW}"/>
<Setter Property="BorderBrush" Value="{StaticResource Border}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Padding" Value="16,14"/>
<Setter Property="FontSize" Value="15"/>
<Setter Property="CaretBrush" Value="{StaticResource Purple}"/>
<Setter Property="SelectionBrush" Value="{StaticResource Purple}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TextBox">
<Border x:Name="bd" Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="12">
<ScrollViewer x:Name="PART_ContentHost" Margin="{TemplateBinding Padding}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsFocused" Value="True">
<Setter TargetName="bd" Property="BorderBrush" Value="{StaticResource Purple}"/>
<Setter TargetName="bd" Property="Effect">
<Setter.Value>
<DropShadowEffect Color="#8B5CF6" BlurRadius="15" Opacity="0.2" ShadowDepth="0"/>
</Setter.Value>
</Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Modern CheckBox Style -->
<Style x:Key="ModernCheckBox" TargetType="CheckBox">
<Setter Property="Foreground" Value="{StaticResource TextG}"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="CheckBox">
<StackPanel Orientation="Horizontal">
<Border x:Name="checkBorder" Width="22" Height="22"
Background="{StaticResource BgCard}"
BorderBrush="{StaticResource Border}"
BorderThickness="2" CornerRadius="6" Margin="0,0,10,0">
<TextBlock x:Name="checkMark" Text="✓" FontSize="14"
Foreground="White" HorizontalAlignment="Center"
VerticalAlignment="Center" Visibility="Collapsed"/>
</Border>
<ContentPresenter VerticalAlignment="Center"/>
</StackPanel>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="checkBorder" Property="Background" Value="{StaticResource Purple}"/>
<Setter TargetName="checkBorder" Property="BorderBrush" Value="{StaticResource Purple}"/>
<Setter TargetName="checkMark" Property="Visibility" Value="Visible"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="checkBorder" Property="BorderBrush" Value="{StaticResource PurpleGlow}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Modern ComboBox Style -->
<Style x:Key="ModernComboBox" TargetType="ComboBox">
<Setter Property="Background" Value="{StaticResource BgCard}"/>
<Setter Property="Foreground" Value="{StaticResource TextW}"/>
<Setter Property="BorderBrush" Value="{StaticResource Border}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Padding" Value="14,10"/>
<Setter Property="FontSize" Value="13"/>
</Style>
</Window.Resources>
<!-- Main Container with Border -->
<Border Background="{StaticResource BgDark}" CornerRadius="16" BorderBrush="{StaticResource Border}" BorderThickness="1">
<Border.Effect>
<DropShadowEffect Color="Black" BlurRadius="40" Opacity="0.5" ShadowDepth="0"/>
</Border.Effect>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Custom Title Bar -->
<Border Grid.Row="0" Background="{StaticResource BgCard}" CornerRadius="16,16,0,0" Padding="16,12">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<!-- Logo -->
<StackPanel Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center">
<Border Width="36" Height="36" CornerRadius="10" Background="{StaticResource GradientPurple}">
<TextBlock Text="🔥" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<StackPanel Margin="12,0,0,0" VerticalAlignment="Center">
<TextBlock Text="GraTech Commander" FontSize="16" FontWeight="Bold" Foreground="{StaticResource TextW}"/>
<TextBlock Text="سليمان نزال الشمري • @Grar00t" FontSize="11" Foreground="{StaticResource TextMuted}"/>
</StackPanel>
</StackPanel>
<!-- Status -->
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<Border Background="{StaticResource BgHover}" CornerRadius="20" Padding="12,6">
<StackPanel Orientation="Horizontal">
<Ellipse Width="8" Height="8" Fill="{StaticResource Green}" Margin="0,0,8,0"/>
<TextBlock Text="{Binding StatusMessage}" FontSize="12" Foreground="{StaticResource TextG}"/>
</StackPanel>
</Border>
</StackPanel>
<!-- Window Controls -->
<StackPanel Grid.Column="2" Orientation="Horizontal">
<Button Content="─" Style="{StaticResource BtnGhost}" Click="Minimize_Click" FontSize="16"/>
<Button Content="□" Style="{StaticResource BtnGhost}" Click="Maximize_Click" FontSize="14" Margin="4,0"/>
<Button x:Name="CloseBtn" Content="✕" Click="Close_Click" FontSize="14"
Background="Transparent" Foreground="{StaticResource TextG}"
BorderThickness="0" Padding="12,8" Cursor="Hand">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border x:Name="bd" Background="{TemplateBinding Background}" CornerRadius="8" Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="bd" Property="Background" Value="{StaticResource Red}"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>
</StackPanel>
</Grid>
</Border>
<!-- Main Content -->
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!-- Sidebar -->
<Border Grid.Column="0" Background="{StaticResource BgCard}" Margin="0,0,1,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- New Chat Button -->
<Button Grid.Row="0" Content="➕ محادثة جديدة" Style="{StaticResource Btn}"
Margin="16,16,16,8" Command="{Binding NewConversationCommand}"/>
<!-- Conversations List -->
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto" Margin="8,8,8,0">
<ItemsControl ItemsSource="{Binding Conversations}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border x:Name="convBorder" Background="Transparent" CornerRadius="10"
Margin="4,2" Padding="14,12" Cursor="Hand"
MouseLeftButtonDown="Conversation_Click">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0">
<TextBlock Text="{Binding Title}" Foreground="{StaticResource TextW}"
FontSize="14" FontWeight="Medium" TextTrimming="CharacterEllipsis"/>
<TextBlock Text="{Binding Model}" FontSize="11"
Foreground="{StaticResource TextMuted}" Margin="0,4,0,0"/>
</StackPanel>
<TextBlock Grid.Column="1" Text="💬" FontSize="14" VerticalAlignment="Center"
Foreground="{StaticResource TextMuted}"/>
</Grid>
</Border>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=ListBoxItem}}" Value="True">
<Setter TargetName="convBorder" Property="Background" Value="{StaticResource Border}"/>
</DataTrigger>
<Trigger SourceName="convBorder" Property="IsMouseOver" Value="True">
<Setter TargetName="convBorder" Property="Background" Value="{StaticResource BgHover}"/>
</Trigger>
</DataTemplate.Triggers>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
<!-- Model Settings -->
<Border Grid.Row="2" Background="{StaticResource BgDark}" Margin="12" Padding="16" CornerRadius="14">
<StackPanel>
<!-- Model Selector -->
<TextBlock Text="🤖 النموذج" FontSize="12" FontWeight="SemiBold"
Foreground="{StaticResource TextW}" Margin="0,0,0,10"/>
<ComboBox ItemsSource="{Binding AvailableModels}"
SelectedValue="{Binding SelectedModel}"
SelectedValuePath="Id" DisplayMemberPath="Name"
Style="{StaticResource ModernComboBox}"/>
<!-- Options -->
<StackPanel Margin="0,16,0,0">
<CheckBox Content="توجيه ذكي 🧠" IsChecked="{Binding UseSmartRouting}"
Style="{StaticResource ModernCheckBox}" Margin="0,0,0,10"/>
<Border Background="{StaticResource BgCard}" CornerRadius="10" Padding="12" Margin="0,4,0,0">
<StackPanel>
<CheckBox Content="🦙 Llama محلي" IsChecked="{Binding UseLlamaLocal}"
Style="{StaticResource ModernCheckBox}"/>
<TextBlock Text="خصوصية 100% - بدون إنترنت" FontSize="10"
Foreground="{StaticResource Green}" Margin="32,4,0,0"/>
</StackPanel>
</Border>
</StackPanel>
<!-- Quick Stats -->
<Border Background="{StaticResource BgCard}" CornerRadius="10" Padding="12" Margin="0,16,0,0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" HorizontalAlignment="Center">
<TextBlock Text="{Binding Conversations.Count}" FontSize="20" FontWeight="Bold"
Foreground="{StaticResource Purple}" HorizontalAlignment="Center"/>
<TextBlock Text="محادثة" FontSize="10" Foreground="{StaticResource TextMuted}"
HorizontalAlignment="Center"/>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center">
<TextBlock Text="{Binding Messages.Count}" FontSize="20" FontWeight="Bold"
Foreground="{StaticResource Cyan}" HorizontalAlignment="Center"/>
<TextBlock Text="رسالة" FontSize="10" Foreground="{StaticResource TextMuted}"
HorizontalAlignment="Center"/>
</StackPanel>
</Grid>
</Border>
</StackPanel>
</Border>
</Grid>
</Border>
<!-- Chat Area -->
<Grid Grid.Column="1" Background="{StaticResource BgDark}">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- Messages -->
<ScrollViewer Grid.Row="0" VerticalScrollBarVisibility="Auto" Padding="24">
<ItemsControl ItemsSource="{Binding Messages}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border Margin="0,8" Padding="18,14" CornerRadius="16" MaxWidth="750">
<Border.Style>
<Style TargetType="Border">
<Setter Property="Background" Value="{StaticResource BgCard}"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Style.Triggers>
<DataTrigger Binding="{Binding Role}" Value="user">
<Setter Property="Background" Value="{StaticResource GradientPurple}"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,0,0,8">
<TextBlock FontSize="12" FontWeight="SemiBold">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Text" Value="🔥 GraTech AI"/>
<Setter Property="Foreground" Value="{StaticResource Pink}"/>
<Style.Triggers>
<DataTrigger Binding="{Binding Role}" Value="user">
<Setter Property="Text" Value="👤 أنت"/>
<Setter Property="Foreground" Value="White"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<Border Background="{StaticResource BgHover}" CornerRadius="6" Padding="6,2" Margin="10,0,0,0">
<TextBlock Text="{Binding Model}" FontSize="10" Foreground="{StaticResource TextMuted}"/>
</Border>
</StackPanel>
<TextBox Text="{Binding Content, Mode=OneWay}"
IsReadOnly="True" TextWrapping="Wrap"
Background="Transparent" BorderThickness="0"
Foreground="{StaticResource TextW}" FontSize="15"
Cursor="IBeam" FontFamily="Segoe UI"/>
</StackPanel>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
<!-- Terminal -->
<Border Grid.Row="1" Background="#0a0a0a" CornerRadius="14" Margin="24,0,24,12"
MaxHeight="220" Visibility="{Binding TerminalVisibility}">
<Border.Effect>
<DropShadowEffect Color="#10B981" BlurRadius="20" Opacity="0.1" ShadowDepth="0"/>
</Border.Effect>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" Background="#111" Padding="14,10" CornerRadius="14,14,0,0">
<Grid>
<StackPanel Orientation="Horizontal">
<Ellipse Width="10" Height="10" Fill="{StaticResource Green}"/>
<TextBlock Text="⚡ Terminal" FontSize="13" Foreground="{StaticResource Green}"
Margin="10,0,0,0" FontWeight="SemiBold"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button Content="🗑️" Style="{StaticResource BtnGhost}" Command="{Binding ClearTerminalCommand}" FontSize="12"/>
<Button Content="✕" Style="{StaticResource BtnGhost}" Command="{Binding ToggleTerminalCommand}" FontSize="14"/>
</StackPanel>
</Grid>
</Border>
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto" Padding="14">
<TextBox Text="{Binding TerminalOutput}" IsReadOnly="True"
Background="Transparent" BorderThickness="0"
Foreground="{StaticResource Green}" FontFamily="Cascadia Code, Consolas"
FontSize="13" TextWrapping="Wrap" Cursor="IBeam"/>
</ScrollViewer>
</Grid>
</Border>
<!-- Input Area -->
<Border Grid.Row="2" Background="{StaticResource BgCard}" CornerRadius="16"
Margin="24,0,24,24" Padding="8">
<Border.Effect>
<DropShadowEffect Color="Black" BlurRadius="20" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<!-- Tools -->
<StackPanel Grid.Column="0" Orientation="Horizontal" Margin="4,0">
<Button Content="⚡" Style="{StaticResource BtnIcon}" Command="{Binding ToggleTerminalCommand}"
ToolTip="Terminal"/>
<Button Content="📎" Style="{StaticResource BtnIcon}" Margin="4,0" ToolTip="إرفاق ملف"/>
</StackPanel>
<!-- Input -->
<TextBox Grid.Column="1" Style="{StaticResource Input}"
Text="{Binding UserInput, UpdateSourceTrigger=PropertyChanged}"
Background="Transparent" BorderThickness="0"
AcceptsReturn="False" TextWrapping="Wrap" MaxHeight="120"
VerticalContentAlignment="Center">
<TextBox.InputBindings>
<KeyBinding Key="Return" Command="{Binding SendMessageCommand}"/>
</TextBox.InputBindings>
</TextBox>
<!-- Send Button -->
<Button Grid.Column="2" Content="إرسال ➤" Style="{StaticResource Btn}"
Command="{Binding SendMessageCommand}"
IsEnabled="{Binding CanSend}" Margin="8,0,4,0"/>
</Grid>
</Border>
</Grid>
</Grid>
<!-- Loading Overlay -->
<Border Grid.RowSpan="2" Background="#E6000000" CornerRadius="16"
Visibility="{Binding LoadingVisibility}">
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Border Width="80" Height="80" CornerRadius="20" Background="{StaticResource GradientPurple}">
<Border.Effect>
<DropShadowEffect Color="#8B5CF6" BlurRadius="40" Opacity="0.5" ShadowDepth="0"/>
</Border.Effect>
<TextBlock Text="🔥" FontSize="36" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<TextBlock Text="{Binding StatusMessage}" FontSize="16" FontWeight="SemiBold"
Foreground="{StaticResource TextW}" Margin="0,20,0,0" HorizontalAlignment="Center"/>
<TextBlock Text="جاري المعالجة..." FontSize="12"
Foreground="{StaticResource TextMuted}" Margin="0,8,0,0" HorizontalAlignment="Center"/>
</StackPanel>
</Border>
</Grid>
</Border>
</Window>