import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import '../../core/app_colors.dart';
import '../components/custom_app_bar.dart';

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        width: double.infinity,
        decoration: const BoxDecoration(
          gradient: AppColors.phoneScreenBg,
        ),
        child: SafeArea(
          child: Column(
            children: [
              const SizedBox(height: 16),
              Padding(
                padding: const EdgeInsets.symmetric(horizontal: 20),
                child: CustomAppBar(title: "Сканирование QR-кода"),
              ),

              Expanded(
                child: Padding(
                  padding: const EdgeInsets.symmetric(horizontal: 30),
                  child: Column(
                    children: [
                      const SizedBox(height: 40),
                      const Text(
                        "Наведите рамку сканера на QR-код -\nномер будет распознан автоматически",
                        textAlign: TextAlign.center,
                        style: TextStyle(
                          color: AppColors.whiteText,
                          fontSize: 16,
                          height: 1.4,
                        ),
                      ),
                      const Spacer(),
                      Image.asset(
                        "assets/qr_phone_img.png",
                        height: 300,
                        fit: BoxFit.contain,
                      ),
                      const Spacer(),

                      Container(
                        width: double.infinity,
                        height: 56,
                        decoration: BoxDecoration(
                          borderRadius: BorderRadius.circular(30),
                          gradient: const LinearGradient(
                            colors: [Color(0xFF8EFEB5), Color(0xFF86FEF1)],
                          ),
                        ),
                        child: ElevatedButton(
                          onPressed: () {
                            context.push("/home/qr-info/qr-scan");
                          },
                          style: ElevatedButton.styleFrom(
                            backgroundColor: Colors.transparent,
                            shadowColor: Colors.transparent,
                            shape: RoundedRectangleBorder(
                              borderRadius: BorderRadius.circular(30),
                            ),
                          ),
                          child: const Text(
                            "Продолжить",
                            style: TextStyle(
                              color: Color(0xFF1D273A),
                              fontSize: 16,
                              fontWeight: FontWeight.bold,
                            ),
                          ),
                        ),
                      ),
                      const SizedBox(height: 16),

                      // Кнопка "Ввести номер вручную"
                      SizedBox(
                        width: double.infinity,
                        height: 56,
                        child: OutlinedButton(
                          onPressed: () => context.push("/home/qr-info/qr-input"),
                          style: OutlinedButton.styleFrom(
                            side: const BorderSide(color: Colors.white70),
                            shape: RoundedRectangleBorder(
                              borderRadius: BorderRadius.circular(30),
                            ),
                          ),
                          child: const Text(
                            "Ввести номер вручную",
                            style: TextStyle(
                              color: AppColors.whiteText,
                              fontSize: 16,
                            ),
                          ),
                        ),
                      ),
                      const SizedBox(height: 40),
                    ],
                  ),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}