package id.iiyh.inatrading.feature.auth.presentation

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.padding
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import id.iiyh.inatrading.R
import id.iiyh.inatrading.core.ui.components.InaInnerTopAppBar
import id.iiyh.inatrading.core.ui.components.InaPrimaryButton
import id.iiyh.inatrading.core.ui.components.InaTextField
import id.iiyh.inatrading.core.ui.components.InaTertiaryButton
import id.iiyh.inatrading.core.ui.theme.Background
import id.iiyh.inatrading.core.ui.theme.ManropeFontFamily
import id.iiyh.inatrading.core.ui.theme.OnSurfaceVariant

// TODO: Implement sesuai desain yang akan dikirim
@Composable
fun ForgotPasswordScreen(
    onBack: () -> Unit,
) {
    var email by remember { mutableStateOf("") }

    Scaffold(
        topBar = { InaInnerTopAppBar(onBack = onBack) },
        containerColor = Background,
    ) { innerPadding ->
        Column(
            modifier = Modifier
                .fillMaxSize()
                .background(Background)
                .padding(innerPadding)
                .padding(horizontal = 24.dp, vertical = 32.dp),
            verticalArrangement = Arrangement.spacedBy(24.dp),
        ) {
            Column(verticalArrangement = Arrangement.spacedBy(8.dp)) {
                Text(
                    text       = stringResource(R.string.forgot_password_title),
                    fontFamily = ManropeFontFamily,
                    style      = MaterialTheme.typography.headlineMedium,
                )
                Text(
                    text  = stringResource(R.string.forgot_password_desc),
                    style = MaterialTheme.typography.bodyMedium,
                    color = OnSurfaceVariant,
                )
            }

            InaTextField(
                value         = email,
                onValueChange = { email = it },
                label         = stringResource(R.string.login_email_label),
                placeholder   = stringResource(R.string.login_email_placeholder),
            )

            InaPrimaryButton(
                text    = stringResource(R.string.forgot_password_cta),
                onClick = { /* TODO */ },
                enabled = email.isNotBlank(),
            )

            Spacer(modifier = Modifier.weight(1f))

            InaTertiaryButton(
                text    = stringResource(R.string.forgot_password_back_to_login),
                onClick = onBack,
                modifier = Modifier.fillMaxWidth(),
            )
        }
    }
}
