اريد تحسين التصميم هنا
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:sms_checker/welcome_screen.dart';

const backgroundColor = Color(0xFFF9F9F9);
const primaryColor = Color(0xFF2C3E50);
const accentColor = Color(0xFFDAA520);
const progressColor = Color(0xFFB87333);

class ModernSplashScreen extends StatefulWidget {
  @override
  _ModernSplashScreenState createState() => _ModernSplashScreenState();
}

class _ModernSplashScreenState extends State<ModernSplashScreen>
    with SingleTickerProviderStateMixin {
  late AnimationController _controller;
  late Animation<double> _animScale;
  late Animation<double> _animOpacity;
  late Animation<double> _animTextOpacity;
  late Animation<double> _animProgressWidth;

  @override
  void initState() {
    super.initState();

    _controller = AnimationController(
      vsync: this,
      duration: Duration(milliseconds: 1800),
    );

    _animScale = Tween<double>(
      begin: 0.85,
      end: 1.0,
    ).animate(CurvedAnimation(parent: _controller, curve: Curves.easeOutBack));

    _animOpacity = Tween<double>(
      begin: 0.0,
      end: 1.0,
    ).animate(CurvedAnimation(parent: _controller, curve: Curves.easeIn));

    _animTextOpacity = Tween<double>(begin: 0.0, end: 1.0).animate(
      CurvedAnimation(
        parent: _controller,
        curve: Interval(0.3, 0.9, curve: Curves.easeIn),
      ),
    );

    _animProgressWidth = Tween<double>(begin: 0.0, end: 1.0).animate(
      CurvedAnimation(
        parent: _controller,
        curve: Interval(0.5, 1.0, curve: Curves.easeInOut),
      ),
    );

    _controller.forward();

    Timer(Duration(seconds: 3), () {
      Navigator.of(
        context,
      ).pushReplacement(MaterialPageRoute(builder: (_) => SplashScreen()));
    });
  }

  @override
  void dispose() {
    _controller.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    final size = MediaQuery.of(context).size;

    return Scaffold(
      backgroundColor: backgroundColor,
      body: Stack(
        children: [
          // المحتوى الرئيسي
          Center(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                // الشعار
                ScaleTransition(
                  scale: _animScale,
                  child: Container(
                    width: 130,
                    height: 130,
                    child: Image.asset(
                      'assets/vibrafone_logo.png',
                      fit: BoxFit.contain,
                    ),
                  ),
                ),

                SizedBox(height: 28),

                // اسم التطبيق
                FadeTransition(
                  opacity: _animOpacity,
                  child: Text(
                    'Vibrafone',
                    style: TextStyle(
                      fontFamily: 'Tajawal',
                      fontWeight: FontWeight.w700,
                      fontSize: 34,
                      color: primaryColor,
                      letterSpacing: 0.8,
                    ),
                  ),
                ),

                SizedBox(height: 16),

                // وصف التطبيق
                FadeTransition(
                  opacity: _animTextOpacity,
                  child: Container(
                    width: size.width * 0.7,
                    child: Column(
                      children: [
                        Text(
                          'الحلول الذكية للاتصالات',
                          textAlign: TextAlign.center,
                          style: TextStyle(
                            fontFamily: 'Tajawal',
                            fontSize: 16,
                            fontWeight: FontWeight.w500,
                            color: primaryColor.withOpacity(0.85),
                            height: 1.5,
                          ),
                        ),
                        SizedBox(height: 4),
                        Text(
                          'وخدمات الجوال المبتكرة',
                          textAlign: TextAlign.center,
                          style: TextStyle(
                            fontFamily: 'Tajawal',
                            fontSize: 16,
                            fontWeight: FontWeight.w500,
                            color: primaryColor.withOpacity(0.85),
                            height: 1.5,
                          ),
                        ),
                      ],
                    ),
                  ),
                ),

                SizedBox(height: 40),

                // شريط التقدم
                Container(
                  width: 200,
                  height: 3,
                  decoration: BoxDecoration(
                    borderRadius: BorderRadius.circular(2),
                    color: accentColor.withOpacity(0.15),
                  ),
                  child: AnimatedBuilder(
                    animation: _controller,
                    builder: (context, _) {
                      return Align(
                        alignment: Alignment.centerLeft,
                        child: Container(
                          width: _animProgressWidth.value * 200,
                          height: 3,
                          decoration: BoxDecoration(
                            borderRadius: BorderRadius.circular(2),
                            color: progressColor,
                          ),
                        ),
                      );
                    },
                  ),
                ),
              ],
            ),
          ),

          // حقوق الملكية
          Positioned(
            bottom: 24,
            left: 0,
            right: 0,
            child: FadeTransition(
              opacity: _animOpacity,
              child: Text(
                '© 2025 Vibrafone. All Rights Reserved',
                textAlign: TextAlign.center,
                style: TextStyle(
                  fontFamily: 'Tajawal',
                  fontSize: 11,
                  color: primaryColor.withOpacity(0.35),
                ),
              ),
            ),
          ),
        ],
      ),
    );
  }
}