/* Search Box */
.group {
  display: flex;
  position: relative;
  max-width: 350px;
}

#search_container .input {
  width: 100%;
  height: 45px;
  padding-left: 1.5rem;
  line-height: 1.15;
  border: 0;
  border-radius: 12px;
  background-color: #e3e3e3;
  color: #000;
  transition: all 0.1s cubic-bezier(0.19, 1, 0.22, 1);
  cursor: text;
  z-index: 0;
}

#search_container input:focus,
#search_container input:hover {
  outline: none;
  box-shadow: 0px 3px 0 0 #192B80;
}

/* View Options */
.view-options>.dropdown.select {
  margin-left: auto;
  flex: 0 0 auto;
}

/* Checkbox styling */
.view-options input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  display: inline-block;
  position: relative;
  width: 1.5em;
  height: 1.5em;
  margin-top: 5px;
  margin-bottom: 5px;
  vertical-align: middle;
  border: 1px solid #424242;
  border-radius: 5px;
  cursor: pointer;
  transition: border-color 0.1s, transform 0.1s, background-color 0.1s;
}

.view-options input[type="checkbox"]::after {
  content: "\2713";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  color: #fff;
  font-size: 0.9em;
  transition: transform 0.1s ease-out;
}

.view-options input[type="checkbox"]:checked {
  background-color: #192B80;
  border-color: #192B80;
  transform: scale(1.1);
}

.view-options input[type="checkbox"]:checked::after {
  transform: translate(-50%, -50%) scale(1);
}

@keyframes ripple-check {
  0% {
    box-shadow: 0 0 0 0 rgba(25, 43, 128, 0.7);
  }

  70% {
    box-shadow: 0 0 0 0.5em rgba(25, 43, 128, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(25, 43, 128, 0);
  }
}

@keyframes pop-check {
  0% {
    transform: scale(0.8);
  }

  60% {
    transform: scale(1.3);
  }

  100% {
    transform: scale(1.1);
  }
}

.view-options input[type="checkbox"]:active {
  animation: ripple-check 0.2s ease-out forwards,
    pop-check 0.1s ease-out forwards;
}

.dropdown.select {
  width: fit-content;
  cursor: pointer;
  position: relative;
  transition: 0.2s;
  color: black;
  overflow: visible;
  display: inline-block;
  vertical-align: middle;
}

.dropdown .selected {
  background-color: #192B80;
  color: white;
  font-weight: 600;
  padding: 5px;
  border-radius: 5px;
  position: relative;
  z-index: 1001;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dropdown .arrow {
  height: 12px;
  width: 25px;
  transform: rotate(-90deg);
  fill: white;
  transition: 0.1s;
}


.dropdown .options {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  right: auto;
  display: flex;
  flex-direction: column;
  background-color: #e3e3e3;
  border-radius: 5px;
  padding: 5px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-0.5rem);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 1000;
}

.dropdown:hover .options,
.dropdown.open .options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown:hover .selected .arrow {
  transform: rotate(0deg);
}

.dropdown .option {
  display: inline-block;
  border-radius: 5px;
  padding: 5px;
  background-color: #e0e0e0;
  color: #3f3f3f;
  width: 150px;
  font-size: 15px;
}

.dropdown .option:hover {
  background-color: #cccccc;
}

.dropdown .options input[type="radio"] {
  display: none;
}

.dropdown .options label::before {
  content: attr(data-txt);
}


.dropdown .options input[type="radio"]:checked+label {
  background-color: #192B80;
  color: white;
  font-weight: 600;
}

.dropdown.select:has(.options input[type="radio"]#zoom-2:checked) .selected::before {
  content: attr(data-two);
}

.dropdown.select:has(.options input[type="radio"]#zoom-1\.5:checked) .selected::before {
  content: attr(data-one-and-a-half);
}

.dropdown.select:has(.options input[type="radio"]#zoom-1:checked) .selected::before {
  content: attr(data-one);
}

.dropdown.select:has(.options input[type="radio"]#zoom-0\.75:checked) .selected::before {
  content: attr(data-three-quarters);
}

.dropdown.select:has(.options input[type="radio"]#zoom-0\.5:checked) .selected::before {
  content: attr(data-half);
}

.dropdown.select:has(.options input[type="radio"]#zoom-0\.33:checked) .selected::before {
  content: attr(data-default);
}

.dropdown.select:has(.options input[type="radio"]#rows-1:checked) .selected::before {
  content: attr(data-one);
}

.dropdown.select:has(.options input[type="radio"]#rows-2:checked) .selected::before {
  content: attr(data-two);
}

.dropdown.select:has(.options input[type="radio"]#rows-3:checked) .selected::before {
  content: attr(data-three);
}

.dropdown.select:has(.options input[type="radio"]#rows-4:checked) .selected::before {
  content: attr(data-four);
}

.dropdown.select:has(.options input[type="radio"]#rows-I:checked) .selected::before {
  content: attr(data-I);
}

.dropdown.select:has(.options input[type="radio"]#rows-H:checked) .selected::before {
  content: attr(data-H);
}

.dropdown.select:has(.options input[type="radio"]#rows-C:checked) .selected::before {
  content: attr(data-C);
}



/* Filter */
#cutout_filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  border-radius: 0.5rem;
  padding: 0.25rem;
  width: 100%;
  font-size: 18px;
}

#cutout_filters .radio {
  flex: 0 1 auto;
  margin: 0 0.25rem;
}

#cutout_filters .sort-switch {
  flex: 0 1 auto;
  margin: 0 0.25rem;
  align-items: center;
  vertical-align: middle;
}

#cutout_filters .radio input {
  display: none;
}

#cutout_filters .radio .name {
  display: inline-flex;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 0.5rem 1rem;
  color: #555;
  background: none;
  font-weight: 600;
  transition: background .1s ease, color .1s ease;
}

#cutout_filters .radio .name:hover {
  color: #192B80;
  background: rgba(25, 43, 128, 0.1);
}

#cutout_filters .radio input:checked+.name {
  color: #192B80;
  background: rgba(25, 43, 128, 0.25);
}

#cutout_filters .radio input:checked+.name:hover {
  background: rgba(25, 43, 128, 0.3);
}

@keyframes filter-press {
  0% {
    transform: scale(1);
    background-color: transparent;
  }

  50% {
    transform: scale(0.92);
    background-color: rgba(59, 78, 175, 0.1);
  }

  100% {
    transform: scale(0.92);
    background-color: rgba(25, 43, 128, 0.25);
  }
}

.sort-btn,
.view-toggle {
  display: inline-block;
  padding: 0.4em 0.8em;
  font: 16px sans-serif;
  background: #192B80;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  margin: 0.25em;
}

/* list view */
#cutout.list-view {
  display: block;
  width: 500px;
}

#cutout.list-view .cutbox {
  min-height: 40px;
  margin: 0.25em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
}

.list-view .cutbox-text {
  margin-bottom: 0rem !important;
}

#cutout.list-view .cutbox-img,
#cutout.list-view .cutradio {
  display: none;
}

/* Connector Orientation Toggle */
label.cutbox {
  position: relative;
}

label.cutbox .orient-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  padding: 2px;
  background: rgba(25, 43, 128, 0.3);
  border: none;
  border-radius: 4px;
  color: #192B80;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}


label.cutbox .orient-btn:hover {
  background: #192B80;
  color: white;
}


/* Cutout layout */
#cutout>input.cutradio {
  display: none !important;
}

#cutout {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.25rem;
  justify-content: center;
  width: calc(100% - 2rem);
  max-width: auto;
  max-height: 675px;
  min-width: 225px;
  overflow-y: scroll;
  box-sizing: border-box;
  border: 1px solid #c9c9c9;
  border-radius: 12px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.05);
  scrollbar-width: thin;
}

/* Card base */
#cutout label.cutbox {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(25, 42, 128, 0.02);
  border: 1px solid rgba(25, 43, 128, 0.3);
  border-radius: 12px;
  transition:
    border-color 0.1s ease,
    box-shadow 0.1s ease,
    color 0.1s ease,
    font-weight 0.1s ease;
  flex: 0 1 180px;
  min-width: auto;
  min-height: 150px;
  box-sizing: border-box;
  position: relative;
  font-size: 16px;
  color: #3b3b3b;
}

#cutout label.cutbox:hover {
  border-color: #192B80;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  cursor: grab;
}

.cutbox-img {
  flex: 0 0 auto;
  margin-top: 0.5rem;
}

.cutbox-img {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.5rem;
}

#cutout label.cutbox .cutbox-img img {
  transition: all 0.15s ease;
}

#cutout label.cutbox:hover .cutbox-img img {
  transform: translateY(-4px) scale(1.05);
}

#cutout label.cutbox:active .cutbox-img img {
  opacity: 0.8;
  cursor: grabbing;
}


.cutbox-text {
  flex: 0 0 auto;
  margin-top: 0.25em;
  margin-bottom: 0.5em;
  text-align: center;
}

#cutout input.cutradio:checked+label.cutbox {
  border: 1px solid #192B80;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  background: rgba(25, 43, 128, 0.15);
  color: #192B80;
}

#cutout input.cutradio:checked+label.cutbox,
#cutout input.cutradio:checked+label.cutbox:hover {
  cursor: grabbing;
}

#cutout label.cutbox.cutbox_admin {
  background-color: #FFEEDD;
  background: repeating-linear-gradient(-45deg, white, white 5px, #ffd3a3 6px, #ffd0a1 6px, white 7px);
}

#cutout input.cutradio:checked+label.cutbox.cutbox_admin {
  border: 1px solid #ff952c;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  background: repeating-linear-gradient(-45deg, white, white 5px, #ffa64d 6px, #ffbc7a 6px, white 7px);
  color: #000000;
}


/* Summary Table*/
:root {
  --main: #f8fbff;
  --main-light: #d7efff;
  --main-dark: #192B80;
  --text: #1a0040;
}

#plate_details,
#product_details {
  display: none;
}

table#prices {
  width: calc(100% - 1rem);
  max-width: 800px;
  margin: 1.5em auto;
  border: 1px solid var(--main-dark);
  background: var(--main);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
  font-family: sans-serif;
  color: var(--text);
  text-align: center;
}

table#prices .price_row {
  top: 0;
  background: var(--main-dark);
}

table#prices .price_row td {
  font-weight: 700;
  font-size: 1.1em;
  padding: 0.5em 1em;
  cursor: pointer;
  transition: background 0.2s ease;
  color: white;
}

table#prices .price_row td:hover {
  background: var(--main);
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  color: black;
}

table#prices .price_row td.active {
  background: var(--main);
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  color: black;
}

table#prices tr#plate_details>td {
  font-weight: 700;
}

table#prices tr#plate_details>td .details td {
  font-weight: 400;
}

table#prices .details {
  table-layout: fixed;
  width: 90%;
  margin: 0.75em auto;
  border-collapse: collapse;
}

table#prices .details th,
table#prices .details td {
  padding: 0.6em 0.4em;
  background: var(--main);
  transition: background 0.05s ease;
  text-align: center;
  border: none;
  border-bottom: 1px solid var(--main-dark);
  white-space: normal;
  overflow-wrap: break-word;
}

table#prices .details th:nth-child(1),
table#prices .details td:nth-child(1) {
  text-align: left;
}

table#prices .details th:nth-child(2),
table#prices .details td:nth-child(2) {
  width: 40%;
}

table#prices .details th:last-child,
table#prices .details td:last-child {
  text-align: right;
}

table#prices .details th:nth-child(1),
table#prices .details td:nth-child(1),
table#prices .details th:last-child,
table#prices .details td:last-child {
  width: auto;
}

table#prices .details tr:hover td {
  background: var(--main-light);
}

table#prices td[id$="_total"] {
  cursor: pointer;
}

table#prices .details td:empty {
  display: none;
}

/* Connbox Styling */
#conn_wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.5rem;
}

.connbox {
  display: flex;
  flex-direction: column;
  flex: 0 0 180px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0.75rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.connbox img {
  height: 100px;
  object-fit: contain;
  flex-shrink: 0;
}

.connbox>a {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.connbox .tooltip {
  margin-top: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.connbox .tooltip select,
.connbox .tooltip input[type="submit"] {
  margin-top: auto;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
  padding: 0.25rem;
}

.connbox.installed>input[type="submit"] {
  margin-top: auto;
  margin-bottom: 0.25rem;
  width: 100%;
  padding: 0.25rem;
  font-size: 0.9rem;
}

.connbox>input[type="submit"] {
  margin-top: auto;
  margin-bottom: 0.25rem;
  width: 100%;
  padding: 0.25rem;
  font-size: 0.9rem;
}

/* Tooltip */
.tooltip-box {
  position: absolute;
  z-index: 1000;
  padding: 8px 16px;
  background-color: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  font-family: -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: #282828;
  border: 1px solid #192B80;
}

.tooltip-box tr + tr td {
  border-top: 1px solid #d4eafa;
}

.tooltip-box td {
  padding: 6px 12px;
  vertical-align: middle;
}

.tooltip-box tr:nth-child(even) td {
  background-color: #f8fbff;
}

.tooltip-box td.tt-pn {
  font-weight: 600;
  color: #000000;
}
.tooltip-box td.tt-stock {
  color: #666666;
}
.tooltip-box td.tt-price {
  font-weight: 600;
  color: #0A8A00;
}
.tooltip-box td.tt-out {
  font-weight: 600;
  color: #CC0000;
}

/* Infobox */
/* Base infobox card */
#infobox.infobox {
  position: absolute;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  border: 1px solid #192B80;
  font-family: -apple-system, Arial, sans-serif;
  font-size: 14px;
  color: #1f2937;
  overflow: hidden;
  padding: 0.5em;
  margin-top: 0.5em;
}

/* Title row */
#infobox.infobox > div:first-child {
  font-weight: 600;
  font-size: 15px;
  text-align: center;
  background: #f3f4f6;
  border-radius: 6px;
  margin-bottom: 10px;
}

/* Close button */
#infobox .closebox {
  position: absolute;
  top: 10px;
  right: 4px;
  width: 22px;
  height: 26px;
  background: transparent;
  font-size: 16px;
  color: #6b7280;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid #d1d5db;
}

#infobox .closebox:hover {
  background: #f3f4f6;
  color: #111827;
}

#infobox input[type="submit"]:not(.closebox),
#infobox button:not(.closebox) {
  appearance: none;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  padding: 6px 8px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;

}

#infobox input[type="submit"]:hover,
#infobox button:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
}

#infobox input[type="submit"][value="Remove"] {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}
#infobox input[type="submit"][value="Remove"]:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

#infobox input[type="submit"][value="Set"] {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e3a8a;
}
#infobox input[type="submit"][value="Set"]:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

