package ru.forbion.f7cloud.core.designsystem

import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
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.clip
import androidx.compose.ui.draw.shadow
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp

/**
 * Зелёная круглая кнопка «+» — единый элемент создания в шапках экранов
 * (Почта/Файлы/Контакты/…). Градиент Primary, как у других зелёных кнопок.
 */
@Composable
fun F7CreateButton(
    onClick: () -> Unit,
    modifier: Modifier = Modifier,
    size: Dp = 44.dp,
) {
    Box(
        modifier = modifier
            .size(size)
            .shadow(3.dp, CircleShape, spotColor = F7Colors.Primary.copy(alpha = 0.25f))
            .clip(CircleShape)
            .background(
                Brush.linearGradient(
                    listOf(F7Colors.PrimaryGradientStart, F7Colors.PrimaryGradientEnd),
                ),
            )
            .border(1.dp, F7Colors.Primary.copy(alpha = 0.22f), CircleShape)
            .clickable(onClick = onClick),
        contentAlignment = Alignment.Center,
    ) {
        Text(
            text = "+",
            color = Color.White,
            fontSize = 26.sp,
            fontWeight = FontWeight.Light,
        )
    }
}
