//
//  MainMenuView.swift
//  DouShouQiIOS
//
//  Created by Pierre FERREIRA on 21/05/2024.
//

import SwiftUI

struct MainMenuView: View {
    @Environment(\.colorScheme) var colorScheme

    var body: some View {
        NavigationStack {
            
            ZStack {
                Rectangle().fill(Color.bgColor).ignoresSafeArea()
                VStack {
                    Image("DouShouQi")
                        .resizable()
                        .aspectRatio(contentMode: .fit)
                        .frame(width: 200, height: 200)
                    
                    
                    Text("DouShouQi")
                        .font(.largeTitle)
                        .bold()
                        .padding()
                    
                    NavButton("Jouer Seul", destinationView: {GameView()})
                        .padding(.top, 10)
                    
                    NavButton("Jouer en Multi", destinationView: {GameView()})
                    
                    
                    NavButton("Leaderboard", destinationView: {PlayerListView()})
                        .padding(.top, 20)
                    
                    Button(action: {
                        // Quitter
                        print("Quitter tapped!")
                    }
                    ) {
                        Text("Quitter")
                            .font(.title2)
                            .padding()
                            .foregroundColor(.fontColor)
                    }.overlay(
                        RoundedRectangle(cornerRadius: 10)
                            .stroke(Color.primaryColor, lineWidth: 3)
                    )
                    .padding(.top, 20)
                    
                }.navigationBarBackButtonHidden(true)
            }
        }
    }
}

struct MainMenuView_Previews: PreviewProvider {
    static var previews: some View {
        MainMenuView()
    }
}
