<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="ShoopNCook.Views.OwnedRecipeView"
             Margin="6,2">
    <Border
        Style="{StaticResource SecondaryBorderShadow}"
        StrokeShape="RoundRectangle 30">

        <Grid
            BackgroundColor="{StaticResource BackgroundSecondary}"
            Padding="10"
            MinimumHeightRequest="175"
            MinimumWidthRequest="150"
            MaximumHeightRequest="175"
            MaximumWidthRequest="150"
            RowDefinitions="*, Auto">

            <Grid.GestureRecognizers>
                <TapGestureRecognizer 
                    Tapped="OnViewTapped" 
                    NumberOfTapsRequired="1"/>
            </Grid.GestureRecognizers>

            <Border
                Grid.Row="0"
                Stroke="Transparent"
                StrokeShape="RoundRectangle 20"
                BackgroundColor="{StaticResource ImageBackground}">
                <Grid>
                    <Image x:Name="RecipeImage" 
                           MinimumHeightRequest="175"
                           MinimumWidthRequest="150"
                           MaximumHeightRequest="175"
                           MaximumWidthRequest="150"
                           Aspect="AspectFill"/>
                    <HorizontalStackLayout
                        x:Name="Stars"
                        VerticalOptions="End"
                        HorizontalOptions="End"
                        Margin="0, 0, 15, 2">
                        <Image
                            WidthRequest="10"
                            Source="star_full.svg"/>
                        <Image
                            WidthRequest="10"
                            Source="star_full.svg"/>
                        <Image
                            WidthRequest="10"
                            Source="star_full.svg"/>
                        <Image
                            WidthRequest="10"
                            Source="star_full.svg"/>
                        <Image
                            WidthRequest="10"
                            Source="star_full.svg"/>
                    </HorizontalStackLayout>
                </Grid>
            </Border>

            <VerticalStackLayout Grid.Row="1">
                <Label
                    TextColor="{StaticResource TextColorPrimary}"
                    x:Name="TitleLabel"/>
                <Border
                    BackgroundColor="{StaticResource Selected}"
                    Stroke="Transparent"
                    StrokeShape="RoundRectangle 250"
                    Margin="8, 0, 8, 0">
                    <Grid
                        ColumnDefinitions="Auto, *"
                        Padding="10, 3, 10, 3"
                        ColumnSpacing="4"
                        HorizontalOptions="Center"
                        >
                        <Grid.GestureRecognizers>
                            <TapGestureRecognizer 
                                Tapped="OnRemoveButtonTapped" 
                                NumberOfTapsRequired="1"/>
                        </Grid.GestureRecognizers>
                        <Image
                            Grid.Column="0"
                            Source="bin.svg"
                            MaximumHeightRequest="15"/>

                        <Label
                            Grid.Column="1"
                            Text="Delete"/>
                    </Grid>
                </Border>
            </VerticalStackLayout>
        </Grid>
    </Border>
</ContentView>
