// Variables
$card-border-radius: 8px;

$edw-icon-sizes: (
  'ex-large': 32px,
  'large': 24px,
  'small': 18px
);

$card-icon: (
  'height': 24px,
  'width': 24px,
  'size': 16px
);

$card-list-gap: 24px;
$edw-list-body-padding: 24px;
$avatar-size: map-get($edw-icon-sizes, 'large');

.s-info-semibold {
  font-size: 12px;
  line-height: 14px;
  font-weight: 600;
}

// Mixins
@mixin date-styling {
  .date {
    background-color: #17a2bb;
    border-radius: 2px;
    padding: 4px;
    color: $white;
  }
}

@mixin expand-card-on-hover {
  .course-info-container {
    background-color: $white;

    &:not(:hover) {
      min-height: 100%;
      transition: min-height 0.1s linear 0.4s;

      .coursesummary,
      .lesson-date-wrapper,
      .payment-view-wrapper {
        display: none !important;
      }
    }
  }

  .course-card-body-wrapper:has(.course-info-container:hover) {
    margin-top: -180px;
    align-items: end;

    .course-info-container {
      animation: animateToTop 0.3s ease;
      min-height: 60%;
    }
  }

  @keyframes animateToTop {
    0% { transform: translateY(calc(40% - 70px)); }
    100% { transform: translateY(0); }
  }
}

@mixin common-styles {
  .categoryname.s-info-semibold {
    color: #313848;
    background-color: #ebf0f9;
    padding: 4px 6px;
    border-radius: 2px;
    width: fit-content;
    white-space: normal;
    word-break: break-word;
    margin-top: -32px;

    .categoryname {
      padding: unset;
    }
  }

  .coursename {
    color: #313848;
    background-color: transparent;
    white-space: normal;
    font-weight: 600;
    font-size: 1rem;
    line-height: 24px;

    &:hover {
      background-color: transparent;
      box-shadow: none;
      color: lighten(#313848, 10%);
    }
  }

  .course-instructors,
  .lesson-count,
  .updated-date,
  .enrolled-users-count {
    color: #647390;
  }

  .course-instructors {
    font-weight: 400;
    font-size: .875rem;
    line-height: 22px;
    word-break: break-word;
  }

  .coursesummary {
    font-weight: 400;
    font-size: 14px;
    line-height: 22px;
    color: #1d2125;
  }

  .instructor-info-wrapper a {
    line-height: 32px;
    text-decoration: none;

    img {
      height: $avatar-size;
      width: $avatar-size;
      min-width: $avatar-size;
    }
  }

  .rating-short-design{
    .avgrating,
    .rnr-link{
        color: #4c5a73;
        font-size: 12px;
        line-height: 14px;
        font-weight: 600;
    }

    .rnr-link {
        position: relative;

        > span {
          font-size: 12px;
          line-height: 14px;
          font-weight: 600;
          padding-left: 2px;
        }
    }

    div{
       span{
          order: 2;
          text-align: right;
          margin-left: 0.25rem;
       }
    }
  }

  .instructorscount,
  .paymentmethodcount {
    color: #647390;
    height: 24px;
    width: 24px;
    min-width: 24px;
    border-radius: 50%;
    background-color: #ebf0f9;
  }

  .progress-data-wrapper {
    color: #4c5a73;

    .progress-text {
      color: #4c5a73;
    }

    .progress {
      border-radius: 20px;
      height: 6px;

      .progress-bar {
        background-color: #37be71;
      }
    }
  }

  // .view-course-btn {
  //   color: #0051f9;
  //   border-color: #0051f9;
  //   background: #fff;

  //   &:hover {
  //     color: #0041c7;
  //     border-color: #0041c7;
  //   }
  // }


}

.fccourses-wrapper {
  @include date-styling();
  @include common-styles();

  // Main styles
  .dashboard-card {
    border-radius: $card-border-radius;
    border: 1px solid #D5DDEA;
    overflow: hidden;
    min-height: 350px;
    filter: none;

    .dashboard-card-img {
      height: 185px;
      background-repeat: no-repeat;
      background-size: cover;
      background-position: center;
      border-bottom-left-radius: unset;
      border-bottom-right-radius: unset;
      padding: 16px;

      .edw-icon {
        font-size: map-get($edw-icon-sizes, 'small');
        height: map-get($card-icon, 'height');
        width: map-get($card-icon, 'width');
        border-radius: 2px;
        display: flex;
        justify-content: center;
        align-items: center;
        background-color: $white;
        color: #5b6880;
      }

      [data-region="favourite-icon"] {
        .edw-icon-Rating-stars_Active {
          color: $white;
          background-color: #ffc107;
          font-size: map-get($card-icon, 'size');
        }
      }

      .skilltag {
        border-radius: 2px;
        padding: 4px 8px;
        font-weight: 400;
      }

      .skilltag.badge-light {
        background-color: #d9dee3;
      }
    }

    .edw-icon-img {
      font-size: map-get($card-icon, 'size');
      height: map-get($card-icon, 'size');
      width: map-get($card-icon, 'size');
      padding: 0 1px 1px;

      img {
        width: 100%;
        height: 100%;
        object-fit: contain;
      }
    }

    .course-info-container {
      gap: 20px;
      position: relative;
      z-index: 1;
      padding: 20px !important;

      .edw-card-design-hd {
        gap: 12px;
      }
    }

    .epb-view-course-report {
      display: none;
    }
  }

  .wdm-course-card-actions {
    position: relative;
    top: unset;
    right: unset;
    margin-left: auto;
    z-index: 1;

    .visibilityicon {
      background-color: #EBF0F9;
      cursor: unset;
      border-radius: 2px;
      border: 1px solid #EBF0F9;
      padding: 4px;
    }
  }


  @media screen and (min-width: 1200px) {
    @include expand-card-on-hover();
  }

  .lesson-date-wrapper {
    gap: 2px;
    row-gap: 8px;

    .lesson-count,
    .updated-date {
      gap: 2px !important;
    }
  }

  .edw-card-design-ft {
    .ernr-lesson-wrapper {
      flex-direction: column;
    }

    .view-course-btn {
      max-width: 100%;
    }
  }

  .card-img {
    position: relative;

    .view-course-url {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
    }
  }

}
