/*
*   this file includes pane element styles.
*   @giraykarasinir
*/
/* stylelint-disable no-descending-specificity */

.jfReport-pane {

  .toolSection {

    &.isOneLine {
      display: flex;
      justify-content: space-between;
      align-items: center;
      .toolSection-title {
        margin-bottom: 0;
      }
      &.isMultiple {
        .toolSection-title {
          font-weight: 400;
        }
      }
    }

    &.fieldset {
      font-weight: 700;
    }


    .rightPanelWarning {
      padding: 20px;
      background-color: rgba(209, 55, 35, 0.1);
      border-radius: 4px;
      color: #d13723;
    }

    &-dropdown, &-input {
      border: 1px solid transparent;
      font-size: 0.938rem;
      height: 40px;
    }

    &-listItem {
      padding: 1px;
      background-color: transparent;
      border: none;
      cursor: pointer;
      flex: 1 1;
      transition: $transition;

      .toolItem-icon {
        width: 14px;
        border-right: none;
      }

      &Name {
        flex: 1 1;
        padding-left: 13px;

        span:first-child {
          @include text-ellipsis;
        }
      }
    }

    &-list {
      &.withIcons .toolSection-listItem {
        padding: 15px;
      }

      &:not(.withIcons) .toolSection-listItem {
        padding: 10px 5px;
      }

      &.forSegments {
        height: 38px;
        border-radius: 4px;
      }

      &:not(.forSegments) .toolSection-listItem {
        .jfReportSVG {
          width: 14px;
          height: 14px;
        }
      }

      &.dir-row {
        .toolSection-listItem {
          &:first-child {
            border-top-left-radius: 3px;
            border-bottom-left-radius: 3px;
          }
          &:last-child {
            border-top-right-radius: 3px;
            border-bottom-right-radius: 3px;
          }
        }
      }

      &:not(.dir-row) {
        .toolSection-listItem.d-flex {
          &:first-child {
            border-top-left-radius: 3px;
            border-top-right-radius: 3px;
          }
          &:last-child {
            border-bottom-left-radius: 3px;
            border-bottom-right-radius: 3px;
          }
        }
      }

      &.bigList {
        gap: 10px;
        .toolSection-listItem {
          width: 97px;
          flex-direction: column;
          padding: 0;
          flex: 0;
          margin-bottom: 10px;

          &.isSelected {
            background-color: transparent;
          }

          & > span:not(.toolSection-listItemName) {
            width: 97px;
            height: 80px;
            border-radius: 4px;
          }

          span.toolSection-listItemName {
            font-size: 16px;
            margin-top: 8px;
            padding: 0;
          }

          &:hover {
            background-color: transparent;
          }
        }

        .isSelected {
          .jfReportSVG path {
            fill: $white;
          }
        }

        &.forChart {
          .jfReportSVG {
            width: 40px;
            height: 40px;
          }
        }

        &.forShapes {
          .jfReportSVG {
            width: 24px;
            height: 24px;
          }
        }
      }
    }

    &.isBig .forSegments {
      height: 54px;
    }

    &-orientation {
      &Item {
        color: $infoGray;
        font-size: 0.75rem;
        flex: 1;
        padding: 0;

        .orientationIcon {
          background-color: $infoGray;
          border-radius: 2px;
          margin-right: 5px;

          .icon-layout {
            fill: $white;
          }
        }

        &[data-orientation="landscape"] {
          .orientationIcon {
            width: 44px;
            height: 33px;
          }
        }

        &[data-orientation="portrait"] {
          .orientationIcon {
            width: 33px;
            height: 44px;
          }
        }

        &.isSelected {
          color: #2b3245;

          .orientationIcon {
            background-color: $green;
          }
        }

        & + .toolSection-orientationItem {
          margin-left: 10px;
        }
      }
    }

    &-input {
      position: relative;
      padding: 3px 10px;
      font-size: 0.875rem;
      width: 100%;
      height: 38px;
      cursor: text;
      outline: none;

      &.isSmall {
        width: 99px;
      }

      &[type="number"] {
        appearance: textfield;
        /* stylelint-disable-next-line property-no-vendor-prefix */
        -webkit-appearance: textfield;
      }

      &[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button {
        appearance: none;
        /* stylelint-disable-next-line property-no-vendor-prefix */
        -webkit-appearance: none;
      }
    }

    &-notifier {
      padding: 10px 20px;
      font-size: 0.75rem;
      border-radius: 5px;
    }

    &.fitForIcons {
      left: 10px;
      right: 10px;
      height: calc(100% - 140px);
    }
  }

  // Range Slider //

  .rangeSlider {
    position: relative;
    width: 100%;

    .rangeSlider-bar {
      width: 100%;
      appearance: none;
      /* stylelint-disable-next-line property-no-vendor-prefix */
      -webkit-appearance: none;
      background-color: transparent;
      margin-top: 3px;
      outline-offset: 0;
      height: 16px;
      cursor: pointer;
    }

    &:after {
      content: "";
      position: absolute;
      left: 0;
      top: calc(50% - 2px);
      width: 100%;
      height: 4px;
      border-radius: 4px;
      z-index: -2;
    }

    .rangeSlider-bar::-webkit-slider-runnable-track {
      background: transparent;
      border: none;
      cursor: pointer;

      &:focus {
        outline: none;
      }
    }

    .rangeSlider-bar::-moz-range-track {
      background: transparent;
      border: none;
      cursor: pointer;
      outline-offset: 1px;

      &:focus {
        outline: none;
      }
    }

    .rangeSlider-bar::-webkit-slider-thumb {
      /* stylelint-disable-next-line property-no-vendor-prefix */
      -webkit-appearance: none;
      appearance: none;
      height: 16px;
      width: 16px;
      border-radius: 50%;
      cursor: pointer;
      transition: .3s ease-in-out;
    }

    .rangeSlider-bar::-moz-range-thumb {
      /* stylelint-disable-next-line property-no-vendor-prefix */
      -webkit-appearance: none;
      appearance: none;
      height: 16px;
      width: 16px;
      padding: 0;
      border-radius: 50%;
      cursor: pointer;
      transition: .3s ease-in-out;
      box-sizing: border-box;
    }


    .rangeSlider-indicator {
      position: absolute;
      top: calc(50% - 2px);
      left: 0;
      height: 4px;
      border-radius: 4px;
      z-index: -1;
      pointer-events: none;
    }

    & + input, & + div {
      margin-left: 10px;
    }

    .rangeSlider-bar::-ms-track {
      width: 100%;
      height: 5px;
      background: transparent;
      border-color: transparent;
      border-width: 6px 0;
      color: transparent;
    }

    .rangeSlider-bar::-ms-fill-lower {
      border-radius: 10px;
    }

    .rangeSlider-bar::-ms-fill-upper {
      border-radius: 10px;
    }

    .rangeSlider-bar::-ms-thumb {
      height: 16px;
      width: 16px;
      border-radius: 50%;
    }
  }

  // Range Slider //

  // Image Upload //

  .imageUpload-wrapper {
    padding: 15px 10px;

    background-color: transparent;
    border: 2px dashed rgba(227, 229, 245, 0.5);

    label[for="fileUploader"] {
      .jfReportButton {
        background-color: $ctaBlue;
        color: $white;
        border: none;
        font-size: 16px;
        font-weight: 500;

        height: 52px;

        svg.jfReportSVG {
          fill: $white;
        }
      }
    }

    img {
      max-width: 80px;
    }

    .imageUpload-info {
      max-width: calc(100% - 90px);
      font-size: 0.75rem;
      margin-left: 10px;

      span {
        display: block;
      }

      span:first-child {
        margin-bottom: 5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      button {
        padding: 0;
      }
    }

    &.dropArea {
      display: flex;
      justify-content: center;
      align-items: center;
      flex-direction: column;
      height: 156px;
      white-space: nowrap;
      border-radius: 4px;

      &.isError {
        border-color: $danger;
      }

      &.isLoading {
        pointer-events: none;
      }
    }

    .fileUploader-wrapper {
      position: relative;
      cursor: pointer;

      input[type="file"] {
        width: .1px;
        height: .1px;
        opacity: 0;
        overflow: hidden;
        position: absolute;
        z-index: -1;
      }

      .uploadInfo {
        margin-top: 10px;

        &.isError {
          color: $danger;
          max-width: 150px;
          word-wrap: break-word;
          white-space: normal;
        }
      }
    }
  }

  .userUploads {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fill, 74px);
    justify-content: space-between;

    &-image {
      position: relative;
      height: 60px;
      border-radius: 4px;
      background-color: $white;
      overflow: hidden;
      margin-bottom: 8px;

      img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
      }

      &:before, &:after {
        content: "";
        position: absolute;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: .2s ease-in;
      }

      &:before {
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        background-color: rgba(66, 119, 255, 0.5);
        border: 3px solid $ctaBlue;
        z-index: 1;
      }

      &:after {
        top: calc(50% - 15px);
        left: calc(50% - 15px);
        width: 30px;
        height: 30px;
        transform: translateY(15px);
        border-radius: 50%;
        background: no-repeat center url("data:image/svg+xml,%3Csvg width='30' height='30' viewBox='0 0 30 30' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='15' cy='15' r='15' fill='%230099FF'/%3E%3Cpath d='M12.6075 20.8695C12.6065 20.8695 12.6065 20.8695 12.6055 20.8695C12.2959 20.8695 12.0159 20.7448 11.8138 20.5433L6.77092 15.5278C6.61613 15.3398 6.52148 15.0973 6.52148 14.8324C6.52148 14.2218 7.02232 13.7271 7.64048 13.7271C7.91456 13.7271 8.16498 13.8245 8.35921 13.9852L12.6114 18.2157L21.5683 9.45078C21.7704 9.25308 22.0494 9.13037 22.357 9.13037C22.9762 9.13037 23.478 9.62608 23.478 10.2377C23.478 10.5454 23.3508 10.823 23.1458 11.0236L13.3952 20.5481C13.1941 20.7468 12.916 20.8695 12.6084 20.8695C12.6075 20.8695 12.6075 20.8695 12.6065 20.8695H12.6075Z' fill='white'/%3E%3C/svg%3E%0A");
        transition-delay: .1s;
        z-index: 2;
      }

      &:hover, &.selected {
        &:before, &:after {
          transform: translateY(0);
          opacity: 1;
          visibility: visible;
        }
      }
    }
  }

  .userUploads-actions {
    flex-direction: row-reverse;
    margin-top: 12px;

    .jfReportButton {
      width: 150px;
      height: 40px;
      padding: 6px;

      border-radius: 2px;
      border: none;
      color: $white;
      font-weight: 500;

      &.isSuccess {
        background-color: $ctaBlue;
      }
      &.isDanger {
        background-color: #FF6100;
      }
    }
  }

  .fileUploader-url {
    margin-top: 10px;

    .jfReportButton {
      width: 150px;
      height: 40px;
      padding: 6px;

      border-radius: 2px;
      border: none;
      color: $white;
      font-weight: 500;

      &.isSuccess {
        background-color: $ctaBlue;
      }
    }

    .toolSection-input {
      margin-bottom: 10px;

      input::placeholder {
        color: $placeholderColor;
      }
    }
  }

  // Image Upload //

  // Color Picker //

  .colorPicker {
    &-wrapper {
      // padding: 3px 10px;
      border-radius: 2px;
      cursor: pointer;

      &.pickerVisible:after {
        transform: rotateX(-180deg);
      }

      .toolSection-input {
        height: 38px;
        border: none;
        border-right: 1px solid;
        background-color: transparent;
        border-radius: 0;
      }
    }

    &-holder {
      position: relative;
      width: 100%;

      .sketch-picker {
        position: absolute;
        top: 5px;
        max-width: calc(100% - 20px);
        z-index: 3;
      }

      &[data-position="right"] {
        .sketch-picker {
          right: 0;
        }
      }

      &[data-position="left"] {
        .sketch-picker {
          left: 0;
        }
      }
    }

    &-preview {
      flex-shrink: 0;
      width: 32px;
      height: 32px;
      margin: 3px;
      border-radius: 2px;
    }
  }

  .dropdownArrow {
    cursor: pointer;

    .icon-arrow.forDropdown {
      transition: .3s ease-in-out;
    }
  }

  // Color Picker //

  // Unit Placeholder for Inputs //

  .hasUnit {
    position: relative;
    display: flex;

    .toolSection-input {
      padding-right: 15px;
    }

    &:after {
      content: "";
      position: absolute;
      display: flex;
      height: 38px;
      right: 0;
      font-size: 15px;
      border-left: 1px solid transparent;
      align-items: center;
      width: 38px;
      justify-content: center;
    }

    &.isPercentage {
      &:after {
        content: "%";
      }
    }

    &.isPixel {
      &:after {
        content: "PX";
      }
    }
  }

  // Unit Placeholder for Inputs //
}
// Pane Items //

.toolSection-dropdownWrapper {
  position: relative;

  &:before, &:after {
    content: "";
    position: absolute;
    pointer-events: none;
  }

  &:before {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 7px solid;
    top: calc(50% - 4px);
    right: 14px;
  }

  &:after {
    display: inline-block;
    width: 1px;
    top: 0;
    bottom: 0;
    right: 38px;
  }

  .toolSection-dropdown {
    width: 100%;
    cursor: pointer;
    padding: 2px 10px;
    appearance: none;
    /* stylelint-disable-next-line property-no-vendor-prefix */
    -webkit-appearance: none;
  }

  &::-ms-expand {
    display: none;
  }

  &.isDark {
    .toolSection-dropdown {
      border: none;
    }

    &:after {
      background-size: 26%;
    }
  }
}

.floatingController.forBar .toolSection-dropdownWrapper {
  margin-right: 12px;

  &:after {
    display: none;
  }

  &:before {
    right: 7px;
    top: calc(50% - 2px);
    background-repeat: no-repeat;
    background-image: url("data:image/svg+xml,%3Csvg width=%276%27 height=%274%27 viewBox=%270 0 6 4%27 fill=%27none%27 xmlns=%27http://www.w3.org/2000/svg%27%3E%3Cpath d=%27M5.00506 0.413817C5.23825 0.191095 5.60551 0.195263 5.83143 0.427641C6.0582 0.660893 6.05369 1.03103 5.8167 1.2733L3.40473 3.58782C3.17841 3.80363 2.82568 3.80438 2.5933 3.58747C2.29148 3.29771 2.29148 3.29771 1.38603 2.42839C0.482784 1.56125 0.482784 1.56125 0.16829 1.25885C-0.0560968 1.02805 -0.0560968 0.65844 0.16829 0.427641C0.393201 0.196305 0.757388 0.191435 0.995763 0.413283L2.99983 2.33753L5.00506 0.413817Z%27 fill=%27white%27/%3E%3C/svg%3E%0A");
    background-size: contain;
    width: 8px;
    height: 5px;
    border: 0;
  }

  .toolSection-dropdown {
    width: 58px;
    height: 28px;
    font-size: 0.675rem;
    padding-left: 6px;
    color: $white;
    appearance: none;
  }
}

.jfReportModal {
  .toolToggle-custom {
    background-color: #B3B5C6;

    &:before {
      background: #fff;
    }
  }

  .toolToggle label {
    color: rgba(#fff,.6);

    &.forUnchecked {
      color: #fff;

      &:after {
        background: #fff;
      }
    }
  }

  .toolToggle-input {
    &:checked ~ {
      .jfReportToggle-custom {
        background: #4C7FF4;
      }

      .jfReportToggle-label {

        &.forChecked {
          color: #fff;
        }

        &.forUnchecked {
          color: rgba(#fff,.6);
        }
      }
    }
  }
}

.jfReport-pane, .jfReportModal {
  // Toggle //

  .toolToggle {
    display: inline-block;
    position: relative;

    &-custom {
      width: 36px;
      height: 22px;
      display: inline-block;
      position: relative;
      vertical-align: middle;
      border-radius: 30px;
      cursor: pointer;
      margin-left: 10px;
      transition: .3s ease-in-out;
      &:before {
        content: "";
        width: 16px;
        height: 16px;
        top: 3px;
        left: calc(0% + 3px);
        transition: .3s ease-in-out;
        border-radius: 50%;
        box-shadow: 0 2px 10px rgba(0,0,0,.1);
        position: absolute;
      }
    }

    &.toggled .toolToggle-custom {
      border-color: transparent;
      &:before {
        left: calc(100% - 19px);
      }
    }

    &-label {
      display: inline-block;
      vertical-align: middle;
      white-space: nowrap;
      line-height: 28px;
      user-select: none;
      transition: .3s;
      cursor: pointer;
      color: rgba(#fff,.6);
      &.forUnchecked {
        color: #fff;
      }
      &:after {
        width: 30px;
        height: 30px;
        position: absolute;
        left: calc(50% + 22px);
        border-radius: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        content: "";
        background: #fff;
        z-index: -1;
        pointer-events: none;
        opacity: 0;
      }
    }

    &-input {
      display: none;

      &:checked ~ {
        .jfReportToggle-custom {
          margin: em(0) em(24px) em(0) em(12px);
          background: #4C7FF4;

          &:before {
            left: calc(100% - #{em(13px)});
          }
        }
        .jfReportToggle-label {

          &.forChecked {
            color: #fff;
          }

          &.forUnchecked {
            color: rgba(#fff,.6);
          }
        }
      }
    }
  }

  // Toggle //
}

.jfReport-Modal {
  .toolToggle.toggled .toolToggle-custom {
    background-color: $ctaGreen;
  }
}

.imageUpload-wrapper:not(.dropArea) {
  background-color: #555F6E;
  border: 1px solid #303339;
  border-radius: 2px;
  padding: 11px;
  img {
    border-radius: 4px;
  }

  .imageUpload-info {
    position: relative;

    span {
      font-size: 16px;
    }

    button {
      position: absolute;
      bottom: 0;
    }
  }
}

.jfReportPalette-item {
  .colorHolder {
    .countMore {
      justify-content: center;
    }
  }

  .colorHolder.fewColor {
    .color:not(:first-child) {
      margin-left: 8px;
    }
    .arrowContainer {
      margin-left: auto;
    }
  }
}

.jfReportChoice[for="selectAll"] {
  margin-bottom: 13px;
}
