@reference 'tailwindcss';

:host {
  --emr-number-input-gap: calc(var(--spacing) * 2);
  --emr-number-input-control-bg: none;
  --emr-number-input-control-color: var(--color-neutral-500);
  --emr-number-input-control-hover-color: var(--color-neutral-600);
  --emr-number-input-control-active-color: var(--color-neutral-700);
  --emr-number-input-control-hover-bg: var(--color-surface-container);
  --emr-number-input-control-active-bg: var(--color-surface-container-high);
  --emr-number-input-control-font-size: theme(--text-2xl);
  --emr-number-input-control-border-radius: theme(--radius-md);
  --emr-number-input-suffix-gap: calc(var(--spacing) * 3);
  --emr-number-input-control-size: calc(var(--spacing) * 7);
  --emr-number-input-control-border: none;

  display: flex;
  gap: var(--emr-number-input-gap);

  .input {
    width: auto;
    max-width: none;
    flex-grow: 1;
    min-width: 0;
  }

  .input {
    background: none;
    outline: none;
    color: currentColor;
    font: inherit;
    border: none;
  }

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

  .controls {
    display: flex;
    height: 100%;
    gap: 0.375rem;
    user-select: none;
  }

  .control {
    cursor: pointer;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--emr-number-input-control-size);
    height: var(--emr-number-input-control-size);
    background: var(--emr-number-input-control-bg);
    color: var(--emr-number-input-control-color);
    font-size: var(--emr-number-input-control-font-size);
    line-height: var(--emr-number-input-control-font-size);
    border-radius: var(--emr-number-input-control-border-radius);
    position: relative;
    border: var(--emr-number-input-control-border);
    top: 1px;

    span {
      position: relative;
      top: -1px;
    }

    ::ng-deep {
      .mat-icon {
        line-height: 24px;
      }
    }

    &:hover {
      background: var(--emr-number-input-control-hover-bg);
      color: var(--emr-number-input-control-hover-color);
    }

    &[disabled] {
      pointer-events: none;
      opacity: 0.65;
    }
  }
}

:host-context(html.dark) {
  --emr-number-input-control-color: var(--color-neutral-300);
  --emr-number-input-control-hover-color: var(--color-neutral-200);
  --emr-number-input-control-hover-bg: var(--color-neutral-500);
}
