import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:niogu_ecommerce_v1/core/constant/app_color.dart';
import 'package:niogu_ecommerce_v1/core/constant/app_font_size.dart';
import 'package:niogu_ecommerce_v1/core/router/app_route.dart';
import 'package:sizer/sizer.dart';

class LoginAuthModal extends StatelessWidget {
  const LoginAuthModal({super.key});

  @override
  Widget build(BuildContext context) {
    return SafeArea(
      top: false,
      bottom: true,
      right: false,
      left: false,
      child: Container(
        width: double.infinity,
        constraints: BoxConstraints(maxWidth: double.infinity),
        padding: EdgeInsets.symmetric(horizontal: 7.w, vertical: 3.h),
        decoration: BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.only(
            topLeft: Radius.circular(5.w),
            topRight: Radius.circular(5.w),
          ),
        ),
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            Container(
              width: 10.w,
              height: 4,
              decoration: BoxDecoration(
                color: Colors.grey.shade300,
                borderRadius: BorderRadius.circular(2.w),
              ),
            ),
            SizedBox(height: 3.h),

            Container(
              padding: EdgeInsets.all(5.w),
              decoration: BoxDecoration(
                color: AppColor.primaryColor.withOpacity(0.1),
                shape: BoxShape.circle,
              ),
              child: Icon(
                Icons.lock_person_outlined,
                size: 12.w,
                color: AppColor.primaryColor,
              ),
            ),
            SizedBox(height: 2.5.h),

            Text(
              "Belum Masuk Akun",
              style: TextStyle(
                fontSize: AppFontSize.medium.sp,
                fontWeight: FontWeight.bold,
                color: Colors.black87,
              ),
            ),
            SizedBox(height: 1.h),
            Text(
              "Silakan masuk ke akunmu terlebih dahulu untuk melanjutkan proses checkout pesanan.",
              textAlign: TextAlign.center,
              style: TextStyle(
                fontSize: AppFontSize.small.sp,
                color: Colors.grey.shade600,
                height: 1.4,
              ),
            ),
            SizedBox(height: 4.h),

            SizedBox(
              width: double.infinity,
              child: ElevatedButton(
                onPressed: () {
                  context.pop();
                  context.pushNamed(AppRoute.loginScreen);
                },
                style: ElevatedButton.styleFrom(
                  backgroundColor: AppColor.primaryColor,
                  padding: EdgeInsets.symmetric(vertical: 1.8.h),
                  shape: RoundedRectangleBorder(
                    borderRadius: BorderRadius.circular(2.5.w),
                  ),
                  elevation: 0,
                ),
                child: Text(
                  "Masuk Akun",
                  style: TextStyle(
                    fontSize: AppFontSize.small.sp,
                    fontWeight: FontWeight.bold,
                    color: Colors.white,
                  ),
                ),
              ),
            ),
            SizedBox(height: 1.5.h),

            SizedBox(
              width: double.infinity,
              child: OutlinedButton(
                onPressed: () {
                  context.pop();
                  context.pushNamed(AppRoute.registerScreen);
                },
                style: OutlinedButton.styleFrom(
                  side: const BorderSide(color: AppColor.primaryColor),
                  padding: EdgeInsets.symmetric(vertical: 1.8.h),
                  shape: RoundedRectangleBorder(
                    borderRadius: BorderRadius.circular(2.5.w),
                  ),
                ),
                child: Text(
                  "Daftar Sekarang",
                  style: TextStyle(
                    fontSize: AppFontSize.small.sp,
                    fontWeight: FontWeight.bold,
                    color: AppColor.primaryColor,
                  ),
                ),
              ),
            ),
            SizedBox(height: 1.h),
          ],
        ),
      ),
    );
  }
}
