import 'package:flutter/material.dart';

import 'package:asciineverdie/l10n/app_localizations.dart';
import 'package:asciineverdie/src/core/model/game_state.dart';
import 'package:asciineverdie/src/features/game/widgets/equipment_stats_panel.dart';
import 'package:asciineverdie/src/shared/retro_colors.dart';

/// 장비 페이지 (캐로셀)
///
/// 현재 장착된 장비 목록과 스탯 표시.
class EquipmentPage extends StatelessWidget {
  const EquipmentPage({super.key, required this.equipment});

  final Equipment equipment;

  @override
  Widget build(BuildContext context) {
    final localizations = L10n.of(context);

    return Column(
      crossAxisAlignment: CrossAxisAlignment.stretch,
      children: [
        // 장비 헤더
        _buildSectionHeader(context, localizations.equipment),

        // 장비 목록 (EquipmentStatsPanel 재사용)
        Expanded(child: EquipmentStatsPanel(equipment: equipment)),
      ],
    );
  }

  Widget _buildSectionHeader(BuildContext context, String title) {
    final gold = RetroColors.goldOf(context);
    final goldDark = RetroColors.goldDarkOf(context);
    final panelBg = RetroColors.panelBgOf(context);

    return Container(
      padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
      decoration: BoxDecoration(
        color: panelBg,
        border: Border(
          top: BorderSide(color: gold, width: 2),
          left: BorderSide(color: gold, width: 2),
          bottom: BorderSide(color: goldDark, width: 2),
          right: BorderSide(color: goldDark, width: 2),
        ),
      ),
      child: Row(
        children: [
          Icon(Icons.shield, size: 16, color: gold),
          const SizedBox(width: 8),
          Text(
            title,
            style: TextStyle(
              fontWeight: FontWeight.bold,
              fontSize: 18,
              color: gold,
            ),
          ),
        ],
      ),
    );
  }
}
