@import '@legends/styles/base.scss';

.wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 17.3125rem;
  height: 13.375rem;
  background-color: $neutral-700;
  border-radius: 1rem;
  transition: all 0.1s ease;

  border: .0625rem solid rgba($neutral-600, 0.2);

  &:not(.disabled) {
    cursor: pointer;

    &:hover {
      &::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        box-sizing: content-box;
        width: calc(100%);
        height: calc(100%);
        border: 0.25rem solid transparent;
        z-index: 0;
        background-clip: padding-box, border-box;
        background-color: $neutral-700;
        background-origin: padding-box, border-box;
        background-image: linear-gradient($secondaryBackground, $secondaryBackground),
          linear-gradient(152.35deg, rgba(207, 162, 255, 0.6) 9.38%, rgba(78, 25, 168, 0.6) 96.89%);
        border-radius: 1rem;
      }

      .contentAndAction {
        .content {
          .image {
            opacity: 1;
          }

          .backgroundEffect {
            opacity: 0.5;
          }
        }
      }
    }
  }

  &.disabled .overlay {
    background-color: #191a1f80;
  }
  &.disabled {
    .contentAndAction {
      opacity: 0.5;
    }
  }

  .overlay {
    box-sizing: border-box;
    position: absolute;
    top: 0;
    left: 0;
    padding: 0.875rem;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: end;
    gap: 0.25rem;
    z-index: 10;
    border-radius: 1rem;
    user-select: none;
    text-align: center;

    .overlayTitle {
      font-size: 2rem;
      font-weight: 400;
      color: $mainText;
      line-height: 100%;
    }

    .disabledIcon {
      path:first-child {
        fill: $red-400;
        stroke: $red-400;
      }
  
      path:nth-child(2) {
        fill: $neutral-700;
      }
    }

    .overlayText {
      display: block;
      font-size: 0.875rem;
      font-weight: 400;
      color: rgba($mainText, 0.6);
      line-height: 1.125rem;
    }
  }

  .contentAndAction {
    flex: 1;
    background-color: $neutral-700;
    z-index: 3;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0 0 1.25rem 1.5rem;
    border-radius: 1rem;

    .actionAndRewards {
      display: flex;
      gap: 1rem;
      align-items: flex-end;

      .button {
        @include primary-button;
        text-transform: none;
        font-size: 1rem;
        width: 6.75rem;
      }

      .rewardTitle {
        font-size: 0.75rem;
        font-weight: 300;
        color: rgba($whiteText, 0.5);
      }

      .xp {
        color: $whiteText;
        font-size: 1.25rem;
        font-weight: 300;
        margin-right: 0.1875rem;
        line-height: 100%;
      }

      .xpText {
        font-weight: 200;
        vertical-align: top;
        color: rgba($whiteText, 0.5);
      }

      .rewardFrequencyWrapper {
        width: 8.375rem;

        .rewardFrequency {
          display: flex;
          align-items: center;
          justify-content: center;
          font-size: 0.75rem;
          text-align: center;
          line-height: 1rem;
          letter-spacing: 0.0063rem;
          font-weight: 400;
          color: $neutral-300;
          border-radius: 3.125rem;
          height: 2rem;
          padding: 0 0.5rem;
          width: fit-content;
          min-width: 3.125rem;
          background-color: $purple-850;
        }
        .rewardFrequencyDaily {
          background-color: $purple-700;
        }

        .rewardFrequencyWeekly {
          background-color: $blue-700;
        }

        .rewardFrequencyOneTime {
          background-color: $blue-800;
        }

        .streak {
          display: flex;
          align-items: center;
          background-color: $purple-600;
          justify-content: space-between;
          border-radius: 3.125rem;
          padding: 0.375rem 0.5rem;
          gap: 0.1875rem;
          width: fit-content;

          .streakNumber {
            font-size: 1rem;
            line-height: 1rem;
            font-weight: 700;
            color: $yellowText;
          }

          .streakLabel {
            font-size: 0.75rem;
            font-weight: 400;
            line-height: 1rem;
            letter-spacing: 0.1;
            text-align: center;
            color: $neutral-300;
          }
        }
      }
    }

    .content {
      display: flex;

      .heading {
        font-size: 1.25rem;
        font-weight: 400;
        margin-bottom: 0.25rem;
        padding-top: 1.5rem;
        width: 10.9375rem;
        line-height: 1.5rem;
        height: 7.875rem;
        z-index: 2;
      }

      // Used for the hover effect on the card
      .backgroundEffect {
        position: absolute;
        top: -1.5625rem;
        right: 0;
        width: 10.6875rem;
        height: 11.937196731567383rem;
        opacity: 0;
        z-index: 1;
      }

      .image {
        position: absolute;
        top: 0;
        right: 0;
        z-index: 1;
        opacity: 0.3;
        transition: opacity 0.1s ease;
        height: 9rem;
      }

      .rewardsHeading {
        line-height: 1.25rem;
        margin-bottom: 0.5rem;
        font-family: $secondaryFont;
        font-size: 0.875rem;
        color: $secondaryText;
        font-weight: 400;

        .repeatableIcon {
          display: inline;
          color: $secondaryText;
        }
      }

      .rewards {
        display: flex;
        justify-content: space-between;
        width: 100%;
        background-color: $tertiaryBackground;
        border-radius: $primaryBorderRadius;
        padding: 0.563rem 0.5rem;
        margin-bottom: 1.5rem;
      }
    }
  }


  @include breakpoint-down-from(tablet) {
    width: 100%;
    .contentAndAction {
      .content {
        .image {
          width: 9.375rem;
          height: 100%;
        }
      }
    }
  }
}

.disabled {
  cursor: not-allowed;
}
