﻿/* ===============================
   NumInputX – core appearance
   =============================== */

.numx {
  appearance: textfield;
  -moz-appearance: textfield;
  -webkit-appearance: none;
  flex: 1 1 auto;
  width: 100%; /* let Bootstrap control width */
  padding-right: 34px; /* space for spinner */
}

/* Hide native spinners */
.numx::-webkit-inner-spin-button,
.numx::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ===============================
   Wrapper (Bootstrap-compatible)
   =============================== */

.numx-wrap {
  position: relative;
  display: inline-flex;        /* IMPORTANT: behave like input */
  align-items: stretch;
  width: 100%;                 /* width driven by input */
}

/* ===============================
   Spinner container (rail)
   =============================== */

.numx-spin {
  position: absolute;
  right: 1px;
  top: 1px;
  bottom: 1px;
  width: 22px;

  display: flex;
  flex-direction: column;

  padding-left: 1px;
  opacity: 0;
  transition: opacity .15s ease;

  border-top-right-radius: var(--bs-border-radius-sm, 3px);
  border-bottom-right-radius: var(--bs-border-radius-sm, 3px);
  overflow: hidden;
}

/* Left divider */
.numx-spin::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--bs-border-color, #ddd);

  border-top-right-radius: inherit;
  border-bottom-right-radius: inherit;
}

.numx-wrap:hover .numx-spin,
.numx-wrap:focus-within .numx-spin {
  opacity: 1;
}

/* ===============================
   Spinner buttons
   =============================== */

.numx-btn {
  position: relative;
  flex: 1;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  user-select: none;
}

.numx-btn:hover {
  background-color: rgba(var(--bs-body-color-rgb), 0.08);
}

.numx-btn:active {
  background-color: rgba(var(--bs-body-color-rgb), 0.16);
}

/* separator between up/down */
.numx-up {
  border-bottom: 1px solid var(--bs-border-color, #ddd);
}

/* ===============================
   Arrow visuals (rounded chevrons)
   =============================== */

.numx-btn::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--bs-secondary, #444);
  border-bottom: 2px solid var(--bs-secondary, #444);
  border-radius: 1px;
}

/* Up chevron */
.numx-up::before {
  transform: rotate(-135deg) translate(-.5px, -.5px);
}

/* Down chevron */
.numx-down::before {
  transform: rotate(45deg) translate(-.5px, -.5px);
}
