import 'package:flutter/material.dart';
import 'package:shimmer/shimmer.dart';
import 'package:sizer/sizer.dart';

class StockReportShimmer extends StatelessWidget {
  const StockReportShimmer({super.key});

  @override
  Widget build(BuildContext context) {
    return Shimmer.fromColors(
      baseColor: Colors.grey.shade300,
      highlightColor: Colors.grey.shade100,
      child: Column(
        children: List.generate(3, (index) => _buildShimmerCard()),
      ),
    );
  }

  Widget _buildShimmerCard() {
    return Container(
      margin: EdgeInsets.symmetric(horizontal: 5.w, vertical: 2.h),
      padding: EdgeInsets.all(4.w),
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(3.w),
      ),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Row(
            children: [
              Container(width: 10.w, height: 10.w, color: Colors.white),
              SizedBox(width: 3.w),
              Container(width: 40.w, height: 2.h, color: Colors.white),
            ],
          ),
          SizedBox(height: 3.h),
          Column(
            children: List.generate(3, (i) => Padding(
              padding: EdgeInsets.only(bottom: 1.5.h),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  Container(width: 25.w, height: 1.5.h, color: Colors.white),
                  Container(width: 15.w, height: 1.5.h, color: Colors.white),
                ],
              ),
            )),
          ),
          
          Divider(height: 3.h, color: Colors.white),
          
          Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              Container(width: 20.w, height: 2.h, color: Colors.white),
              Container(
                width: 25.w, 
                height: 4.h, 
                decoration: BoxDecoration(
                  color: Colors.white,
                  borderRadius: BorderRadius.circular(2.w),
                ),
              ),
            ],
          ),
        ],
      ),
    );
  }
}