import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'managers/sound_manager.dart';
import 'widgets/main_screen.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
    statusBarColor: Colors.transparent,
    statusBarIconBrightness: Brightness.dark,
    systemNavigationBarColor: Colors.transparent,
    systemNavigationBarIconBrightness: Brightness.dark,
  ));
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    SoundManager().init();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Prank Sounds',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        useMaterial3: true,
        fontFamily: 'Roboto',
        colorScheme: ColorScheme.fromSeed(
          seedColor: const Color(0xFF6C63FF),
          brightness: Brightness.light,
          surface: const Color(0xFFF4F6FD),
          primary: const Color(0xFF6C63FF),
          secondary: const Color(0xFF30B0C7),
        ),
        scaffoldBackgroundColor: const Color(0xFFF4F6FD),
        appBarTheme: const AppBarTheme(
          backgroundColor: Colors.transparent,
          elevation: 0,
          scrolledUnderElevation: 0,
          centerTitle: false,
          titleTextStyle: TextStyle(
            color: Color(0xFF1D1D35),
            fontSize: 24,
            fontWeight: FontWeight.w900,
            letterSpacing: -0.5,
          ),
          iconTheme: IconThemeData(color: Color(0xFF1D1D35)),
        ),
      ),
      home: const MainScreen(),
    );
  }
}
