src/components/ScaleModal/ScaleModal.scss
@import '../../constants/styles';
@import '../../constants/modal';

.ScaleModal {
  @extend %modal;

  .modal-container {
    width: 480px;
    overflow-y: visible;

    @include mobile {
      width: 100%;
      position: fixed;
      border-radius: 0;
      inset-inline-start: 0;
      inset-block-end: 0;
    }

    .content-container {
      padding: 24px 16px 16px 16px;

      .ui__choice__label {
        font-weight: bold;
        font-size: 13px;
        line-height: 16px;
        display: flex;
        align-items: center;
      }

      .scaleSetting {
        .custom-scale-option {
          padding: 4px 0px;
        }
        .custom-option-wrapper {
          display: flex;
          align-items: center;
          justify-content: space-between;
          margin-bottom: 8px;

          .calibrate-btn {
            font-weight: 400;
            line-height: 16px;
            /* identical to box height */

            display: flex;
            align-items: center;
            text-align: center;
            color: var(--blue-5);
            background-color: transparent;
            border: none;
            cursor: pointer;

            &:hover {
              color: var(--blue-6);
            }
          }
        }

        .selector {
          margin-top: 16px;
          width: 100%;
          height: 32px;
          margin-bottom: 18px;

          .Dropdown__wrapper {
            width: 100%;
            height: 100%;

            .Dropdown {
              height: 100%;
              width: 100% !important;
              text-align: start;

              .arrow {
                flex: 0 1 auto;
              }
            }
          }
        }

        .block {
          height: 18px;
        }

        .custom-scale-container {
          margin-top: 8px;
          margin-bottom: 8px;

          .scale-ratio-display {
            @include mobile {
              .left-container,
              .right-container {
                flex: 1;

                .input-wrapper > div {
                  flex: 1;
                }
              }
            }

            .unit-label {
              padding-bottom: 8px;
            }

            .scale-ratio-equal {
              padding-top: 24px;
              font-size: 20px;
              width: 28px;
              text-align: center;
            }

            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
          }

          .input-wrapper {
            display: flex;
            flex-direction: row;

            .scale-input {
              border-radius: var(--border-radius);
              border: 1px solid var(--border);
              width: 94px;
              height: 32px;
              margin-inline-end: 8px;
              padding-inline-start: 8px;

              @include mobile {
                width: 79px;
                height: 32px;
              }

              &.invalid-value {
                border-color: var(--red);
              }

              &:not(.invalid-value):focus {
                border: 1px solid var(--blue-5);
              }
            }

            .unit-input {
              width: 100px;
              height: 32px;

              .Dropdown__wrapper {
                width: 100%;
                height: 100%;

                .Dropdown {
                  height: 100%;
                  text-align: start;
                }
              }

              @include mobile {
                width: 4rem;
                height: 2rem;
              }
            }

            // To remove arrows from input
            /* Chrome, Safari, Edge, Opera */
            input::-webkit-outer-spin-button,
            input::-webkit-inner-spin-button {
              -webkit-appearance: none;
              margin: 0;
            }
            /* Firefox */
            input[type='number'] {
              -moz-appearance: textfield;
            }
          }

          .warning-alert {
            position: relative;
            margin-inline-end: 8px;

            input {
              margin-inline-end: 0px !important;
            }

            .Icon {
              text-align: center;
              position: absolute;
              inset-block-start: 50%;
              inset-inline-end: 5px;
              margin: auto;
              transform: translateY(-50%);
              color: var(--red);
              display: block;
            }
          }
          .warning-alert-icon {
            display: none;
          }

          .warning-messages {
            height: 16px;
            font-weight: 400;
            color: var(--red);
            margin-top: 4px;
            position: relative;
            display: flex;

            .world-value-warning {
              position: absolute;
              inset-inline-start: 246px;
            }
          }
        }
      }

      .precision-container {
        display: flex;
        font-size: 13px;
        font-weight: 400;
        margin-top: 16px;
        align-items: center;
        justify-content: space-between;
        border-top: 1px solid var(--modal-stroke-and-border);
        padding-top: 16px;
        gap: 16px;

        .precision-selector {
          display: flex;
          justify-content: space-between;
          align-items: center;
          width: 288px;
          height: 32px;

          @include mobile {
            flex: 2;
          }

          .precision-title {
            height: 1rem;
            font-weight: normal;
            font-size: 13px;
            line-height: 16px;

            @include mobile {
              margin-inline-end: 8px;
            }
          }

          .selector {
            width: 223px;
            height: 32px;
            z-index: 0;

            @include mobile {
              width: 100%;
            }

            .Dropdown__wrapper {
              width: 100%;
              height: 100%;

              .Dropdown {
                height: 100%;
                width: 100% !important;
                text-align: start;

                .arrow {
                  flex: 0 1 auto;
                }
              }
            }
          }
        }

        .ui__choice__label {
          font-weight: 400;
        }

        .fractional-units-container {
          @include mobile {
            flex: 1;
          }
        }
      }
    }

    .footer {
      display: flex;
      padding: 16px;
      align-items: center;
      justify-content: flex-end;
      width: 100%;
      box-shadow: inset 0px 1px 0px var(--modal-stroke-and-border);
      margin: 0;

      .scale-update {
        height: 32px;
        min-width: 72px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--blue-5);
        background-color: transparent;
        border: 1px solid var(--blue-5);
        box-sizing: border-box;
        border-radius: var(--border-radius);
        cursor: pointer;
        margin-inline-end: 8px;

        @include mobile {
          font-size: 13px;
        }

        &:enabled:hover {
          border: solid 1px var(--blue-6);
          color: var(--blue-6);
        }

        &:disabled {
          opacity: 0.5;
          cursor: not-allowed;
        }
      }

      .scale-create {
        @include button-reset;
        background: var(--primary-button);
        border-radius: var(--border-radius);
        padding: 0 8px;
        height: 32px;
        min-width: 72px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        color: var(--primary-button-text);
        cursor: pointer;

        @include mobile {
          font-size: 13px;
        }

        &:enabled:hover {
          background: var(--primary-button-hover);
        }

        &:disabled {
          opacity: 0.5;
          cursor: not-allowed;
        }
      }
    }
  }

  .ui__choice__input__check.ui__choice__input__check--checked {
    border: 3px solid var(--gray-0);
    outline: solid 1px var(--blue-5);
    background-color: var(--blue-5);
  }
}
