import 'package:flutter/material.dart';

/// Genex Design System - Spacing & Layout Tokens
///
/// 基于 4px 网格系统，保持一致的留白节奏
class AppSpacing {
  AppSpacing._();

  // ============================================================
  // Base Grid (4px)
  // ============================================================
  static const double xs = 4;
  static const double sm = 8;
  static const double md = 12;
  static const double lg = 16;
  static const double xl = 20;
  static const double xxl = 24;
  static const double xxxl = 32;
  static const double huge = 40;
  static const double massive = 48;
  static const double gigantic = 64;

  // ============================================================
  // Page Padding
  // ============================================================
  static const EdgeInsets pagePadding = EdgeInsets.symmetric(horizontal: 20);
  static const EdgeInsets pageWithTop = EdgeInsets.fromLTRB(20, 16, 20, 0);

  // ============================================================
  // Card Padding
  // ============================================================
  static const EdgeInsets cardPadding = EdgeInsets.all(16);
  static const EdgeInsets cardPaddingCompact = EdgeInsets.all(12);

  // ============================================================
  // Section Spacing
  // ============================================================
  static const double sectionGap = 24;
  static const double itemGap = 12;
  static const double inlineGap = 8;

  // ============================================================
  // Border Radius
  // ============================================================
  static const double radiusSm = 8;
  static const double radiusMd = 12;
  static const double radiusLg = 16;
  static const double radiusXl = 20;
  static const double radiusFull = 999;

  static final BorderRadius borderRadiusSm = BorderRadius.circular(radiusSm);
  static final BorderRadius borderRadiusMd = BorderRadius.circular(radiusMd);
  static final BorderRadius borderRadiusLg = BorderRadius.circular(radiusLg);
  static final BorderRadius borderRadiusXl = BorderRadius.circular(radiusXl);
  static final BorderRadius borderRadiusFull = BorderRadius.circular(radiusFull);

  // ============================================================
  // Elevation / Shadow
  // ============================================================
  static const List<BoxShadow> shadowSm = [
    BoxShadow(
      color: Color(0x0A000000),
      blurRadius: 8,
      offset: Offset(0, 2),
    ),
  ];

  static const List<BoxShadow> shadowMd = [
    BoxShadow(
      color: Color(0x0F000000),
      blurRadius: 16,
      offset: Offset(0, 4),
    ),
  ];

  static const List<BoxShadow> shadowLg = [
    BoxShadow(
      color: Color(0x14000000),
      blurRadius: 24,
      offset: Offset(0, 8),
    ),
  ];

  static const List<BoxShadow> shadowPrimary = [
    BoxShadow(
      color: Color(0x336C5CE7),
      blurRadius: 16,
      offset: Offset(0, 4),
    ),
  ];

  // ============================================================
  // Animation Durations
  // ============================================================
  static const Duration animFast = Duration(milliseconds: 150);
  static const Duration animNormal = Duration(milliseconds: 250);
  static const Duration animSlow = Duration(milliseconds: 350);

  // ============================================================
  // Component Sizes
  // ============================================================
  static const double buttonHeight = 52;
  static const double buttonHeightSm = 40;
  static const double inputHeight = 52;
  static const double appBarHeight = 56;
  static const double bottomNavHeight = 80;
  static const double tabBarHeight = 44;
  static const double avatarSm = 32;
  static const double avatarMd = 40;
  static const double avatarLg = 56;
  static const double iconSm = 20;
  static const double iconMd = 24;
  static const double iconLg = 28;
  static const double couponCardHeight = 120;
  static const double couponCardHeightLg = 160;
}
