package com.example.tasks.screens

import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.navigation.NavController
import com.example.tasks.R
import com.example.tasks.navigation.Screen
import com.example.tasks.ui.theme.SFPro

@Composable
fun Start(navController: NavController) {
    Column(
        horizontalAlignment = Alignment.CenterHorizontally,
        verticalArrangement = Arrangement.Top,
        modifier = Modifier
            .fillMaxSize()
            .background(
                Brush.linearGradient(
                    colors = listOf(
                        Color(0XFFFF0000),
                        Color(0XFF0038FF),
                        Color(0xFFFFFFFF),
                    ), start = Offset(0f, Float.POSITIVE_INFINITY),
                    end = Offset(Float.POSITIVE_INFINITY, 0f)
                )
            )
            .padding(vertical = 30.dp),

        ) {

        Image(
            painter = painterResource(id = R.drawable.logo),
            contentDescription = "logo",
            contentScale = ContentScale.FillWidth,
            modifier = Modifier.fillMaxWidth(0.4f)
        )
        Spacer(modifier = Modifier.height(100.dp))
        Text(
            "Задачи ",
            fontWeight = FontWeight.Black,
            fontFamily = SFPro,
            fontSize = 45.sp,
            color = Color.White
        )
        Text(
            "на сегодня ",
            fontWeight = FontWeight.Black,
            fontFamily = SFPro,
            fontSize = 45.sp,
            color = Color.White
        )
        Spacer(modifier = Modifier.height(70.dp))
        Button(
            onClick = { navController.navigate(Screen.Entrance.route) },
            modifier = Modifier
                .width(280.dp)
                .height(60.dp)
                .offset(y = -15.dp),
            shape = RoundedCornerShape(20),
            colors = ButtonDefaults.buttonColors(containerColor = Color(0XFF990000))
        ) {
            Text(
                "Вход",
                fontSize = 25.sp,
                fontFamily = SFPro,
                fontWeight = FontWeight.W900,
                color = Color.White
            )
        }
    }
}