import 'package:flutter/material.dart';
import '../../../../core/theme/app_colors.dart';
import '../../../../core/theme/app_text_styles.dart';

class PanelModeToggle extends StatelessWidget {
  final bool isOn;
  final ValueChanged<bool> onChanged;

  const PanelModeToggle({
    super.key,
    required this.isOn,
    required this.onChanged,
  });

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: const EdgeInsets.symmetric(horizontal: 12),
      padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 10),
      decoration: BoxDecoration(
        border: Border(
          top: BorderSide(color: AppColors.purple.withOpacity(0.15)),
          bottom: BorderSide(color: AppColors.purple.withOpacity(0.15)),
        ),
      ),
      child: Row(
        children: [
          const Text('🎭', style: TextStyle(fontSize: 18)),
          const SizedBox(width: 10),
          Expanded(
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text('Panel Discussion Mode',
                    style: AppTextStyles.labelMedium),
                Text(
                  '10 investor personas debate before predicting',
                  style: AppTextStyles.caption,
                ),
              ],
            ),
          ),
          Container(
            padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
            decoration: BoxDecoration(
              color: isOn
                  ? AppColors.purple.withOpacity(0.12)
                  : Colors.transparent,
              borderRadius: BorderRadius.circular(12),
            ),
            child: Text(
              isOn ? '🎭 ON' : 'OFF',
              style: TextStyle(
                color: isOn ? AppColors.purpleLight : AppColors.textTertiary,
                fontSize: 11,
                fontWeight: FontWeight.w700,
              ),
            ),
          ),
          const SizedBox(width: 6),
          Switch(
            value: isOn,
            onChanged: onChanged,
          ),
        ],
      ),
    );
  }
}