@import '../../styles/abstracts/variables';

.color-picker {
  position: relative;

  &-disabled {
    * {
      opacity: 0.4;
    }
  }

  &__error {
    margin-top: 4px;
    font-style: normal;
    font-weight: 400;
    font-size: 12px;
    line-height: 16px;
    color: $red !important;
  }

  &__title {
    margin-bottom: 8px;
  }

  &__input-border-highlight {
    &:has(> span.ant-popover-open) {
      .color-picker__input {
        background:
          linear-gradient(white, white) padding-box,
          $button border-box;
        border: 1px solid transparent;
      }
    }
  }

  &__input {
    display: flex;
    border: 1px solid $gray2;
    width: 100%;
    height: 56px;
    border-radius: 8px;
    padding: 12px;
    align-content: center;
    cursor: pointer;
    user-select: none;
    margin-top: 8px;

    &--error {
      border: 1px solid $red;
    }

    @include mobile {
      width: 100%;
    }

    .color-mark {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      border: 1px solid $gray2;
    }

    .color-title {
      align-self: center;
      margin-left: 8px;
    }
  }

  &__focused {
    background:
      linear-gradient(#fff, #fff) padding-box,
      linear-gradient(270deg, #17e391 21.47%, #58e5df 77.04%, #60e5e8 77.05%)
        border-box;
    border: 1px solid transparent;
  }

  &__popover {
    position: absolute;
    z-index: 1;
    padding: 10px;

    transition: all 300ms ease;

    width: 314px;
    height: 361px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.18);
    border-radius: 16px;
    background-color: $white;

    @include mobile {
      width: 100%;
    }

    .ant-popover-content {
      padding: 10.59px;
      height: 100%;
    }

    .color-picker-input {
      margin-top: 12px;
      font-weight: $semi-bold !important;
      font-size: $medium2 !important;
      line-height: 28px;
      border: none;
      padding-left: 0 !important;
    }

    .react-colorful {
      width: 100%;
      height: 288px;

      &__saturation {
        width: 100%;
      }

      &__pointer {
        width: 20px;
        height: 20px;
      }

      &__hue {
        margin-top: 12px;
        border-radius: 123px;
      }
    }
  }
}
