@use "../custom" as *;

.whyChoose {
  background-color: $background;
  padding: 6.25rem 0 3.125rem;

  &__wrapper {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem 1rem;

    @media (max-width: 74.0625rem) {
      flex-direction: column;
    }
  }

  &__left {
    max-width: 64.25rem;
    width: 100%;

    &-content {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 1rem;
      margin-top: 2.1875rem;
      min-width: 50.8125rem;

      @media (max-width: 53.125rem) {
        min-width: 100%;
        grid-template-columns: repeat(2, 1fr);
      }
      @media (max-width: 540px) {
        grid-template-columns: repeat(1, 1fr);
      }
    }
  }

  &__headline {
    color: $label;
    font-size: clamp(1.5rem, 5vw, 2.25rem);
    font-family: $inter;
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 0.75rem;

    img {
      width: clamp(50px, 5vw, 5.625rem);
      height: clamp(40px, 5vw, 75px);
    }

    span {
      font-family: $inter;
      font-weight: 800;
      font-size: clamp(2rem, 5vw, 3.88rem);
      letter-spacing: -0.03em;
      background: linear-gradient(97deg, #9656e2 0%, #8096ec 39.18%, #5efbfb 100%);
      background-clip: text;
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      line-height: 1;
    }

    margin-bottom: 1.5rem;

    @include media-breakpoint-down(sm) {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
    }
  }

  &__description {
    font-family: $inter;
    font-size: 1rem;
    font-weight: 400;
    margin: 0;
    color: $label-200;
    width: 100%;

    @include media-breakpoint-down(sm) {
      text-align: center;
    }
  }

  &__item {
    position: relative;
    height: 24.0625rem;

    &:hover {
      .whyChoose__item-avatar {
        transform: translateY(0.625rem);
      }
      .whyChoose__item-bg {
        transform: translateX(-50%) translateY(-0.875rem) rotate(-4deg);
      }
    }

    &::after {
      content: "";
      display: block;
      width: calc(100% - 1.75rem);
      height: calc(100% - 0.875rem);
      position: absolute;
      bottom: 0;
      left: 50%;
      transform: translateX(-50%);
      z-index: 0;
      border-radius: 1.875rem;
    }

    &::before {
      content: "";
      display: block;
      width: calc(100% - 1.75rem);
      height: calc(100% - 0.875rem);
      position: absolute;
      top: 43%;
      left: 50%;
      transform: translate(-50%, -50%);
      background: no-repeat url("../icons/white-wave.svg");
      background-size: cover;
      z-index: 1;
    }

    &:nth-child(1) {
      &::after {
        background-color: #b8e8f6;
      }
    }

    &:nth-child(2) {
      &::after {
        background-color: #b9f6b8;
      }
    }

    &:nth-child(3) {
      &::after {
        background-color: #dbb8f6;
      }
    }

    &-img {
      position: relative;
      height: 15.625rem;
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 2;
    }

    &-avatar {
      position: relative;
      z-index: 1;
      width: 10rem;
      height: 100%;
      object-fit: contain;
      object-position: center;
      margin: auto;
      transition: all linear 200ms;
    }

    &-bg {
      position: absolute;
      z-index: 0;
      top: 0;
      left: 50%;
      transform: translateX(-50%);
      transition: all linear 200ms;
    }

    &-content {
      position: absolute;
      bottom: 0;
      z-index: 3;
      border-radius: 1.875rem;
      background: rgba(20, 23, 40, 0.6);
      backdrop-filter: blur(3.75rem);
      height: 11.9375rem;
      padding: 2.5rem 1.5rem 0 1.5rem;
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
      align-items: center;
      width: 100%;
    }

    &-subtitle,
    &-title {
      color: $white;
      font-family: $inter;
      font-size: 1rem;
      font-weight: 500;
      text-align: center;
      display: block;
    }

    &-title {
      font-size: 1.25rem;
      font-weight: 600;
    }
  }

  &__right {
    max-width: 35.25rem;
    width: 100%;

    @media (max-width: 74.0625rem) {
      max-width: 100%;
    }

    &-item {
      position: relative;
      border-radius: 0.75rem;
      overflow: hidden;
      background: linear-gradient(180deg, #9656e2 0%, #5efbfb 100%);
      height: 46.25rem;

      @include media-breakpoint-down(sm) {
        height: 37rem;
      }

      &::after {
        content: "";
        min-width: 45.9375rem;
        width: 45.9375rem;
        height: 45.9375rem;
        border-radius: 100vh;
        background-color: rgba($white, 0.1);
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        bottom: -22.9688rem;
      }

      &-bg {
        position: relative;
        height: 100%;
        z-index: 1;

        .character {
          position: absolute;
          bottom: 0;
          left: 50%;
          transform: translateX(-50%);
          width: 100%;
          min-width: 500px;
          height: 36.4375rem;
          object-fit: contain;
          object-position: bottom;
        }

        .loading {
          max-width: 500px;
          width: 100%;
          height: 500px;
          object-fit: contain;
          object-position: center;
          position: absolute;
          top: 56%;
          left: 52%;
          transform: translate(-50%, -50%);
          animation: loading-rotate 16s infinite linear;
        }
      }
    }

    &-content {
      position: absolute;
      z-index: 4;
      width: 100%;
      bottom: 0;
      left: 0;
      backdrop-filter: blur(3.75rem);
      background: rgba(0, 0, 0, 0.6);
      padding: 4.375rem 3rem;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.75rem;
    }

    &-title {
      text-align: center;
      font-family: $roobert;
      font-size: 1.5rem;
      font-weight: 600;
      background: linear-gradient(85deg, #5adf85 0%, #a6ffc2 45.18%, #e9fff0 100%);
      background-clip: text;
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }

    &-description {
      color: $white;
      font-size: 1rem;
      text-align: center;
      margin: 0;
      font-family: $roobert;
    }
  }
}
