<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Name="MainWindow"
    Title="Vendelse Poort TBC Launcher"
    Width="1400"
    Height="788"
    MinWidth="1050"
    MinHeight="590"
    WindowStartupLocation="CenterScreen"
    WindowStyle="None"
    ResizeMode="CanResizeWithGrip"
    Background="#070B0F"
    SnapsToDevicePixels="True"
    UseLayoutRounding="True">
    <Window.Resources>
        <Style x:Key="HotspotButton" TargetType="{x:Type Button}">
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderBrush" Value="Transparent"/>
            <Setter Property="BorderThickness" Value="2"/>
            <Setter Property="Cursor" Value="Hand"/>
            <Setter Property="Focusable" Value="False"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Border x:Name="Border"
                                CornerRadius="5"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}">
                            <ContentPresenter HorizontalAlignment="Center"
                                              VerticalAlignment="Center"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="Border" Property="Background" Value="#2600A8FF"/>
                                <Setter TargetName="Border" Property="BorderBrush" Value="#B8D0A14A"/>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="True">
                                <Setter TargetName="Border" Property="Background" Value="#4800A8FF"/>
                                <Setter TargetName="Border" Property="BorderBrush" Value="#FFDDB45B"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="PanelBorder" TargetType="{x:Type Border}">
            <Setter Property="Background" Value="#F20A0F13"/>
            <Setter Property="BorderBrush" Value="#A9876732"/>
            <Setter Property="BorderThickness" Value="1.4"/>
            <Setter Property="CornerRadius" Value="4"/>
            <Setter Property="Padding" Value="16"/>
        </Style>

        <Style x:Key="GoldTitle" TargetType="{x:Type TextBlock}">
            <Setter Property="Foreground" Value="#E0B45D"/>
            <Setter Property="FontFamily" Value="Georgia"/>
            <Setter Property="FontWeight" Value="Bold"/>
            <Setter Property="FontSize" Value="21"/>
        </Style>

        <Style x:Key="BodyText" TargetType="{x:Type TextBlock}">
            <Setter Property="Foreground" Value="#E4E0D5"/>
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="FontSize" Value="15"/>
            <Setter Property="TextWrapping" Value="Wrap"/>
        </Style>

        <Style x:Key="SmallGoldButton" TargetType="{x:Type Button}">
            <Setter Property="Foreground" Value="#E6BF70"/>
            <Setter Property="Background" Value="#FF11171B"/>
            <Setter Property="BorderBrush" Value="#C38A6230"/>
            <Setter Property="BorderThickness" Value="1.2"/>
            <Setter Property="Padding" Value="14,7"/>
            <Setter Property="FontFamily" Value="Georgia"/>
            <Setter Property="FontWeight" Value="Bold"/>
            <Setter Property="Cursor" Value="Hand"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Border x:Name="Border"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="3"
                                Padding="{TemplateBinding Padding}">
                            <ContentPresenter HorizontalAlignment="Center"
                                              VerticalAlignment="Center"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="Border" Property="Background" Value="#FF202B31"/>
                                <Setter TargetName="Border" Property="BorderBrush" Value="#FFE0B45D"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>

    <Grid>
        <Viewbox Stretch="Uniform">
            <Grid Width="1672" Height="941">
                <Image x:Name="BackgroundImage" Stretch="Fill"/>

                <Canvas x:Name="MainCanvas" Width="1672" Height="941">

                    <!-- Drag and window control areas -->
                    <Border x:Name="DragArea" Canvas.Left="280" Canvas.Top="0"
                            Width="1150" Height="78" Background="Transparent"/>
                    <Button x:Name="BtnTopSettings" Style="{StaticResource HotspotButton}"
                            Canvas.Left="1442" Canvas.Top="13" Width="50" Height="50"/>
                    <Button x:Name="BtnMinimize" Style="{StaticResource HotspotButton}"
                            Canvas.Left="1502" Canvas.Top="13" Width="48" Height="50"/>
                    <Button x:Name="BtnClose" Style="{StaticResource HotspotButton}"
                            Canvas.Left="1560" Canvas.Top="13" Width="70" Height="50"/>

                    <!-- Left navigation hotspots -->
                    <Button x:Name="BtnStart" Style="{StaticResource HotspotButton}"
                            Canvas.Left="31" Canvas.Top="227" Width="226" Height="57"/>
                    <Button x:Name="BtnNews" Style="{StaticResource HotspotButton}"
                            Canvas.Left="31" Canvas.Top="290" Width="226" Height="57"/>
                    <Button x:Name="BtnServerStatus" Style="{StaticResource HotspotButton}"
                            Canvas.Left="31" Canvas.Top="353" Width="226" Height="57"/>
                    <Button x:Name="BtnAccount" Style="{StaticResource HotspotButton}"
                            Canvas.Left="31" Canvas.Top="416" Width="226" Height="57"/>
                    <Button x:Name="BtnSettings" Style="{StaticResource HotspotButton}"
                            Canvas.Left="31" Canvas.Top="479" Width="226" Height="57"/>
                    <Button x:Name="BtnSupport" Style="{StaticResource HotspotButton}"
                            Canvas.Left="31" Canvas.Top="542" Width="226" Height="57"/>

                    <!-- Dynamic news card -->
                    <Border Style="{StaticResource PanelBorder}"
                            Canvas.Left="295" Canvas.Top="482" Width="411" Height="273">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <TextBlock x:Name="TxtNewsTitle" Style="{StaticResource GoldTitle}"/>
                            <TextBlock x:Name="TxtNewsBody" Grid.Row="1"
                                       Style="{StaticResource BodyText}"
                                       Margin="0,16,0,12"/>
                            <Button x:Name="BtnReadMore" Grid.Row="2"
                                    Style="{StaticResource SmallGoldButton}"
                                    HorizontalAlignment="Left"
                                    Content="MEHR LESEN"/>
                        </Grid>
                    </Border>

                    <!-- Dynamic patch notes -->
                    <Border Style="{StaticResource PanelBorder}"
                            Canvas.Left="714" Canvas.Top="482" Width="247" Height="273">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <TextBlock Style="{StaticResource GoldTitle}" Text="PATCHNOTIZEN"/>
                            <TextBlock x:Name="TxtPatchNotes" Grid.Row="1"
                                       Style="{StaticResource BodyText}"
                                       Margin="0,15,0,10"
                                       FontSize="14"/>
                            <Button x:Name="BtnPatchNotes" Grid.Row="2"
                                    Style="{StaticResource SmallGoldButton}"
                                    Content="ALLE PATCHNOTEN"/>
                        </Grid>
                    </Border>

                    <!-- Dynamic event card -->
                    <Border Style="{StaticResource PanelBorder}"
                            Canvas.Left="971" Canvas.Top="482" Width="282" Height="273">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <TextBlock Style="{StaticResource GoldTitle}" Text="NÄCHSTES EVENT"/>
                            <TextBlock x:Name="TxtEventTitle" Grid.Row="1"
                                       Foreground="#E6BF70" FontFamily="Georgia"
                                       FontWeight="Bold" FontSize="19"
                                       TextAlignment="Center" Margin="0,22,0,5"
                                       TextWrapping="Wrap"/>
                            <StackPanel Grid.Row="2">
                                <TextBlock x:Name="TxtEventDate"
                                           Foreground="#87BEE5" FontSize="14"
                                           TextAlignment="Center" TextWrapping="Wrap"/>
                                <TextBlock x:Name="TxtEventText"
                                           Style="{StaticResource BodyText}"
                                           FontSize="13.5"
                                           TextAlignment="Center"
                                           Margin="0,8,0,8"/>
                            </StackPanel>
                            <Button x:Name="BtnEventDetails" Grid.Row="3"
                                    Style="{StaticResource SmallGoldButton}"
                                    HorizontalAlignment="Center"
                                    Content="EVENT DETAILS"/>
                        </Grid>
                    </Border>

                    <!-- Live server status -->
                    <Border Style="{StaticResource PanelBorder}"
                            Canvas.Left="1265" Canvas.Top="347" Width="342" Height="178">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <TextBlock Style="{StaticResource GoldTitle}" Text="SERVERSTATUS"/>
                            <Grid Grid.Row="1" Margin="0,10,0,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="112"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="24"/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition/>
                                    <RowDefinition/>
                                    <RowDefinition/>
                                    <RowDefinition/>
                                    <RowDefinition/>
                                </Grid.RowDefinitions>

                                <TextBlock Grid.Row="0" Foreground="#DDD8CC" Text="Realm:"/>
                                <TextBlock Grid.Row="0" Grid.Column="1" x:Name="TxtRealmName"
                                           Foreground="#ECE7DD" TextTrimming="CharacterEllipsis"/>

                                <TextBlock Grid.Row="1" Foreground="#DDD8CC" Text="Status:"/>
                                <TextBlock Grid.Row="1" Grid.Column="1" x:Name="TxtRealmStatus"
                                           Foreground="#D8A94D" Text="Prüfe ..."/>
                                <Ellipse Grid.Row="1" Grid.Column="2" x:Name="DotRealm"
                                         Width="10" Height="10" Fill="#D8A94D"/>

                                <TextBlock Grid.Row="2" Foreground="#DDD8CC" Text="Loginserver:"/>
                                <TextBlock Grid.Row="2" Grid.Column="1" x:Name="TxtLoginStatus"
                                           Foreground="#D8A94D" Text="Prüfe ..."/>
                                <Ellipse Grid.Row="2" Grid.Column="2" x:Name="DotLogin"
                                         Width="10" Height="10" Fill="#D8A94D"/>

                                <TextBlock Grid.Row="3" Foreground="#DDD8CC" Text="Weltserver:"/>
                                <TextBlock Grid.Row="3" Grid.Column="1" x:Name="TxtWorldStatus"
                                           Foreground="#D8A94D" Text="Prüfe ..."/>
                                <Ellipse Grid.Row="3" Grid.Column="2" x:Name="DotWorld"
                                         Width="10" Height="10" Fill="#D8A94D"/>

                                <TextBlock Grid.Row="4" Foreground="#DDD8CC" Text="Version:"/>
                                <TextBlock Grid.Row="4" Grid.Column="1" x:Name="TxtVersion"
                                           Foreground="#ECE7DD"/>
                            </Grid>
                        </Grid>
                    </Border>

                    <!-- Account panel: password is deliberately never stored -->
                    <Border Style="{StaticResource PanelBorder}"
                            Canvas.Left="1265" Canvas.Top="536" Width="342" Height="219">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <TextBlock Style="{StaticResource GoldTitle}" Text="ACCOUNT"/>

                            <TextBlock Grid.Row="1" Foreground="#D7D1C6"
                                       Text="Accountname" Margin="0,10,0,4"/>
                            <TextBox x:Name="TxtAccountName" Grid.Row="2"
                                     Height="31" Background="#FF070A0D"
                                     Foreground="#EEE9DE" BorderBrush="#8D6840"
                                     BorderThickness="1" Padding="8,4"
                                     FontSize="14"/>

                            <Grid Grid.Row="3" Margin="0,9,0,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <CheckBox x:Name="ChkRememberAccount"
                                          Foreground="#DDD8CC"
                                          Content="Account speichern"
                                          VerticalAlignment="Center"/>
                                <Button x:Name="BtnPasswordHelp" Grid.Column="1"
                                        Background="Transparent"
                                        BorderBrush="Transparent"
                                        Foreground="#78B8E3"
                                        Cursor="Hand"
                                        Content="Passwort vergessen?"/>
                            </Grid>

                            <TextBlock Grid.Row="4" Foreground="#969DA2"
                                       FontSize="12.5" TextWrapping="Wrap"
                                       VerticalAlignment="Center"
                                       Text="Das Passwort wird ausschließlich im WoW-Client eingegeben und niemals im Launcher gespeichert."/>
                        </Grid>
                    </Border>

                    <!-- Bottom utility hotspots -->
                    <Button x:Name="BtnClientCheck" Style="{StaticResource HotspotButton}"
                            Canvas.Left="294" Canvas.Top="777" Width="201" Height="70"/>
                    <Button x:Name="BtnRepair" Style="{StaticResource HotspotButton}"
                            Canvas.Left="502" Canvas.Top="777" Width="199" Height="70"/>
                    <Button x:Name="BtnUpdates" Style="{StaticResource HotspotButton}"
                            Canvas.Left="708" Canvas.Top="777" Width="183" Height="70"/>
                    <Button x:Name="BtnOpenFolder" Style="{StaticResource HotspotButton}"
                            Canvas.Left="901" Canvas.Top="777" Width="243" Height="70"/>
                    <Button x:Name="BtnPlay" Style="{StaticResource HotspotButton}"
                            Canvas.Left="1203" Canvas.Top="770" Width="404" Height="86"/>

                    <!-- Footer live information -->
                    <Border Canvas.Left="288" Canvas.Top="866" Width="1110" Height="45"
                            Background="#E90A0F13" CornerRadius="3" Padding="15,8">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="12"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <TextBlock x:Name="TxtFooterHost" Foreground="#D8B06A"
                                       FontSize="14.5" VerticalAlignment="Center"/>
                            <Border Grid.Column="1" Width="1" Background="#8C7659"
                                    HorizontalAlignment="Center"/>
                            <TextBlock x:Name="TxtFooterRealm" Grid.Column="2"
                                       Foreground="#B6C9D7" FontSize="14.5"
                                       VerticalAlignment="Center"
                                       TextAlignment="Center"/>
                        </Grid>
                    </Border>

                    <Border Canvas.Left="1406" Canvas.Top="866" Width="204" Height="45"
                            Background="#E90A0F13" CornerRadius="3" Padding="10,8">
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                            <Ellipse x:Name="DotSystemReady" Width="13" Height="13"
                                     Fill="#D8A94D" Margin="0,0,8,0"/>
                            <TextBlock x:Name="TxtSystemReady" Foreground="#C7D1D7"
                                       FontSize="13.5" VerticalAlignment="Center"
                                       Text="Prüfe Systeme ..."/>
                        </StackPanel>
                    </Border>

                </Canvas>
            </Grid>
        </Viewbox>
    </Grid>
</Window>