<template>
  <el-button :icon="icon" :plain="plain" :loading="loading" :title="title" @click="handleClick">
    <slot></slot>
  </el-button>
</template>

<script>
export default {
  name: 'IntButton',
  props: {
    icon: {
      type: String,
      default: ''
    },
    plain: {
      type: Boolean,
      default: true
    },
    loading: {
      type: Boolean,
      default: false
    },
    title: {
      type: String,
      default: ''
    }
  },
  methods: {
    handleClick() {
      this.$emit('click');
    }
  }
};
</script>

<style scoped>
.el-button {
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: linear-gradient(145deg, #f8f9fa 0%, #e9ecef 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.el-button [class^="el-icon-"] {
  font-size: 16px;
  margin: 0;
  color: #28a745;
  transition: all 0.3s ease;
}

.el-button:hover {
  background: linear-gradient(145deg, #28a745 0%, #34ce57 100%);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.25),
    0 2px 4px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.el-button:hover [class^="el-icon-"] {
  color: #fff;
  transform: scale(1.1);
}

.el-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(40, 167, 69, 0.25);
}
</style>