import SwiftUI

struct RecommendedVoicesView: View {
    @Environment(\.dismiss) var dismiss
    
    var body: some View {
        NavigationView {
            List {
                Section(header: Text("English (United States)")) {
                    VoiceRecommendationRow(
                        name: "Alex",
                        details: "Male, High Quality",
                        description: "The smartest voice on iOS; breathes between sentences, sounds academic and very natural."
                    )
                    VoiceRecommendationRow(
                        name: "Samantha",
                        details: "Female, Standard",
                        description: "The classic \"original Siri\" voice; clear and friendly but slightly computerized."
                    )
                    VoiceRecommendationRow(
                        name: "Ava",
                        details: "Female, Premium",
                        description: "A modern, high-quality voice that sounds professional, warm, and very human-like."
                    )
                    VoiceRecommendationRow(
                        name: "Allison",
                        details: "Female, Premium",
                        description: "A lighter, breathy, and pleasant voice; sounds like a helpful assistant."
                    )
                    VoiceRecommendationRow(
                        name: "Tom",
                        details: "Male, Premium",
                        description: "A friendly, standard American male voice; clear and trustworthy."
                    )
                    VoiceRecommendationRow(
                        name: "Susan",
                        details: "Female, Standard/Premium",
                        description: "A slightly more formal and crisp voice; sounds like a teacher or automated reader."
                    )
                    VoiceRecommendationRow(
                        name: "Zoe",
                        details: "Female, Premium",
                        description: "A bright, cheerful, and younger-sounding voice; energetic vibe."
                    )
                    VoiceRecommendationRow(
                        name: "Evan",
                        details: "Male, Enhanced",
                        description: "A deep, smooth, and modern voice; very natural sounding."
                    )
                    VoiceRecommendationRow(
                        name: "Nathan",
                        details: "Male, Enhanced",
                        description: "A lighter, younger-sounding male voice; casual and friendly."
                    )
                    VoiceRecommendationRow(
                        name: "Noelle",
                        details: "Female, Enhanced",
                        description: "A soft, sweet, and modern female voice; very smooth flow."
                    )
                    VoiceRecommendationRow(
                        name: "Joelle",
                        details: "Female, Enhanced",
                        description: "A clear, articulate, and slightly deeper modern female voice."
                    )
                    VoiceRecommendationRow(
                        name: "Aaron (Siri Voice 2)",
                        details: "Male, Neural",
                        description: "The current standard American Male Siri voice; distinct, helpful, and highly polished."
                    )
                    VoiceRecommendationRow(
                        name: "Nicky (Siri Voice 1)",
                        details: "Female, Neural",
                        description: "The current standard American Female Siri voice; recognizable and high-fidelity."
                    )
                }
                
                Section(header: Text("Spanish (Mexico)")) {
                    VoiceRecommendationRow(
                        name: "Paulina",
                        details: "Female, Standard/Premium",
                        description: "The gold standard for Mexican Spanish; sounds like a professional news anchor or navigator."
                    )
                    VoiceRecommendationRow(
                        name: "Juan",
                        details: "Male, Standard/Premium",
                        description: "A clear, neutral male voice; sounds polite but slightly more robotic than Paulina."
                    )
                    VoiceRecommendationRow(
                        name: "Siri Female (Voice 1)",
                        details: "Female, Neural",
                        description: "(If downloaded) Very smooth, natural, and helpful; indistinguishable from a real human assistant."
                    )
                    VoiceRecommendationRow(
                        name: "Siri Male (Voice 2)",
                        details: "Male, Neural",
                        description: "(If downloaded) A professional, modern male assistant voice with a Mexican accent."
                    )
                }
            }
            .navigationTitle("Recommended Voices")
            .toolbar {
                ToolbarItem(placement: .navigationBarTrailing) {
                    Button("Done") {
                        dismiss()
                    }
                }
            }
        }
    }
}

struct VoiceRecommendationRow: View {
    let name: String
    let details: String
    let description: String
    
    var body: some View {
        VStack(alignment: .leading, spacing: 4) {
            HStack {
                Text(name)
                    .font(.headline)
                Spacer()
                Text(details)
                    .font(.caption)
                    .padding(4)
                    .background(Color.blue.opacity(0.1))
                    .cornerRadius(4)
                    .foregroundColor(.blue)
            }
            Text(description)
                .font(.subheadline)
                .foregroundColor(.secondary)
        }
        .padding(.vertical, 4)
    }
}
