import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';

class ExploreCitiesCard extends StatelessWidget {
  final String name;
  final String description;
  final String imageUrl;
  final String individualPrice;
  final String cityCardPrice;
  final String savingsText;

  const ExploreCitiesCard({
    super.key,
    required this.name,
    required this.description,
    required this.imageUrl,
    required this.individualPrice,
    required this.cityCardPrice,
    required this.savingsText,
  });

  @override
  Widget build(BuildContext context) {
    return Container(
      width: 220,
      margin: const EdgeInsets.only(right: 16),
      decoration: BoxDecoration(
        borderRadius: BorderRadius.circular(16),
        image: DecorationImage(
          image: AssetImage(imageUrl),
          fit: BoxFit.cover,
        ),
      ),
      child: Stack(
        children: [
          Container(
            decoration: BoxDecoration(
              borderRadius: BorderRadius.circular(16),
              gradient: LinearGradient(
                begin: Alignment.bottomCenter,
                end: Alignment.topCenter,
                colors: [
                  Colors.black.withOpacity(0.2),
                  Colors.transparent,
                ],
              ),
            ),
          ),

          Positioned(
            top: 10,
            right: 10,
            child: Container(
              padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 10),
              decoration: BoxDecoration(
                color: const Color(0xffDBFCE7),
                borderRadius: BorderRadius.circular(20),
              ),
              child: Text(
                savingsText,
                style: GoogleFonts.poppins(
                  color: const Color(0xFF2C8354),
                  fontWeight: FontWeight.w600,
                  fontSize: 12,
                ),
              ),
            ),
          ),

          // Bottom text
          Positioned(
            bottom: 10,
            left: 10,
            right: 10,
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text(
                  name,
                  style: TextStyle(
                    color: Colors.white,
                    fontWeight: FontWeight.w500,
                    fontSize: 16,
                  ),
                ),
                const SizedBox(height: 4),
                Text(
                  description,
                  style: GoogleFonts.poppins(
                    color: Colors.white,
                    fontWeight: FontWeight.w400,
                    fontSize: 11,
                  ),
                  maxLines: 2,
                  overflow: TextOverflow.ellipsis,
                ),
                const SizedBox(height: 8),

                // Prices
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Text(
                      "Individual tickets :",
                      style: TextStyle(
                        color: Color(0xffFDCDCE),
                        fontSize: 12
                      ),
                    ),
                    Text(
                      individualPrice,
                      style:  TextStyle(
                          color: Color(0xffFDCDCE),
                          fontSize: 12,
                        decoration: TextDecoration.lineThrough,
                        decorationColor: Color(0xffFDCDCE)
                      ),
                    ),
                  ],
                ),
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Text(
                      "City Card :",
                      style: TextStyle(
                          color: Color(0xffFDCDCE),
                          fontSize: 12
                      ),
                    ),
                    Text(
                      cityCardPrice,
                      style: TextStyle(
                          color: Color(0xffFDCDCE),
                          fontSize: 12
                      ),
                    ),
                  ],
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }
}
