<UserControl x:Class="PerformanceMonitorDashboard.Controls.LoadingOverlay"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             mc:Ignorable="d"
             Visibility="Collapsed"
             d:DesignHeight="200" d:DesignWidth="400">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Themes/DarkTheme.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid Background="{DynamicResource BackgroundBrush}">
        <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
            <TextBlock x:Name="SpinnerText"
                       Text="&#x27F3;"
                       FontSize="24"
                       Foreground="{DynamicResource AccentBrush}"
                       HorizontalAlignment="Center"
                       RenderTransformOrigin="0.5,0.5">
                <TextBlock.RenderTransform>
                    <RotateTransform x:Name="SpinnerRotation"/>
                </TextBlock.RenderTransform>
                <TextBlock.Triggers>
                    <EventTrigger RoutedEvent="Loaded">
                        <BeginStoryboard>
                            <Storyboard RepeatBehavior="Forever">
                                <DoubleAnimation
                                    Storyboard.TargetName="SpinnerRotation"
                                    Storyboard.TargetProperty="Angle"
                                    From="0" To="360"
                                    Duration="0:0:1"/>
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger>
                </TextBlock.Triggers>
            </TextBlock>
            <TextBlock x:Name="MessageText"
                       FontSize="14"
                       Foreground="{DynamicResource ForegroundMutedBrush}"
                       HorizontalAlignment="Center"
                       Margin="0,8,0,0"/>
        </StackPanel>
    </Grid>
</UserControl>
