<template>
  <div class="statistics-card">
    <div class="card-content">
      <div class="info">
        <div class="value">{{ value }}</div>
        <div class="label">{{ label }}</div>
      </div>
      <div class="icon-wrapper">
        <i :class="icon" :style="iconStyle"></i>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'StatisticsCard',
  props: {
    value: {
      type: [Number, String],
      default: null,
    },
    label: {
      type: String,
      required: true
    },
    icon: {
      type: String,
      required: true
    },
    startColor: {
      type: String,
      required: true
    },
    endColor: {
      type: String,
      required: true
    }
  },
  computed: {
    iconStyle() {
      return {
        background: `linear-gradient(135deg, ${this.startColor}, ${this.endColor})`,
        '-webkit-background-clip': 'text',
        '-webkit-text-fill-color': 'transparent',
        'background-clip': 'text'
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.statistics-card {
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
  padding: 12px;
  height: 70px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  
  &:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px 0 rgba(0,0,0,.15);
  }
  
  .card-content {
    position: relative;
    height: 100%;
    z-index: 1;
    
    .info {
      position: relative;
      z-index: 2;
      
      .value {
        font-size: 18px;
        font-weight: bold;
        color: #303133;
        line-height: 1.2;
        margin-bottom: 4px;
      }
      
      .label {
        font-size: 12px;
        color: #606266;
      }
    }
    
    .icon-wrapper {
      position: absolute;
      right: -8px;
      bottom: -12px;
      z-index: 1;
      
      i {
        font-size: 48px;
        opacity: 0.15;
        transition: all 0.3s ease;
      }
    }
  }

  &:hover {
    .icon-wrapper i {
      opacity: 0.25;
      transform: scale(1.05);
    }
  }
}
</style> 