package com.example.ui.customer import android.content.Intent import android.net.Uri import androidx.compose.foundation.Image import androidx.compose.foundation.background import androidx.compose.foundation.border import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.PaddingValues 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.layout.size import androidx.compose.foundation.layout.width import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.material.icons.Icons import androidx.compose.material.icons.automirrored.filled.ArrowForwardIos import androidx.compose.material.icons.automirrored.filled.Help import androidx.compose.material.icons.filled.AccountBalanceWallet import androidx.compose.material.icons.filled.AdminPanelSettings import androidx.compose.material.icons.filled.Call import androidx.compose.material.icons.filled.CardGiftcard import androidx.compose.material.icons.filled.Close import androidx.compose.material.icons.filled.Description import androidx.compose.material.icons.filled.Favorite import androidx.compose.material.icons.filled.History import androidx.compose.material.icons.filled.Home import androidx.compose.material.icons.filled.Info import androidx.compose.material.icons.filled.LiveHelp import androidx.compose.material.icons.filled.LocationOn import androidx.compose.material.icons.filled.Lock import androidx.compose.material.icons.filled.Logout import androidx.compose.material.icons.filled.Person import androidx.compose.material.icons.filled.Policy import androidx.compose.material.icons.filled.PowerSettingsNew import androidx.compose.material.icons.filled.QrCode import androidx.compose.material.icons.filled.Receipt import androidx.compose.material.icons.filled.Security import androidx.compose.material.icons.filled.Share import androidx.compose.material.icons.filled.ShoppingBag import com.example.util.ShareAppHelper import androidx.compose.material.icons.filled.Star import androidx.compose.material.icons.filled.SupportAgent import androidx.compose.material3.AlertDialog import androidx.compose.material3.Button import androidx.compose.material3.ButtonDefaults import androidx.compose.material3.Card import androidx.compose.material3.CardDefaults import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.Icon import androidx.compose.material3.IconButton import androidx.compose.material3.OutlinedButton import androidx.compose.material3.OutlinedTextField import androidx.compose.material3.OutlinedTextFieldDefaults import androidx.compose.material3.Surface import androidx.compose.material3.Text import androidx.compose.material3.TextButton import androidx.activity.compose.rememberLauncherForActivityResult import androidx.activity.result.PickVisualMediaRequest import androidx.activity.result.contract.ActivityResultContracts import coil.compose.AsyncImage import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue 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.Color import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.painterResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import com.example.R import com.example.ui.theme.AccentGold import com.example.ui.theme.AccentOrange import com.example.ui.theme.FreshVegGreen import com.example.ui.theme.LoveBlack import com.example.ui.theme.LoveRedPrimary import com.example.ui.theme.TextPrimary import com.example.ui.theme.TextSecondary import com.example.ui.customer.auth.AuthContainer import com.example.viewmodel.AuthViewModel import com.example.viewmodel.CustomerNavScreen import com.example.viewmodel.CustomerViewModel @Composable fun AccountScreen( customerViewModel: CustomerViewModel, authViewModel: AuthViewModel, onOpenAdminPortal: () -> Unit, onLogout: () -> Unit, modifier: Modifier = Modifier ) { val context = LocalContext.current val user by customerViewModel.currentUser.collectAsState() val orders by customerViewModel.allOrders.collectAsState() if (!user.isLoggedIn) { AuthContainer( authViewModel = authViewModel, onAuthenticated = { // Refresh or handle post-login if needed } ) return } var showSupportModal by remember { mutableStateOf(false) } var showAddressModal by remember { mutableStateOf(false) } var showWalletModal by remember { mutableStateOf(false) } var showReferModal by remember { mutableStateOf(false) } var showLogoutDialog by remember { mutableStateOf(false) } var showAdminPinDialog by remember { mutableStateOf(false) } var adminPinInput by remember { mutableStateOf("") } var adminPinError by remember { mutableStateOf(null) } var infoDialogTitle by remember { mutableStateOf(null) } var infoDialogContent by remember { mutableStateOf(null) } val photoPickerLauncher = rememberLauncherForActivityResult( contract = ActivityResultContracts.PickVisualMedia(), onResult = { uri -> uri?.let { customerViewModel.updateProfilePicture(it.toString()) } } ) LazyColumn( modifier = modifier .fillMaxSize() .background(Color(0xFFF8F9FD)), contentPadding = PaddingValues(bottom = 96.dp) ) { // User Profile Header item { Card( shape = RoundedCornerShape(bottomStart = 24.dp, bottomEnd = 24.dp), colors = CardDefaults.cardColors(containerColor = Color.White), elevation = CardDefaults.cardElevation(defaultElevation = 2.dp), modifier = Modifier.fillMaxWidth() ) { Column( modifier = Modifier .fillMaxWidth() .padding(20.dp) ) { Text( text = "MY ACCOUNT", fontSize = 11.sp, fontWeight = FontWeight.Bold, color = TextSecondary, letterSpacing = 1.sp ) Spacer(modifier = Modifier.height(14.dp)) Row(verticalAlignment = Alignment.CenterVertically) { Box( modifier = Modifier .size(64.dp) .clip(CircleShape) .background(Color(0xFFFFF1F2)) .border(2.dp, LoveRedPrimary, CircleShape) .clickable { photoPickerLauncher.launch( PickVisualMediaRequest(ActivityResultContracts.PickVisualMedia.ImageOnly) ) }, contentAlignment = Alignment.Center ) { if (user.profileImageUri.isNotBlank()) { AsyncImage( model = user.profileImageUri, contentDescription = "Profile DP", modifier = Modifier.fillMaxSize(), contentScale = ContentScale.Crop ) } else { Icon( imageVector = Icons.Default.Person, contentDescription = "Avatar", tint = LoveRedPrimary, modifier = Modifier.size(36.dp) ) } } Spacer(modifier = Modifier.width(14.dp)) Column { Text( text = user.name, fontWeight = FontWeight.Black, fontSize = 18.sp, color = TextPrimary ) Text( text = user.phone, fontSize = 12.sp, color = TextSecondary ) Text( text = user.email, fontSize = 12.sp, color = TextSecondary ) } } Spacer(modifier = Modifier.height(18.dp)) // 3 Stat Cards (Wallet, Orders, Saved Places) matching video at 00:38 Row( modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.spacedBy(10.dp) ) { ProfileStatCard( title = "Wallet", value = "₹%.1f".format(user.walletBalance), icon = Icons.Default.AccountBalanceWallet, color = FreshVegGreen, modifier = Modifier .weight(1f) .clickable { showWalletModal = true } .testTag("account_wallet_stat_card") ) ProfileStatCard( title = "Orders", value = "${orders.size} Total", icon = Icons.Default.History, color = AccentOrange, modifier = Modifier .weight(1f) .clickable { customerViewModel.navigateTo(CustomerNavScreen.Orders) } ) ProfileStatCard( title = "Places", value = "Saved", icon = Icons.Default.LocationOn, color = LoveRedPrimary, modifier = Modifier .weight(1f) .clickable { showAddressModal = true } ) } } } } // Quick Account Actions Section (Cards grid/list) item { Text( text = "MY ACCOUNT", fontSize = 12.sp, fontWeight = FontWeight.Bold, color = TextSecondary, modifier = Modifier.padding(start = 16.dp, top = 20.dp, bottom = 8.dp) ) Card( shape = RoundedCornerShape(16.dp), colors = CardDefaults.cardColors(containerColor = Color.White), elevation = CardDefaults.cardElevation(defaultElevation = 1.dp), modifier = Modifier .fillMaxWidth() .padding(horizontal = 16.dp) ) { Column { AccountActionItem( icon = Icons.Default.ShoppingBag, iconTint = Color(0xFF7C4DFF), title = "My Orders", subtitle = "Track & view order history", onClick = { customerViewModel.navigateTo(CustomerNavScreen.Orders) } ) HorizontalDivider(color = Color(0xFFF1F5F9)) AccountActionItem( icon = Icons.Default.Home, iconTint = Color(0xFF2979FF), title = "Manage Address", subtitle = "Delivery locations", onClick = { showAddressModal = true } ) HorizontalDivider(color = Color(0xFFF1F5F9)) AccountActionItem( icon = Icons.Default.AccountBalanceWallet, iconTint = FreshVegGreen, title = "Love Zone Wallet", subtitle = "Refunds & fast checkout", onClick = { showWalletModal = true } ) HorizontalDivider(color = Color(0xFFF1F5F9)) AccountActionItem( icon = Icons.Default.Favorite, iconTint = LoveRedPrimary, title = "My Favourites", subtitle = "Loved dishes and combos", onClick = { customerViewModel.navigateTo(CustomerNavScreen.Menu) } ) HorizontalDivider(color = Color(0xFFF1F5F9)) AccountActionItem( icon = Icons.Default.CardGiftcard, iconTint = AccentOrange, title = "Refer & Earn", subtitle = "Invite friends, earn ₹50 each", onClick = { showReferModal = true } ) } } } // Help & FAQs Section item { Text( text = "HELP & SUPPORT", fontSize = 12.sp, fontWeight = FontWeight.Bold, color = TextSecondary, modifier = Modifier.padding(start = 16.dp, top = 20.dp, bottom = 8.dp) ) Card( shape = RoundedCornerShape(16.dp), colors = CardDefaults.cardColors(containerColor = Color.White), elevation = CardDefaults.cardElevation(defaultElevation = 1.dp), modifier = Modifier .fillMaxWidth() .padding(horizontal = 16.dp) ) { Column { AccountActionItem( icon = Icons.Default.SupportAgent, iconTint = LoveRedPrimary, title = "Customer Support", subtitle = "Kumarghat Call & WhatsApp support", onClick = { showSupportModal = true } ) HorizontalDivider(color = Color(0xFFF1F5F9)) AccountActionItem( icon = Icons.Default.Policy, iconTint = Color(0xFF455A64), title = "Privacy Policy", subtitle = "How your information is protected", onClick = { infoDialogTitle = "Privacy Policy" infoDialogContent = "Love Zone Restaurant is committed to protecting your privacy. We collect only necessary details (name, delivery address, phone) to fulfill your orders safely and contact you regarding delivery." } ) HorizontalDivider(color = Color(0xFFF1F5F9)) AccountActionItem( icon = Icons.Default.Description, iconTint = Color(0xFF455A64), title = "Terms & Conditions", subtitle = "Usage rules and customer guidelines", onClick = { infoDialogTitle = "Terms & Conditions" infoDialogContent = "By placing an order on Love Zone Restaurant app, you agree to prompt delivery acceptance, hygiene standards, and valid payment via UPI or Cash on Delivery." } ) HorizontalDivider(color = Color(0xFFF1F5F9)) AccountActionItem( icon = Icons.Default.LiveHelp, iconTint = Color(0xFF455A64), title = "FAQ & Cancellation Policy", subtitle = "Questions, refunds and cancellations", onClick = { infoDialogTitle = "Cancellation & Refund Policy" infoDialogContent = "Orders can be cancelled before kitchen preparation starts. Refunds for UPI payments are credited to your Love Zone wallet instantly or bank account within 24 hours." } ) } } } // Logout Button item { Spacer(modifier = Modifier.height(16.dp)) Surface( color = Color(0xFFFFEBEE), shape = RoundedCornerShape(14.dp), modifier = Modifier .fillMaxWidth() .padding(horizontal = 16.dp) .clickable { showLogoutDialog = true } .testTag("account_logout_button") ) { Row( modifier = Modifier.padding(vertical = 14.dp, horizontal = 16.dp), verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.Center ) { Icon( imageVector = Icons.Default.PowerSettingsNew, contentDescription = "Logout", tint = LoveRedPrimary, modifier = Modifier.size(20.dp) ) Spacer(modifier = Modifier.width(8.dp)) Text( text = "Logout", fontWeight = FontWeight.Bold, fontSize = 14.sp, color = LoveRedPrimary ) } } } // Footer & Admin Entrance (Only visible to admin phone 7005149514) val phoneDigits = user.phone.filter { it.isDigit() }.let { if (it.length > 10) it.takeLast(10) else it } val isOwnerAdmin = (phoneDigits == "7005149514") if (isOwnerAdmin) { item { Spacer(modifier = Modifier.height(24.dp)) Column( modifier = Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally ) { Text( text = "LOVE ZONE RESTAURANT • V2.0", fontSize = 12.sp, fontWeight = FontWeight.Bold, color = Color.Gray, modifier = Modifier.clickable { showAdminPinDialog = true } ) Text( text = "Crafted for food lovers with passion", fontSize = 10.sp, color = Color.LightGray ) Spacer(modifier = Modifier.height(14.dp)) // Staff / Owner Access button with PIN protection OutlinedButton( onClick = { showAdminPinDialog = true }, shape = RoundedCornerShape(20.dp), colors = ButtonDefaults.outlinedButtonColors(contentColor = Color(0xFF374151)), contentPadding = PaddingValues(horizontal = 14.dp, vertical = 6.dp), modifier = Modifier.testTag("admin_portal_access_button") ) { Icon( imageVector = Icons.Default.Lock, contentDescription = "Staff", modifier = Modifier.size(14.dp), tint = LoveRedPrimary ) Spacer(modifier = Modifier.width(6.dp)) Text( text = "Restaurant Staff / Admin Portal", fontSize = 11.sp, fontWeight = FontWeight.SemiBold ) } } } } } // Refer & Earn Modal if (showReferModal) { val referralCode = "LOVE-${user.phone.takeLast(4).ifEmpty { "2026" }}" val referralLink = ShareAppHelper.getDownloadUrl(referralCode) AlertDialog( onDismissRequest = { showReferModal = false }, title = { Row( modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically ) { Text(text = "Refer & Earn ₹50", fontWeight = FontWeight.Bold, fontSize = 16.sp) IconButton(onClick = { showReferModal = false }) { Icon(Icons.Default.Close, contentDescription = "Close") } } }, text = { Column( modifier = Modifier.fillMaxWidth(), verticalArrangement = Arrangement.spacedBy(12.dp), horizontalAlignment = Alignment.CenterHorizontally ) { Text( text = "Invite friends to Love Zone Restaurant! When your friend places their 1st order using your referral link, you both receive ₹50 Love Cash.", fontSize = 12.sp, color = TextSecondary, textAlign = TextAlign.Center ) Surface( color = Color(0xFFFFF1F2), shape = RoundedCornerShape(12.dp), border = androidx.compose.foundation.BorderStroke(1.dp, LoveRedPrimary), modifier = Modifier.fillMaxWidth() ) { Column( modifier = Modifier.padding(12.dp), horizontalAlignment = Alignment.CenterHorizontally ) { Text(text = "Your Referral Code", fontSize = 11.sp, color = TextSecondary) Spacer(modifier = Modifier.height(2.dp)) Text(text = referralCode, fontSize = 18.sp, fontWeight = FontWeight.Black, color = LoveRedPrimary) } } Surface( color = Color(0xFFF8FAFC), shape = RoundedCornerShape(10.dp), border = androidx.compose.foundation.BorderStroke(1.dp, Color(0xFFE2E8F0)), modifier = Modifier.fillMaxWidth() ) { Column(modifier = Modifier.padding(10.dp)) { Text(text = "Shareable APK Download Link", fontSize = 10.sp, color = TextSecondary) Spacer(modifier = Modifier.height(2.dp)) Text(text = referralLink, fontSize = 11.sp, fontWeight = FontWeight.SemiBold, color = TextPrimary) } } Button( onClick = { ShareAppHelper.shareApp(context, referralCode = referralCode) }, colors = ButtonDefaults.buttonColors(containerColor = LoveRedPrimary), shape = RoundedCornerShape(10.dp), modifier = Modifier.fillMaxWidth().height(42.dp) ) { Icon(Icons.Default.CardGiftcard, contentDescription = null, modifier = Modifier.size(16.dp)) Spacer(modifier = Modifier.width(6.dp)) Text(text = "Share Referral Link / WhatsApp", fontWeight = FontWeight.Bold, fontSize = 12.sp) } } }, confirmButton = { Button( onClick = { showReferModal = false }, colors = ButtonDefaults.buttonColors(containerColor = LoveRedPrimary) ) { Text("Close") } } ) } // Zone-Wise Customer Support Modal (Faithfully recreating the screen from video at 00:45) if (showSupportModal) { ZoneWiseSupportModal( onDismiss = { showSupportModal = false }, onCall = { number -> val intent = Intent(Intent.ACTION_DIAL, Uri.parse("tel:$number")) try { context.startActivity(intent) } catch (_: Exception) {} }, onWhatsApp = { number -> val intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://api.whatsapp.com/send?phone=$number&text=Hello%20Love%20Zone%20Restaurant")) try { context.startActivity(intent) } catch (_: Exception) {} } ) } // Manage Address Dialog if (showAddressModal) { AlertDialog( onDismissRequest = { showAddressModal = false }, title = { Text("Delivery Address", fontWeight = FontWeight.Bold) }, text = { Column { Text(text = "Current Address:", fontSize = 12.sp, color = TextSecondary) Spacer(modifier = Modifier.height(6.dp)) Surface( color = Color(0xFFF1F5F9), shape = RoundedCornerShape(10.dp), modifier = Modifier.fillMaxWidth().padding(vertical = 4.dp) ) { Column(modifier = Modifier.padding(10.dp)) { Text(text = user.name, fontWeight = FontWeight.Bold, fontSize = 13.sp) Text(text = user.address, fontSize = 12.sp, color = TextSecondary) Text(text = user.phone, fontSize = 11.sp, color = LoveRedPrimary) } } } }, confirmButton = { Button( onClick = { showAddressModal = false }, colors = ButtonDefaults.buttonColors(containerColor = LoveRedPrimary) ) { Text("Done") } } ) } // Love Zone Wallet Dialog (matching video at 00:54) if (showWalletModal) { AlertDialog( onDismissRequest = { showWalletModal = false }, title = { Row( modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically ) { Text("LOVE ZONE WALLET", fontWeight = FontWeight.Bold, fontSize = 16.sp) IconButton(onClick = { showWalletModal = false }) { Icon(Icons.Default.Close, contentDescription = "Close") } } }, text = { Column( modifier = Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally ) { Surface( color = Color(0xFFF8FAFC), shape = RoundedCornerShape(12.dp), border = androidx.compose.foundation.BorderStroke(1.dp, Color(0xFFE2E8F0)), modifier = Modifier.fillMaxWidth() ) { Row( modifier = Modifier.padding(16.dp), horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically ) { Text(text = "Love Zone Money", fontWeight = FontWeight.SemiBold, fontSize = 14.sp) Text( text = "₹%.1f".format(user.walletBalance), fontWeight = FontWeight.Black, fontSize = 16.sp, color = LoveRedPrimary ) } } Spacer(modifier = Modifier.height(26.dp)) Text( text = "No Wallet Transactions Yet!!!", fontSize = 13.sp, color = TextSecondary, fontWeight = FontWeight.Medium ) } }, confirmButton = { Button( onClick = { showWalletModal = false }, colors = ButtonDefaults.buttonColors(containerColor = LoveRedPrimary) ) { Text("Close") } } ) } // Logout Dialog if (showLogoutDialog) { AlertDialog( onDismissRequest = { showLogoutDialog = false }, title = { Text("Logout?", fontWeight = FontWeight.Bold) }, text = { Text("Are you sure you want to log out? You will need to enter your phone number to sign in again.") }, confirmButton = { Button( onClick = { showLogoutDialog = false customerViewModel.repository.logoutUser() onLogout() }, colors = ButtonDefaults.buttonColors(containerColor = LoveRedPrimary) ) { Text("Yes, Log Out") } }, dismissButton = { TextButton(onClick = { showLogoutDialog = false }) { Text("Go Back", color = TextSecondary) } } ) } // Admin Access PIN Dialog if (showAdminPinDialog) { AlertDialog( onDismissRequest = { showAdminPinDialog = false adminPinInput = "" adminPinError = null }, title = { Row(verticalAlignment = Alignment.CenterVertically) { Icon(Icons.Default.AdminPanelSettings, contentDescription = null, tint = LoveRedPrimary) Spacer(modifier = Modifier.width(8.dp)) Text("Admin / Staff Login", fontWeight = FontWeight.Bold, fontSize = 16.sp) } }, text = { Column { Text( text = "Enter Admin PIN to access Restaurant Staff / Admin Portal.", fontSize = 12.sp, color = TextSecondary ) Spacer(modifier = Modifier.height(12.dp)) OutlinedTextField( value = adminPinInput, onValueChange = { if (it.length <= 6) adminPinInput = it }, label = { Text("Admin PIN") }, keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.NumberPassword), singleLine = true, shape = RoundedCornerShape(10.dp), colors = OutlinedTextFieldDefaults.colors( focusedTextColor = Color(0xFF1E2022), unfocusedTextColor = Color(0xFF1E2022), focusedContainerColor = Color.White, unfocusedContainerColor = Color(0xFFF8FAFC), cursorColor = LoveRedPrimary, focusedBorderColor = LoveRedPrimary, unfocusedBorderColor = Color(0xFFCBD5E1) ), modifier = Modifier.fillMaxWidth().testTag("admin_pin_input") ) if (adminPinError != null) { Text( text = adminPinError ?: "", color = Color.Red, fontSize = 11.sp, modifier = Modifier.padding(top = 4.dp) ) } } }, confirmButton = { Button( onClick = { if (adminPinInput.trim() == "799264") { showAdminPinDialog = false adminPinInput = "" adminPinError = null onOpenAdminPortal() } else { adminPinError = "Incorrect PIN" } }, colors = ButtonDefaults.buttonColors(containerColor = LoveRedPrimary), modifier = Modifier.testTag("admin_pin_submit") ) { Text("Enter Portal") } }, dismissButton = { TextButton(onClick = { showAdminPinDialog = false }) { Text("Cancel", color = TextSecondary) } } ) } // Generic Info Dialog infoDialogTitle?.let { title -> AlertDialog( onDismissRequest = { infoDialogTitle = null infoDialogContent = null }, title = { Text(title, fontWeight = FontWeight.Bold) }, text = { Text(infoDialogContent ?: "", fontSize = 13.sp, lineHeight = 18.sp) }, confirmButton = { Button( onClick = { infoDialogTitle = null infoDialogContent = null }, colors = ButtonDefaults.buttonColors(containerColor = LoveRedPrimary) ) { Text("OK") } } ) } } @Composable fun ProfileStatCard( title: String, value: String, icon: ImageVector, color: Color, modifier: Modifier = Modifier ) { Surface( color = Color(0xFFF8FAFC), shape = RoundedCornerShape(12.dp), border = androidx.compose.foundation.BorderStroke(1.dp, Color(0xFFE2E8F0)), modifier = modifier ) { Column( modifier = Modifier.padding(horizontal = 8.dp, vertical = 10.dp), horizontalAlignment = Alignment.CenterHorizontally ) { Icon(imageVector = icon, contentDescription = null, tint = color, modifier = Modifier.size(20.dp)) Spacer(modifier = Modifier.height(4.dp)) Text(text = title, fontSize = 10.sp, color = TextSecondary) Text(text = value, fontSize = 12.sp, fontWeight = FontWeight.Bold, color = TextPrimary) } } } @Composable fun AccountActionItem( icon: ImageVector, iconTint: Color, title: String, subtitle: String, onClick: () -> Unit ) { Row( modifier = Modifier .fillMaxWidth() .clickable(onClick = onClick) .padding(horizontal = 14.dp, vertical = 12.dp), verticalAlignment = Alignment.CenterVertically ) { Box( modifier = Modifier .size(36.dp) .background(iconTint.copy(alpha = 0.12f), CircleShape), contentAlignment = Alignment.Center ) { Icon(imageVector = icon, contentDescription = null, tint = iconTint, modifier = Modifier.size(18.dp)) } Spacer(modifier = Modifier.width(12.dp)) Column(modifier = Modifier.weight(1f)) { Text(text = title, fontWeight = FontWeight.SemiBold, fontSize = 13.sp, color = TextPrimary) Text(text = subtitle, fontSize = 11.sp, color = TextSecondary) } Icon( imageVector = Icons.AutoMirrored.Filled.ArrowForwardIos, contentDescription = null, tint = Color(0xFFCBD5E1), modifier = Modifier.size(13.dp) ) } } @Composable fun ZoneWiseSupportModal( onDismiss: () -> Unit, onCall: (String) -> Unit, onWhatsApp: (String) -> Unit ) { val zones = listOf( SupportZone("Kumarghat", "Love Zone Support", "+917005149514", "+917629835103") ) AlertDialog( onDismissRequest = onDismiss, title = { Row( modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically ) { Text(text = "Kumarghat Customer Support", fontWeight = FontWeight.Bold, fontSize = 16.sp) IconButton(onClick = onDismiss) { Icon(Icons.Default.Close, contentDescription = "Close") } } }, text = { Column( modifier = Modifier.fillMaxWidth(), verticalArrangement = Arrangement.spacedBy(10.dp) ) { Text( text = "Get in touch with our Kumarghat regional support representative for order assistance or complaints:", fontSize = 12.sp, color = TextSecondary ) zones.forEach { zone -> Surface( color = Color(0xFF673AB7), shape = RoundedCornerShape(12.dp), modifier = Modifier.fillMaxWidth() ) { Column(modifier = Modifier.padding(10.dp)) { Row(verticalAlignment = Alignment.CenterVertically) { Icon(Icons.Default.LocationOn, contentDescription = null, tint = Color.White, modifier = Modifier.size(16.dp)) Spacer(modifier = Modifier.width(4.dp)) Text(text = zone.zoneName, color = Color.White, fontWeight = FontWeight.Bold, fontSize = 14.sp) } Text(text = "Contact: ${zone.contactPerson}", color = Color(0xFFE1BEE7), fontSize = 11.sp) Spacer(modifier = Modifier.height(8.dp)) Row( modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.spacedBy(8.dp) ) { Button( onClick = { onCall(zone.phone) }, colors = ButtonDefaults.buttonColors(containerColor = LoveRedPrimary), shape = RoundedCornerShape(8.dp), contentPadding = PaddingValues(horizontal = 8.dp, vertical = 4.dp), modifier = Modifier.weight(1f).height(34.dp) ) { Icon(Icons.Default.Call, contentDescription = null, modifier = Modifier.size(14.dp)) Spacer(modifier = Modifier.width(4.dp)) Text("Call Now", fontSize = 11.sp, fontWeight = FontWeight.Bold) } Button( onClick = { onWhatsApp(zone.whatsappPhone) }, colors = ButtonDefaults.buttonColors(containerColor = FreshVegGreen), shape = RoundedCornerShape(8.dp), contentPadding = PaddingValues(horizontal = 8.dp, vertical = 4.dp), modifier = Modifier.weight(1f).height(34.dp) ) { Text("WhatsApp", fontSize = 11.sp, fontWeight = FontWeight.Bold) } } } } } } }, confirmButton = { Button( onClick = onDismiss, colors = ButtonDefaults.buttonColors(containerColor = LoveRedPrimary) ) { Text("Close") } } ) } data class SupportZone( val zoneName: String, val contactPerson: String, val phone: String, val whatsappPhone: String )