import SwiftUI

struct WelcomeStepView: View {
    var onNext: () -> Void

    var body: some View {
        VStack(spacing: 32) {
            Spacer()

            AppIconPlaceholder(size: 120)

            VStack(spacing: 12) {
                Text("onboarding_welcome_subtitle")
                    .font(.mealMoodBody)
                    .foregroundColor(.mealMoodTextSecondary)
                    .multilineTextAlignment(.center)
            }
            .padding(.horizontal, 24)

            VStack(alignment: .leading, spacing: 16) {
                BenefitRow(icon: "1.circle.fill", text: String(localized: "onboarding_welcome_step_1"))
                BenefitRow(icon: "2.circle.fill", text: String(localized: "onboarding_welcome_step_2"))
                BenefitRow(icon: "3.circle.fill", text: String(localized: "onboarding_welcome_step_3"))
                BenefitRow(icon: "4.circle.fill", text: String(localized: "onboarding_welcome_step_4"))
            }
            .padding(.horizontal, 40)

            Spacer()

            PrimaryButton(title: String(localized: "onboarding_start"), icon: "✨", action: onNext)
                .padding(.horizontal, 24)
                .padding(.bottom, 40)
        }
        .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .top)
    }
}

private struct BenefitRow: View {
    let icon: String
    let text: String

    var body: some View {
        HStack(spacing: 12) {
            Image(systemName: icon)
                .font(.system(size: 20))
                .foregroundColor(.mealMoodCoral)
                .frame(width: 28)

            Text(text)
                .font(.mealMoodBody)
                .foregroundColor(.mealMoodTextPrimary)
        }
    }
}
