import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import '../../../core/theme/halo_tokens.dart';
import '../../../core/theme/widgets/halo_button.dart';

/// S11 — landing screen after a session has been closed. Replaces the
/// previous "navigate straight to home" behavior so the user gets a soft
/// acknowledgement before re-entering the home shell.
class ThankYouScreen extends StatelessWidget {
  const ThankYouScreen({super.key});

  @override
  Widget build(BuildContext context) {
    return PopScope(
      canPop: false,
      onPopInvokedWithResult: (didPop, _) {
        if (!didPop) context.go('/home');
      },
      child: Scaffold(
        backgroundColor: HaloTokens.bg,
        body: SafeArea(
          child: Padding(
            padding: const EdgeInsets.symmetric(horizontal: HaloSpacing.s32),
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              crossAxisAlignment: CrossAxisAlignment.stretch,
              children: [
                const Text(
                  '🤍',
                  style: TextStyle(fontSize: 72),
                  textAlign: TextAlign.center,
                ),
                const SizedBox(height: HaloSpacing.s24),
                const Text(
                  'makasih udah curhat',
                  style: TextStyle(
                    fontFamily: HaloTokens.fontDisplay,
                    fontSize: 26,
                    fontWeight: FontWeight.w700,
                    color: HaloTokens.ink,
                  ),
                  textAlign: TextAlign.center,
                ),
                const SizedBox(height: HaloSpacing.s12),
                const Text(
                  'semoga kamu lebih plong sekarang. kalau butuh, bestie selalu siap nemenin lagi.',
                  style: TextStyle(
                    fontFamily: HaloTokens.fontBody,
                    fontSize: 15,
                    height: 22 / 15,
                    color: HaloTokens.inkSoft,
                  ),
                  textAlign: TextAlign.center,
                ),
                const SizedBox(height: HaloSpacing.s40),
                HaloButton(
                  label: 'balik ke home',
                  fullWidth: true,
                  onPressed: () => context.go('/home'),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
