<Page x:Class="SkyTeam.ReservierungssuchePage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
      xmlns:properties="clr-namespace:SkyTeam"
      Title="ReservierungssuchePage"
      Background="{DynamicResource PageBackground}">

    <!--Implementierung mit Unterstützung durch ChatGPT
    Datum: 17.02.2026
    Prompt sinngemäß: Как реализовать многоязычный Placeholder для DatePickerTextBox в WPF с использованием ресурсов (.resx) и привязки к текущей CultureInfo, чтобы текст обновлялся при смене языка приложения?-->
    <Page.Resources>

        <!-- Style für Innertext DatePickerTextBox -->
        <Style TargetType="DatePickerTextBox">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="DatePickerTextBox">
                        <Grid>
                            <ScrollViewer x:Name="PART_ContentHost"/>

                            <!-- placeholder -->
                            <TextBlock
                            Text="{x:Static properties:Resources.SelectDate}"
                            Foreground="Gray"
                            Margin="5,0,0,0"
                            VerticalAlignment="Center"
                            IsHitTestVisible="False"
                            Visibility="Collapsed"
                            x:Name="PlaceholderText"/>
                        </Grid>

                        <ControlTemplate.Triggers>
                            <Trigger Property="Text" Value="">
                                <Setter TargetName="PlaceholderText"
                                    Property="Visibility"
                                    Value="Visible"/>
                            </Trigger>
                        </ControlTemplate.Triggers>

                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

    </Page.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

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

        <Border Grid.Row="0" Grid.ColumnSpan="2" Background="#FF1E88E5" Padding="15">
            <StackPanel Orientation="Horizontal">
                <Ellipse Width="36" Height="36" Fill="White" Margin="0,0,10,0"/>
                <StackPanel>
                    <TextBlock Text="{x:Static properties:Resources.HeaderTitle}" FontSize="20" FontWeight="Bold" Foreground="White"/>
                    <TextBlock Text="{x:Static properties:Resources.HeaderSubtitle}" FontSize="12" Foreground="White"/>
                </StackPanel>
            </StackPanel>
        </Border>

        <StackPanel Grid.Row="1" Grid.Column="0" Background="{DynamicResource SidebarBackground}">

            <Button Height="50" Margin="5" Click="HomeButton_Click" Background="Transparent" BorderThickness="0">
                <StackPanel Orientation="Horizontal">
                    <iconPacks:PackIconMaterial Kind="Home" Width="20" Margin="0,0,10,0" Foreground="{DynamicResource PrimaryText}"/>
                    <TextBlock Text="{x:Static properties:Resources.SidebarHome}" Foreground="{DynamicResource PrimaryText}"/>
                </StackPanel>
            </Button>

            <Button Height="50" Margin="5" Click="BookingsButton_Click" Background="{DynamicResource CardBackground}" BorderThickness="0">
                <StackPanel Orientation="Horizontal">
                    <iconPacks:PackIconMaterial Kind="Airplane" Width="20" Margin="0,0,10,0" Foreground="{DynamicResource PrimaryText}"/>
                    <TextBlock Text="{x:Static properties:Resources.SidebarBookings}" FontWeight="Bold" Foreground="{DynamicResource PrimaryText}"/>
                </StackPanel>
            </Button>

            <Button Height="50" Margin="5" Click="SettingsButton_Click" Background="Transparent" BorderThickness="0">
                <StackPanel Orientation="Horizontal">
                    <iconPacks:PackIconMaterial Kind="Cog" Width="20" Margin="0,0,10,0" Foreground="{DynamicResource PrimaryText}"/>
                    <TextBlock Text="{x:Static properties:Resources.SidebarSettings}" Foreground="{DynamicResource PrimaryText}"/>
                </StackPanel>
            </Button>

            <Button Height="50" Margin="5" Background="#FFEBEB" BorderBrush="#FFB71C1C" Foreground="#D32F2F" FontWeight="Bold" Click="LogoutButton_Click">
                <StackPanel Orientation="Horizontal">
                    <iconPacks:PackIconMaterial Kind="Logout" Width="20" Margin="0,0,10,0"/>
                    <TextBlock Text="{x:Static properties:Resources.SidebarLogout}"/>
                </StackPanel>
            </Button>
        </StackPanel>

        <Grid Grid.Row="1" Grid.Column="1" Margin="30">
            <StackPanel Margin="0,0,0,25">
                <TextBlock Text="{x:Static properties:Resources.SearchFlights}" FontSize="28" FontWeight="Bold" Foreground="{DynamicResource PrimaryText}"/>
                <TextBlock Text="Wählen Sie Ihr Ziel aus der Liste" FontSize="16" Foreground="{DynamicResource SecondaryText}"/>
            </StackPanel>

            <Border Background="{DynamicResource CardBackground}" CornerRadius="12" Padding="30">
                <StackPanel Width="350">

                    <TextBlock Text="{x:Static properties:Resources.PrepositionVon}" FontWeight="SemiBold" Margin="0,0,0,5" Foreground="{DynamicResource PrimaryText}"/>
                    <ComboBox x:Name="FromBox" Height="40" Margin="0,0,0,15" IsEditable="True">
                        <ComboBoxItem Content="Berlin"/>
                        <ComboBoxItem Content="München"/>
                        <ComboBoxItem Content="Frankfurt"/>
                        <ComboBoxItem Content="Hamburg"/>
                        <ComboBoxItem Content="Paris"/>
                        <ComboBoxItem Content="London"/>
                        <ComboBoxItem Content="Madrid"/>
                        <ComboBoxItem Content="Rom"/>
                        <ComboBoxItem Content="Lissabon"/>
                        <ComboBoxItem Content="Wien"/>
                        <ComboBoxItem Content="Zürich"/>
                        <ComboBoxItem Content="Amsterdam"/>
                        <ComboBoxItem Content="Prag"/>
                        <ComboBoxItem Content="Budapest"/>
                        <ComboBoxItem Content="Warschau"/>
                        <ComboBoxItem Content="Paderborn"/>
                    </ComboBox>

                    <TextBlock Text="{x:Static properties:Resources.To}" FontWeight="SemiBold" Margin="0,0,0,5" Foreground="{DynamicResource PrimaryText}"/>
                    <ComboBox x:Name="ToBox" Height="40" Margin="0,0,0,15" IsEditable="True">
                        <ComboBoxItem Content="Mallorca"/>
                        <ComboBoxItem Content="Berlin"/>
                        <ComboBoxItem Content="München"/>
                        <ComboBoxItem Content="Frankfurt"/>
                        <ComboBoxItem Content="Hamburg"/>
                        <ComboBoxItem Content="Paris"/>
                        <ComboBoxItem Content="London"/>
                        <ComboBoxItem Content="Madrid"/>
                        <ComboBoxItem Content="Rom"/>
                        <ComboBoxItem Content="Lissabon"/>
                        <ComboBoxItem Content="Wien"/>
                        <ComboBoxItem Content="Zürich"/>
                        <ComboBoxItem Content="Amsterdam"/>
                        <ComboBoxItem Content="Prag"/>
                        <ComboBoxItem Content="Budapest"/>
                        <ComboBoxItem Content="Tokio"/>
                        <ComboBoxItem Content="New York"/>
                        <ComboBoxItem Content="Dubai"/>
                    </ComboBox>

                    <TextBlock Text="{x:Static properties:Resources.DepartureDate}" FontWeight="SemiBold" Margin="0,0,0,5" Foreground="{DynamicResource PrimaryText}"/>
                    <DatePicker x:Name="DateBox" Height="40" Margin="0,0,0,25"/>

                    <Button Content="{x:Static properties:Resources.SearchFlights}" 
                            Height="45" 
                            FontWeight="Bold" 
                            Background="#FF1E88E5" 
                            Foreground="White" 
                            Click="SearchFlights_Click"/>
                </StackPanel>
            </Border>
        </Grid>
    </Grid>
</Page>