<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
             x:Class="GameAtlas.Views.PageParcourir"
             Title="ECRAN DE CONNEXION" WidthRequest="390" HeightRequest="844">


    <Grid x:Name="outerGrid">

        <Grid.Background>
            <LinearGradientBrush EndPoint="1,0">
                <GradientStop Color="#DFE4FF"
                          Offset="0.1" />
                <GradientStop Color="#FDF7E6"
                          Offset="1.0" />
            </LinearGradientBrush>
        </Grid.Background>

        <VerticalStackLayout>



            <StackLayout Padding="0,30,0,0" HorizontalOptions="Center" VerticalOptions="Center" Grid.Row="2">
                <Frame HeightRequest="40" WidthRequest="300" CornerRadius="8">
                    <SearchBar Placeholder="Rechercher" TextColor="Black" BackgroundColor="#D9D9D9" TextChanged="SearchBar_TextChanged"/>
                </Frame>
            </StackLayout>

            <Label
                Text="Rechercher"
                FontFamily="PTSansCBold"
                FontSize="24"
                Grid.Row="3"
                Padding="25"
            />

            <Grid>
                <CollectionView ItemsSource="{Binding ListJeux}" Margin="25,0,25,0" VerticalScrollBarVisibility="Never" x:Name="searchResults">
                    <CollectionView.ItemTemplate>
                        <DataTemplate>
                            <Border HeightRequest="97.5" StrokeShape="RoundRectangle 5" VerticalOptions="Start" HorizontalOptions="Center">
                                <Border.Shadow>
                                    <Shadow Brush="Black" Offset="0,4" Radius="4" Opacity="0.4" />
                                </Border.Shadow>
                                <Frame HasShadow="False" HeightRequest="97.5" CornerRadius="5" IsClippedToBounds="True">
                                    <ImageButton HeightRequest="97.5" Source="{Binding Image}" Aspect="AspectFill" Clicked="OnGame_Tapped"/>
                                </Frame>
                            </Border>
                        </DataTemplate>
                    </CollectionView.ItemTemplate>
                    <CollectionView.ItemsLayout>
                        <GridItemsLayout Span="2" Orientation="Vertical" VerticalItemSpacing="30" HorizontalItemSpacing="15"/>
                    </CollectionView.ItemsLayout>
                </CollectionView>
            </Grid>

        </VerticalStackLayout>

    </Grid>

</ContentPage>