<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
    x:Class="SeriesTracker.Views.InfoPage"
    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"
    Title=""
    BackgroundColor="{AppThemeBinding Light={StaticResource White},
                                      Dark={StaticResource DarkBackground}}">
    <StackLayout Margin="10,40,10,40">
        <Border
            Margin="10"
            BackgroundColor="{AppThemeBinding Light={StaticResource LightElementBorderBackground},
                                              Dark={StaticResource DarkElementBorderBackground}}"
            Stroke="{AppThemeBinding Light={StaticResource LightElementBorderBackground},
                                     Dark={StaticResource DarkElementBorderBackground}}">
            <Border.StrokeShape>
                <RoundRectangle CornerRadius="5" />
            </Border.StrokeShape>
            <Grid
                Margin="5"
                Padding="5"
                ColumnSpacing="10"
                RowSpacing="-10">
                <Grid.RowDefinitions>
                    <RowDefinition Height="30" />
                    <RowDefinition Height="50" />
                    <RowDefinition Height="50" />
                    <RowDefinition Height="1" />
                    <RowDefinition Height="60" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="50" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="110" />
                </Grid.ColumnDefinitions>
                <Image
                    Grid.Row="0"
                    Grid.Column="0"
                    HeightRequest="20"
                    HorizontalOptions="Center"
                    Source="user.png"
                    VerticalOptions="Start"
                    WidthRequest="20">
                    <Image.Behaviors>
                        <toolkit:IconTintColorBehavior TintColor="{AppThemeBinding Light=Black, Dark=White}" />
                    </Image.Behaviors>
                </Image>
                <Label
                    Grid.Row="0"
                    Grid.Column="1"
                    FontAttributes="Bold"
                    FontSize="16"
                    Text="Разработчик" />
                <Label
                    Grid.Row="0"
                    Grid.Column="2"
                    FontAttributes="Bold"
                    FontSize="16"
                    HorizontalOptions="End"
                    Text="Шаков Виктор" />

                <Image
                    Grid.Row="1"
                    Grid.RowSpan="2"
                    Grid.Column="0"
                    Margin="0,15,0,0"
                    HeightRequest="20"
                    HorizontalOptions="Center"
                    Source="link.png"
                    VerticalOptions="Start"
                    WidthRequest="20">
                    <Image.Behaviors>
                        <toolkit:IconTintColorBehavior TintColor="{AppThemeBinding Light=Black, Dark=White}" />
                    </Image.Behaviors>
                </Image>
                <Label
                    Grid.Row="1"
                    Grid.Column="1"
                    Grid.ColumnSpan="2"
                    Margin="0,15,0,0"
                    FontAttributes="Bold"
                    FontSize="16"
                    Text="Связь с разработчиком" />
                <Label
                    Grid.Row="2"
                    Grid.Column="1"
                    Grid.ColumnSpan="2"
                    Text="Если у вас есть вопросы, то вы можете связаться с разработчиком приложения." />
                <StackLayout
                    Grid.Row="3"
                    Grid.Column="0"
                    Grid.ColumnSpan="3"
                    BackgroundColor="{AppThemeBinding Light={StaticResource Black},
                                                      Dark={StaticResource White}}" />
                <HorizontalStackLayout
                    Grid.Row="4"
                    Grid.Column="0"
                    Grid.ColumnSpan="3"
                    HorizontalOptions="Center"
                    VerticalOptions="Center">
                    <ImageButton
                        x:Name="vkButton"
                        Margin="15,15,15,0"
                        Clicked="vkButton_Clicked"
                        HeightRequest="40"
                        Source="vk.png"
                        WidthRequest="40">
                        <ImageButton.Behaviors>
                            <toolkit:IconTintColorBehavior TintColor="{AppThemeBinding Light=Black, Dark=White}" />
                        </ImageButton.Behaviors>
                    </ImageButton>
                    <ImageButton
                        x:Name="tgButton"
                        Margin="15,15,15,0"
                        Clicked="tgButton_Clicked"
                        HeightRequest="40"
                        Source="telegram.png"
                        WidthRequest="40">
                        <ImageButton.Behaviors>
                            <toolkit:IconTintColorBehavior TintColor="{AppThemeBinding Light=Black, Dark=White}" />
                        </ImageButton.Behaviors>
                    </ImageButton>
                    <ImageButton
                        x:Name="emailButton"
                        Margin="15,15,15,0"
                        Clicked="emailButton_Clicked"
                        HeightRequest="40"
                        Source="email.png"
                        WidthRequest="40">
                        <ImageButton.Behaviors>
                            <toolkit:IconTintColorBehavior TintColor="{AppThemeBinding Light=Black, Dark=White}" />
                        </ImageButton.Behaviors>
                    </ImageButton>
                </HorizontalStackLayout>
            </Grid>
        </Border>

        <Border
            Margin="10"
            BackgroundColor="{AppThemeBinding Light={StaticResource LightElementBorderBackground},
                                              Dark={StaticResource DarkElementBorderBackground}}"
            Stroke="{AppThemeBinding Light={StaticResource LightElementBorderBackground},
                                     Dark={StaticResource DarkElementBorderBackground}}">
            <Border.StrokeShape>
                <RoundRectangle CornerRadius="5" />
            </Border.StrokeShape>
            <Grid
                Margin="5"
                Padding="5"
                ColumnSpacing="10"
                RowSpacing="-10">
                <Grid.GestureRecognizers>
                    <TapGestureRecognizer NumberOfTapsRequired="1" Tapped="TapGestureRecognizer_Tapped_1" />
                </Grid.GestureRecognizers>
                <Grid.RowDefinitions>
                    <RowDefinition Height="60" />
                    <RowDefinition Height="50" />
                    <RowDefinition Height="50" />
                    <RowDefinition Height="60" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="50" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="100" />
                </Grid.ColumnDefinitions>
                <Image
                    Grid.RowSpan="2"
                    Grid.Column="0"
                    HeightRequest="30"
                    HorizontalOptions="Center"
                    Source="github.png"
                    VerticalOptions="Start"
                    WidthRequest="30">
                    <Image.Behaviors>
                        <toolkit:IconTintColorBehavior TintColor="{AppThemeBinding Light=Black, Dark=White}" />
                    </Image.Behaviors>
                </Image>
                <Label
                    Grid.Row="0"
                    Grid.Column="1"
                    Grid.ColumnSpan="2"
                    FontAttributes="Bold"
                    FontSize="16"
                    Text="Исходный код приложения" />
                <Label
                    Grid.Row="1"
                    Grid.Column="1"
                    Grid.ColumnSpan="2"
                    Margin="0,-20,0,0"
                    Text="Код приложения находится в свободном доступе на Github разработчика." />
                <Image
                    Grid.Row="2"
                    Grid.Column="0"
                    Margin="0,-5,0,0"
                    HeightRequest="30"
                    HorizontalOptions="Center"
                    Source="tag.png"
                    VerticalOptions="Start"
                    WidthRequest="30">
                    <Image.Behaviors>
                        <toolkit:IconTintColorBehavior TintColor="{AppThemeBinding Light=Black, Dark=White}" />
                    </Image.Behaviors>
                </Image>
                <Label
                    Grid.Row="2"
                    Grid.Column="1"
                    FontAttributes="Bold"
                    FontSize="16"
                    Text="Версия приложения" />
                <Label
                    Grid.Row="2"
                    Grid.Column="2"
                    FontAttributes="Bold"
                    FontSize="16"
                    HorizontalOptions="End"
                    Text="1.0.0" />

                <Image
                    Grid.Row="3"
                    Grid.Column="0"
                    Margin="0,10,0,0"
                    HeightRequest="30"
                    HorizontalOptions="Center"
                    Source="license.png"
                    VerticalOptions="Start"
                    WidthRequest="30">
                    <Image.Behaviors>
                        <toolkit:IconTintColorBehavior TintColor="{AppThemeBinding Light=Black, Dark=White}" />
                    </Image.Behaviors>
                </Image>
                <Label
                    Grid.Row="3"
                    Grid.Column="1"
                    Margin="0,15,0,0"
                    FontAttributes="Bold"
                    FontSize="16"
                    Text="Лицензия" />
                <Label
                    Grid.Row="3"
                    Grid.Column="2"
                    Margin="0,15,0,0"
                    FontAttributes="Bold"
                    FontSize="16"
                    HorizontalOptions="End"
                    HorizontalTextAlignment="End"
                    Text="Apache License 2.0" />
            </Grid>
        </Border>
    </StackLayout>
</ContentPage>