@import 'src/styles/theme';

$card-border: 1px solid #ddd;

.ele-card {
  @extend %flex-center;
  flex-direction: column;
  box-shadow: 0 10px 19px 1px $shadow-color;
  border-radius: 12px;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
  background-color: $white;
}

.ele-card-header {
  @extend %flex-row;
  padding: 20px;
  font-size: 22px;
  width: 100%;
  border-bottom: $card-border;

  &-title {
    color: $text-color-light;
    @include lamp-clamp(1);
    @extend %flex-1;
  }

  &-brief {
    color: $text-color-light;
    @include lamp-clamp(1);
  }
}

.ele-card-body {
  //background-color: #5ebfff;
  @extend %flex-row;

  font-size: 32px;
  color: $text-color;
  padding: 20px;
  width: 100%;

  &-cover {
    @extend %flex-center;
    height: 100px;
    width: 100px;

    &-image {
      height: 100px;
      width: 100px;
    }

    &-txt {
      display: flex !important;
      text-align: center;
      @extend %flex-center;
      height: 100px;
      width: 100px;
      color: $white;
      font-size: 34px;
      font-weight: 600;
    }
  }

  &-info {
    @extend %flex-column;
    flex: 1;
    padding: 0 15px;

    &-title {
      font-size: 32px;
      display: -webkit-box !important;
      font-weight: 600;
      @include lamp-clamp(1);
    }

    &-brief {
      padding: 10px 10px 0;
      color: $text-color-light;
      font-size: 28px;
      display: -webkit-box !important;
      //min-height: 0.9rem;
      @include lamp-clamp(1);
    }
  }
}

.ele-card-footer {
  @extend %flex-column;
  border-top: $card-border;
  padding: 20px;
  width: 100%;

  &-action-list {
    @extend %flex-row;
    justify-content: flex-end;
  }
}

// as horizontal
.ele-card-body--horizontal {
  .ele-card-cover {
    width: 100px;
    height: 100px;

    .ele-card-body-cover-image {
      margin-bottom: -5px;
      height: 100px;
      width: 100px;
      border-radius: 5px;
    }
  }
}

.ele-card-body--vertical {
  @extend %flex-column;
  justify-content: center;
  padding: 0 0 10px 0;
  //width: 350px;

  .ele-card-body-cover {
    align-self: center;
    height: 350px;
    width: 100%;

    .ele-card-body-cover-image {
      height: 350px;
      width: 100%;
    }

    .ele-card-body-cover-txt {
      height: 250px;
      width: 250px;
    }
  }

  .ele-card-body-info {
    margin-top: 10px;
  }
}

.ele-card-body--vertical-small {
  .ele-card-body-cover-image {
    height: 250px !important;
    width: 250px !important;
  }

  .ele-card-body-cover-txt {
    height: 150px !important;
    width: 150px !important;
  }
}

.ele-card-body--vertical-normal {
  .ele-card-body-cover-image {
    height: 350px !important;
    width: 350px !important;
  }

  .ele-card-body-cover-txt {
    height: 250px !important;
    width: 250px !important;
  }
}

.ele-card-body--circle {
  .ele-card-body-cover-image {
    box-sizing: border-box;
    border-radius: 50% !important;
  }

  .ele-card-body-cover-txt {
    box-sizing: border-box;
    border-radius: 50% !important;
  }
}

.ele-card-body--large {
  .ele-card-body-cover {
    width: 180px;
    height: 180px;

    .ele-card-body-cover-image {
      height: 180px;
      width: 180px;
    }

    .ele-card-body-cover-txt {
      height: 180px;
      width: 180px;
    }
  }

  .ele-card-body-info-brief {
    height: unset;
    white-space: pre-wrap;
    @include lamp-clamp(3);
  }
}

.ele-card-body--as-text {
  .ele-card-body-cover-txt {
    background-color: $level-default;
    border-radius: 50%;
  }
}

.ele-card-body--small {
  .ele-card-body-cover {
    width: 60px;
    height: 60px;

    .ele-card-body-cover-image {
      width: 60px;
      height: 60px;
    }

    .ele-card-body-cover-txt {
      width: 60px;
      height: 60px;
    }
  }
}

.ele-card-body--avatar {
  .ele-card-body-cover-image {
    border: 4px solid darken($primary-color, 10%);
    box-shadow: 0 0 20px #fff;
  }
}

.ele-card-body--default {
  .ele-card-body-cover-txt {
    background-color: $level-default;
  }
}

.ele-card-body--normal {
  .ele-card-body-cover-txt {
    background-color: $level-normal;
  }
}

.ele-card-body--primary {
  .ele-card-body-cover-txt {
    background-color: $level-primary;
  }
}

.ele-card-body--warn {
  .ele-card-body-cover-txt {
    background-color: $level-warn;
  }
}

.ele-card-body--danger {
  .ele-card-body-cover-txt {
    background-color: $level-danger;
  }
}
