package com.example.exvesta.Screans

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
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.res.painterResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.navigation.NavHostController
import com.example.exvesta.R
import androidx.compose.ui.Modifier
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.ui.draw.clip
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color


@Composable
fun RegAuth(navHost: NavHostController) {
    val gradientButton = Brush.linearGradient(
        colors = listOf(
            Color(0xFF6F4A48),
            Color(0xFFC09F9C)
        ),

        start =  Offset(30.0f, 50.0f),
        end =  Offset(200.0f, 50.0f)
    );



    Column(
        modifier = Modifier
            .fillMaxSize()
            .background(Color.White),
//        verticalArrangement = Arrangement.Center,
        horizontalAlignment = Alignment.CenterHorizontally
    ) {

        Spacer(modifier = Modifier.height(100.dp))
        Image(
            painter = painterResource(id = R.drawable.back),
            contentDescription = "Background Image",
            modifier = Modifier
                .fillMaxWidth()
                .height(350.dp)
                .clip(RoundedCornerShape(16.dp))
        )
        Spacer(modifier = Modifier.height(30.dp))
        Button(
            onClick = {  navHost.navigate("Login") },
            modifier = Modifier
                .width(350.dp)
                .height(50.dp)
                .padding(horizontal = 20.dp)
                .background(
                    brush = Brush.horizontalGradient(
                        colors = listOf(
                            Color(0xFF6F4A48),
                            Color(0xFFE7D2A9),
                        )
                    ), shape = ButtonDefaults.shape
                )
                .height(ButtonDefaults.MinHeight),

            colors = ButtonDefaults.buttonColors(containerColor = Color.Transparent)
        ) {
            Text(
                text = "войти",
                fontSize = 16.sp,
                fontWeight = FontWeight.Medium
            )
        }

        Spacer(modifier = Modifier.height(16.dp))
        Button(
            onClick = { navHost.navigate("Registration") },
            modifier = Modifier
                .width(350.dp)
                .height(50.dp)
                .padding(horizontal = 20.dp),
            colors = ButtonDefaults.buttonColors(
              Color(0xFF6F4A48),
                contentColor = Color.White
            ),
            shape = ButtonDefaults.shape
        ) {
            Text(
                text = "зарегистрироваться",
                fontSize = 16.sp,
                fontWeight = FontWeight.Medium
            )
        }
        Spacer(modifier = Modifier.height(16.dp))
        Text(
            text = "нет аккаунта? нажмите зарегистрироваться",
            fontSize = 12.sp,
        )
    }
}