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

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

  @override
  Widget build(BuildContext context) {
    final isTablet = 100.w >= 600;

    return Center(
      child: Padding(
        padding: EdgeInsets.symmetric(horizontal: 10.w),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            Container(
              padding: EdgeInsets.all(5.w),
              decoration: BoxDecoration(
                color: Colors.blue[50],
                shape: BoxShape.circle,
              ),
              child: Icon(
                Icons.lock_person_rounded,
                color: AppColor.primaryColor,
                size: 15.w,
              ),
            ),

            SizedBox(height: 4.h),

            Text(
              "Akses Fitur Terbatas",
              style: TextStyle(
                fontSize: (AppFontSize.medium - (isTablet ? 0 : 1.25)).sp,
                fontWeight: FontWeight.bold,
                color: Colors.black87,
              ),
            ),
            SizedBox(height: 1.5.h),
            Text(
              "Silakan masuk ke akun anda terlebih dahulu untuk mengakses fitur lengkap Niogu.",
              textAlign: TextAlign.center,
              style: TextStyle(
                fontSize: isTablet
                    ? AppFontSize.small.sp
                    : AppFontSize.small.sp,
                color: Colors.grey[600],
                height: 1.5,
              ),
            ),

            SizedBox(height: 6.h),

            SizedBox(
              width: double.infinity,
              height: 7.h,
              child: ElevatedButton.icon(
                onPressed: () {
                  context.goNamed(AppRoute.ownerLoginScreen);
                },
                icon: Icon(Icons.login_rounded, color: Colors.white, size: 5.w),
                label: Text(
                  "Masuk Akun",
                  style: TextStyle(
                    color: Colors.white,
                    fontWeight: FontWeight.bold,
                    fontSize: AppFontSize.medium.sp,
                  ),
                ),
                style: ElevatedButton.styleFrom(
                  backgroundColor: AppColor.primaryColor,
                  shape: RoundedRectangleBorder(
                    borderRadius: BorderRadius.circular(3.w),
                  ),
                  elevation: 2,
                ),
              ),
            ),

            SizedBox(height: 2.h),

            Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                Text(
                  "Belum punya akun? ",
                  style: TextStyle(
                    fontSize: isTablet
                        ? AppFontSize.medium.sp
                        : AppFontSize.small.sp,
                  ),
                ),
                GestureDetector(
                  onTap: () => context.goNamed(AppRoute.registrationScreen),
                  child: Text(
                    "Daftar Sekarang",
                    style: TextStyle(
                      color: AppColor.primaryColor,
                      fontWeight: FontWeight.bold,
                      fontSize: isTablet
                          ? AppFontSize.medium.sp
                          : AppFontSize.small.sp,
                    ),
                  ),
                ),
              ],
            ),
          ],
        ),
      ),
    );
  }
}
