package com.example.pmulabs.screensMobile.authScreens

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
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.requiredHeight
import androidx.compose.foundation.layout.requiredWidth
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonColors
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.rotate
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.navigation.NavController
import com.example.pmulabs.designElem.statDesign.LeftCircles
import com.example.pmulabs.designElem.statDesign.LogoMobile
import com.example.pmulabs.designElem.statDesign.RightCircles
import com.example.pmulabs.graphs.AuthScreen

@Composable
fun SplashScreen(navController: NavController,modifier: Modifier = Modifier) {
    Box(
        modifier = modifier
            .requiredWidth(width = 412.dp)
            .requiredHeight(height = 915.dp)
            .background(color = Color.White)
    ) {
        Box(
            modifier = Modifier
                .align(alignment = Alignment.TopStart)
                .offset(
                    x = 128.dp,
                    y = 730.dp
                )
                .requiredWidth(width = 381.dp)
                .requiredHeight(height = 268.dp)
                .rotate(degrees = 8.33f)
        ) {
            RightCircles()
        }
        Box(
            modifier = Modifier
                .align(alignment = Alignment.TopStart)
                .offset(
                    x = (-111.28436279296875).dp,
                    y = (-96.86965942382812).dp
                )
                .requiredWidth(width = 250.dp)
                .requiredHeight(height = 290.dp)
                .rotate(degrees = 12.96f)
        ) {
            LeftCircles()
        }
        Box(
            modifier = Modifier
                .align(alignment = Alignment.TopStart)
                .offset(
                    x = 0.dp,
                    y = 200.dp
                )
                .requiredWidth(width = 412.dp)
                .requiredHeight(height = 190.dp)
        ) {
            Box(
                modifier = Modifier
                    .align(alignment = Alignment.TopStart)
                    .offset(
                        x = 62.00006103515625.dp,
                        y = 50.dp
                    )
                    .requiredWidth(width = 302.dp)
                    .requiredHeight(height = 140.dp)
            ) {
                LogoMobile(modifier = Modifier
                    .align(alignment = Alignment.TopStart)
                    .offset(
                        x = 0.dp,
                        y = 9.dp
                    )
                    .fillMaxWidth()
                    .requiredHeight(height = 131.dp))
            }
            Text(
                text = "Welcome to",
                color = Color(0xff7d7dbd),
                textAlign = TextAlign.Center,
                style = TextStyle(
                    fontSize = 48.sp,
                    fontWeight = FontWeight.Bold),
                modifier = Modifier
                    .fillMaxSize())
        }
        Box(
            modifier = Modifier
                .align(alignment = Alignment.TopStart)
                .offset(
                    x = 0.dp,
                    y = 649.2312622070312.dp
                )
                .requiredWidth(width = 412.dp)
                .requiredHeight(height = 92.dp)
        ) {
            Text(
                text = "Best app with game news!",
                color = Color(0xff7d7dbd),
                textAlign = TextAlign.Center,
                style = TextStyle(
                    fontSize = 20.sp),
                modifier = Modifier
                    .fillMaxSize())
            Button(
                colors = ButtonColors(
                    containerColor = Color(0xff423a99),
                    disabledContainerColor = Color(0xff423a99),
                    contentColor = Color.White,
                    disabledContentColor = Color.White
                ),
                onClick = {navController.navigate(route = AuthScreen.Entry.route)},
                modifier = Modifier
                    .fillMaxWidth(0.5f)
                    .height(50.dp)
                    .align(alignment = Alignment.TopStart)
                    .offset(
                        x = 106.5.dp,
                        y = 31.31878662109375.dp
                    )
            ) {
                Text(text = "Get Started", fontSize = 20.sp)
            }

        }
    }
}
