﻿<Window x:Class="GsConfigTool.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:vm="clr-namespace:GsConfigTool.ViewModels"
        xmlns:views="clr-namespace:GsConfigTool.Views"
        mc:Ignorable="d"
        Title="GS Config Tool – Gameserver Config Manager"
        Height="820" Width="1280"
        MinHeight="600" MinWidth="900"
        Background="{StaticResource BgBrush}"
        Foreground="{StaticResource TextBrush}"
        FontFamily="Segoe UI" FontSize="13"
        WindowStartupLocation="CenterScreen">

    <Window.DataContext>
        <vm:MainViewModel/>
    </Window.DataContext>

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="220"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <!-- ══ Sidebar ══════════════════════════════════════════════════ -->
        <Border Grid.Column="0" Background="{StaticResource SidebarBrush}"
                BorderBrush="{StaticResource BorderBrush}" BorderThickness="0,0,1,0">
            <DockPanel>
                <!-- Logo -->
                <Border DockPanel.Dock="Top" Padding="20,24,20,20"
                        BorderBrush="{StaticResource BorderBrush}" BorderThickness="0,0,0,1">
                    <StackPanel>
                        <TextBlock Text="⚙ GS Config Tool" FontSize="16" FontWeight="Bold"
                                   Foreground="{StaticResource AccentBrush}"/>
                        <TextBlock Text="Gameserver Config Manager" FontSize="10"
                                   Foreground="{StaticResource TextMutedBrush}" Margin="0,3,0,0"/>
                    </StackPanel>
                </Border>

                <!-- Nav -->
                <StackPanel DockPanel.Dock="Top" Margin="12,16,12,0">
                    <TextBlock Text="NAVIGATION" Style="{StaticResource SectionHeader}" Margin="4,0,0,8"/>

                    <Button Style="{StaticResource NavButton}"
                            Command="{Binding NavigateHomeCommand}">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="🏠" FontSize="14" Margin="0,0,10,0"/>
                            <TextBlock Text="Startseite"/>
                        </StackPanel>
                    </Button>

                    <Button Style="{StaticResource NavButton}"
                            Command="{Binding NavigateProjectsCommand}">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="📁" FontSize="14" Margin="0,0,10,0"/>
                            <TextBlock Text="Meine Projekte"/>
                        </StackPanel>
                    </Button>

                    <Separator Margin="4,12"/>
                    <TextBlock Text="NEUES PROJEKT" Style="{StaticResource SectionHeader}" Margin="4,0,0,8"/>

                    <Button Style="{StaticResource NavButton}"
                            Command="{Binding NewArkSECommand}">
                        <StackPanel Orientation="Horizontal">
                            <Border Width="10" Height="10" Background="{StaticResource ArkBrush}"
                                    CornerRadius="2" Margin="2,0,10,0"/>
                            <TextBlock Text="ARK: Survival Evolved"/>
                        </StackPanel>
                    </Button>

                    <Button Style="{StaticResource NavButton}"
                            Command="{Binding NewArkSACommand}">
                        <StackPanel Orientation="Horizontal">
                            <Border Width="10" Height="10" Background="{StaticResource ArkSABrush}"
                                    CornerRadius="2" Margin="2,0,10,0"/>
                            <TextBlock Text="ARK: Survival Ascended"/>
                        </StackPanel>
                    </Button>

                    <Button Style="{StaticResource NavButton}"
                            Command="{Binding NewPalworldCommand}">
                        <StackPanel Orientation="Horizontal">
                            <Border Width="10" Height="10" Background="{StaticResource PalworldBrush}"
                                    CornerRadius="2" Margin="2,0,10,0"/>
                            <TextBlock Text="Palworld"/>
                        </StackPanel>
                    </Button>
                </StackPanel>

                <!-- Footer -->
                <Border DockPanel.Dock="Bottom" Padding="16,12"
                        BorderBrush="{StaticResource BorderBrush}" BorderThickness="0,1,0,0">
                    <TextBlock Text="© 2026 rl-dev.de" FontSize="11"
                               Foreground="{StaticResource TextMutedBrush}"/>
                </Border>

                <Grid/>
            </DockPanel>
        </Border>

        <!-- ══ Content Area ══════════════════════════════════════════════ -->
        <ContentControl Grid.Column="1" Content="{Binding CurrentPage}">
            <ContentControl.Resources>
                <DataTemplate DataType="{x:Type vm:HomeViewModel}">
                    <views:HomePage/>
                </DataTemplate>
                <DataTemplate DataType="{x:Type vm:ProjectsViewModel}">
                    <views:ProjectsPage/>
                </DataTemplate>
                <DataTemplate DataType="{x:Type vm:ArkConfigViewModel}">
                    <views:ArkConfigPage/>
                </DataTemplate>
                <DataTemplate DataType="{x:Type vm:PalworldConfigViewModel}">
                    <views:PalworldConfigPage/>
                </DataTemplate>
            </ContentControl.Resources>
        </ContentControl>
    </Grid>
</Window>
