package com.jishisongfu.duobibi.ui.privacy

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
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.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedButton
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.jishisongfu.duobibi.ui.theme.DbbColors

@Composable
fun PrivacyConsentScreen(onAgree: () -> Unit, onReject: () -> Unit) {
    Column(
        Modifier.fillMaxSize().background(MaterialTheme.colorScheme.background).padding(20.dp),
    ) {
        Spacer(Modifier.height(12.dp))
        Text("欢迎使用多比比", fontWeight = FontWeight.ExtraBold, fontSize = 22.sp, color = DbbColors.Ink)
        Spacer(Modifier.height(4.dp))
        Text("多平台比比看,买啥都不吃亏", color = DbbColors.Teal, fontSize = 14.sp, fontWeight = FontWeight.Medium)
        Spacer(Modifier.height(16.dp))
        Column(
            Modifier.weight(1f).fillMaxWidth().verticalScroll(rememberScrollState()),
        ) { PolicyBody() }
        Spacer(Modifier.height(12.dp))
        Button(
            onClick = onAgree,
            modifier = Modifier.fillMaxWidth().height(50.dp), shape = RoundedCornerShape(14.dp),
            colors = ButtonDefaults.buttonColors(containerColor = DbbColors.Teal),
        ) { Text("同意并开始使用", fontWeight = FontWeight.SemiBold, fontSize = 16.sp) }
        Spacer(Modifier.height(8.dp))
        OutlinedButton(
            onClick = onReject,
            modifier = Modifier.fillMaxWidth().height(46.dp), shape = RoundedCornerShape(14.dp),
        ) { Text("不同意并退出", color = DbbColors.InkSec) }
        Spacer(Modifier.height(8.dp))
    }
}
