@use "_theme.scss";

// Shared styles (used in both desktop popup and mobile modal)
.duplicate-copies-input {
  border: 1px solid var(--color-line);
  border-radius: var(--form-input-border-radius);
  color: var(--text-color-ultra-dark);
  outline: none;
  -moz-appearance: textfield;

  &::-webkit-inner-spin-button,
  &::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }

  &.has-error {
    border-color: var(--color-error);
  }
}

.duplicate-copies-error {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--color-error);
  font-size: var(--text-size-regular);
  margin-top: 4px;

  .icon.icon-holder.error-icon {
    display: flex;
    flex-shrink: 0;
  }
}

// Desktop: positioned popup
.duplicate-copies-popup {
  position: fixed;
  z-index: 1;
  background: var(--white);
  border: 1px solid var(--color-line);
  border-radius: 7px;
  box-shadow: 0 0 4px 0 #d6d6d6;
  translate: -50%;

  .duplicate-copies-inner {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .duplicate-copies-title {
    font-size: var(--text-size-label);
    color: var(--text-color-ultra-dark);
    margin: 0;
  }

  .duplicate-copies-field {
    display: flex;
    align-items: center;
    gap: 15px;
  }

  .duplicate-copies-label {
    font-size: var(--text-size-label);
    color: var(--text-color-dark);
    white-space: nowrap;
  }

  .duplicate-copies-input {
    height: 30px;
    width: 121px;
    font-size: var(--text-size-regular);
    padding: 0 12px;
  }

  .duplicate-copies-button {
    height: 36px;
    width: 100%;
    line-height: 1;
  }

  &::after {
    position: absolute;
    content: "";
    height: 15px;
    width: 15px;
    background: var(--white);
    transform: rotate(225deg);
    bottom: calc(100% - 7px);
    left: 50%;
    box-shadow: 1px 1px 3px -2px #d6d6d6;
    border: solid var(--color-line);
    border-width: 0 1px 1px 0;
  }
}

// Mobile/Tablet: modal dialog (follows PromptDialog pattern)
.duplicate-copies-dialog-container {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100% !important;

  .duplicate-copies-dialog {
    width: 100% !important;
    margin: 0 20px !important;
    max-width: 536px !important;

    @media (max-width: theme.$sm) {
      max-width: none !important;
    }

    .close-modal {
      padding: 16px 20px;
      border-bottom: 1px solid var(--color-line);
      display: flex;
      flex-direction: row;
      justify-content: space-between;

      @media (max-width: theme.$sm) {
        padding: 13px 20px;
        align-items: center;
      }

      .title {
        font-size: var(--text-size-h4);
        color: var(--text-color-ultra-dark);
        margin: 0;

        @media (max-width: theme.$sm) {
          font-size: var(--text-size-label);
        }
      }

      .close-button {
        border: none;
        background: none;
        width: 20px;
        height: 20px;
      }
    }

    .modal-body {
      padding: 30px 20px;
    }

    .label {
      color: var(--text-color-ultra-dark);
      font-size: var(--text-size-label);
      line-height: var(--text-size-label);
      margin: 0;
    }

    .duplicate-copies-input {
      width: 100%;
      height: 40px;
      padding: 5px 15px;
      margin-top: 10px;
      font-size: var(--text-size-label);
    }

    .action-buttons {
      display: flex;
      flex-direction: row;
      margin-top: 50px;

      .button {
        width: calc((100% - 12px) / 2);
        height: 40px;
        padding: 3px 10px;
        font-size: var(--text-size-label);
      }

      .button-primary {
        margin-left: 12px;
      }
    }
  }
}
