import 'package:flutter/material.dart';

/// Linear gradient presets for [KasyAvatar] via `backgroundGradient` or
/// [KasyAvatar.gradientFill].
///
/// Matches the HeroUI Figma Kit V3 avatar palette exactly.
/// All gradients use 141° (upper-left → lower-right), flat from 0%→27%,
/// then transition to the second color at 100% — same as Figma specification.
abstract final class KasyAvatarGradients {
  // 141° CSS angle → Flutter Alignment
  // begin = upper-left region (-sin141°, cos141°) ≈ (-0.63, -0.78)
  // end   = lower-right region (+sin141°, -cos141°) ≈ (+0.63, +0.78)
  static const Alignment _b = Alignment(-0.63, -0.78);
  static const Alignment _e = Alignment(0.63, 0.78);

  /// Cornflower blue → deep blue
  static const LinearGradient blue = LinearGradient(
    begin: _b,
    end: _e,
    colors: [Color(0xFF5D9BE7), Color(0xFF5D9BE7), Color(0xFF0026FF)],
    stops: [0.0, 0.27, 1.0],
  );

  /// Cyan-blue → violet
  static const LinearGradient sky = LinearGradient(
    begin: _b,
    end: _e,
    colors: [Color(0xFF5DD0E7), Color(0xFF5DD0E7), Color(0xFF7300FF)],
    stops: [0.0, 0.27, 1.0],
  );

  /// Aqua → deep blue
  static const LinearGradient teal = LinearGradient(
    begin: _b,
    end: _e,
    colors: [Color(0xFF5DE7E7), Color(0xFF5DE7E7), Color(0xFF001AFF)],
    stops: [0.0, 0.27, 1.0],
  );

  /// Mint green → royal blue
  static const LinearGradient emerald = LinearGradient(
    begin: _b,
    end: _e,
    colors: [Color(0xFF5DE79D), Color(0xFF5DE79D), Color(0xFF0033FF)],
    stops: [0.0, 0.27, 1.0],
  );

  /// Seafoam → dark forest green
  static const LinearGradient green = LinearGradient(
    begin: _b,
    end: _e,
    colors: [Color(0xFF52DEB0), Color(0xFF52DEB0), Color(0xFF0D5C45)],
    stops: [0.0, 0.27, 1.0],
  );

  /// Turquoise → deep forest green
  static const LinearGradient forest = LinearGradient(
    begin: _b,
    end: _e,
    colors: [Color(0xFF5DD9AF), Color(0xFF5DD9AF), Color(0xFF094E39)],
    stops: [0.0, 0.27, 1.0],
  );

  /// Golden yellow → deep red-orange
  static const LinearGradient orange = LinearGradient(
    begin: _b,
    end: _e,
    colors: [Color(0xFFE7BD5D), Color(0xFFE7BD5D), Color(0xFFFF1E00)],
    stops: [0.0, 0.27, 1.0],
  );

  /// Salmon → scarlet
  static const LinearGradient red = LinearGradient(
    begin: _b,
    end: _e,
    colors: [Color(0xFFE7885D), Color(0xFFE7885D), Color(0xFFFF0004)],
    stops: [0.0, 0.27, 1.0],
  );

  /// Soft purple → cobalt blue
  static const LinearGradient indigo = LinearGradient(
    begin: _b,
    end: _e,
    colors: [Color(0xFFB45DE7), Color(0xFFB45DE7), Color(0xFF0055FF)],
    stops: [0.0, 0.27, 1.0],
  );

  /// Medium purple → crimson
  static const LinearGradient purple = LinearGradient(
    begin: _b,
    end: _e,
    colors: [Color(0xFF8D5DE7), Color(0xFF8D5DE7), Color(0xFFFF0009)],
    stops: [0.0, 0.27, 1.0],
  );

  /// Orchid pink → deep magenta-red
  static const LinearGradient rose = LinearGradient(
    begin: _b,
    end: _e,
    colors: [Color(0xFFE75DCB), Color(0xFFE75DCB), Color(0xFFFF000D)],
    stops: [0.0, 0.27, 1.0],
  );

  /// Hot pink → coral red
  static const LinearGradient hotPink = LinearGradient(
    begin: _b,
    end: _e,
    colors: [Color(0xFFE43673), Color(0xFFE43673), Color(0xFFFB5059)],
    stops: [0.0, 0.27, 1.0],
  );

  /// Silver → near-black
  static const LinearGradient silver = LinearGradient(
    begin: _b,
    end: _e,
    colors: [Color(0xFF949494), Color(0xFF949494), Color(0xFF080808)],
    stops: [0.0, 0.27, 1.0],
  );

  /// Mid-grey → very dark grey
  static const LinearGradient black = LinearGradient(
    begin: _b,
    end: _e,
    colors: [Color(0xFF7F7F7F), Color(0xFF7F7F7F), Color(0xFF1F1F1F)],
    stops: [0.0, 0.27, 1.0],
  );

  /// All 14 presets in display order (matches Figma "Image Use" section).
  static const List<LinearGradient> all = [
    blue, sky, teal, emerald, green, forest,
    orange, red, indigo, purple, rose, hotPink,
    silver, black,
  ];
}

/// Fixed Unsplash URLs for demos/catalog (network + permissions in prod).
abstract final class KasyAvatarDemoPhotos {
  static const String manGlasses =
      'https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=400&h=400&fit=crop&auto=format';
  static const String womanSmile =
      'https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=400&h=400&fit=crop&auto=format';
  static const String womanCurly =
      'https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=400&h=400&fit=crop&auto=format';
  static const String manBeard =
      'https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=400&h=400&fit=crop&auto=format';
}
