import 'package:flutter/material.dart';

import 'package:doormile/core/theme/app_colors.dart';
import 'package:doormile/core/theme/app_theme.dart';

/// Stylised Doormile badge mark — a rounded pin holding a package glyph.
class DoormileMark extends StatelessWidget {
  final double size;
  final Color color;
  final Color glyphColor;
  const DoormileMark({
    super.key,
    this.size = 48,
    this.color = AppColors.primary,
    this.glyphColor = Colors.white,
  });

  @override
  Widget build(BuildContext context) {
    return Container(
      width: size,
      height: size,
      decoration: BoxDecoration(
        color: color,
        borderRadius: BorderRadius.circular(size * 0.28),
        boxShadow: [
          BoxShadow(
            color: color.withValues(alpha: 0.25),
            blurRadius: size * 0.3,
            offset: Offset(0, size * 0.12),
          ),
        ],
      ),
      child: Icon(Icons.local_shipping_rounded, color: glyphColor, size: size * 0.55),
    );
  }
}

/// Full wordmark: badge + "Doormile" text.
class DoormileWordmark extends StatelessWidget {
  final double markSize;
  final double fontSize;
  final Color textColor;
  final Color markColor;
  final Color glyphColor;
  const DoormileWordmark({
    super.key,
    this.markSize = 40,
    this.fontSize = 24,
    this.textColor = AppColors.primary,
    this.markColor = AppColors.primary,
    this.glyphColor = Colors.white,
  });

  @override
  Widget build(BuildContext context) {
    return Row(
      mainAxisSize: MainAxisSize.min,
      children: [
        DoormileMark(size: markSize, color: markColor, glyphColor: glyphColor),
        const SizedBox(width: 10),
        Text(
          'Doormile',
          style: AppTheme.headlineLg.copyWith(color: textColor, fontSize: fontSize),
        ),
      ],
    );
  }
}
