<template>
  <div :class="['new-reward-card', cardItem.locked ? 'unlocked' : 'locked']">
    <div v-if="cardItem.label" class="badge">{{ cardItem.label }}</div>
    <div class="left">
      <div :class="['title', cardItem.locked ? 'unlocked' : 'locked']">{{ cardItem.title }}</div>
      <div :class="['desc', cardItem.locked ? 'unlocked' : 'locked']">{{ cardItem.desc }}</div>
    </div>
    <div class="right">
      <img class="icon-main" :src="cardItem.icon" />
    </div>
  </div>
</template>
<script setup>

const props = defineProps({
  cardItem: {
    type: Object,
    default: () => ({}),
  },
});

</script>
<style lang="less" scoped>
.new-reward-card {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  border-radius: 8px;
  width: calc((100% - 10px) / 2);
  margin-bottom: 10px;
  position: relative;
  padding-top: 12.5px;
  padding-bottom: 12px;
  &.locked {
    background: linear-gradient(113deg, #fffcf5 3%, #ffe9be 100%, #ffe8af 100%);
    border: 1px solid linear-gradient(111deg, #fff1d6 2%, #ffe4b0 94%) 1;
  }
  &.unlocked {
    background: #f3f3fd;
    border: 1px solid rgba(191, 191, 202, 0.2);
  }
  .badge {
    font-family: PingFang SC;
    font-size: 10px;
    font-weight: 600;
    line-height: normal;
    color: #fffefe;
    border-radius: 8px 0 8px 0;
    opacity: 1;
    background: linear-gradient(0deg, #ff6426, #ff6426), linear-gradient(270deg, #ff4d4d 0%, #fe5054 63%, #f774a2 107%);
    position: absolute;
    top: -7px;
    padding: 2px 8px;
  }
  .left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: calc(100% - 46px);
    margin-left: 12px;
    .title {
      font-family: PingFang SC;
      font-size: 14px;
      font-weight: 500;
      line-height: normal;
      letter-spacing: 1px;
      &.locked {
        color: #a05600;
      }
      &.unlocked {
        color: #666666;
      }
    }
    .desc {
      font-family: PingFang SC;
      font-size: 10px;
      font-weight: normal;
      line-height: 10px;
      letter-spacing: 1px;
      margin-top: 2.5px;
      &.locked {
        color: #bc8a66;
      }
      &.unlocked {
        color: #999999;
      }
    }
  }
  .right {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 46px;
    margin-right: 12px;
    .icon-main {
      width: 34px;
      height: 34px;
    }
  }
}
</style>