/* QuickPadX styles extracted from quickPadX.jsp */

#quickPadX-root table td {
  position: relative;
}

#quickPadX-root table td a.scanSearch {
  position: absolute;
  display: inline-block;
  vertical-align: top;
  top: 5px;
  right: 4px;
  height: 20px;
  width: 36px;
  font-weight: 300;
  line-height: 1.0;
  background: transparent;
  font-size: 1px;
  color: #fff;
  text-align: center;
  padding: 0;
  border: none;
  cursor: pointer;
  z-index: 2000;
}

.iOS:not(.iPad) #quickPadX-root table td a.scanSearch {
  right: -17px;
}

@media all and (device-width: 768px) and (device-height: 1024px) and (orientation:portrait) {
  #quickPadX-root table td a.scanSearch {
    right: -16px;
  }
}

#quickPadX-root table td a.scanSearch:before {
  font-family: "FontAwesome";
  content: "\f02a";
  position: relative;
  display: inline-block;
  vertical-align: middle;
  text-align: center;
  font-size: 22px;
  color: #000;
  line-height: 1.0;
  height: 20px;
  width: 36px;
  transform: scale(1.2, 1.0);
}

#quickPadX-root table td a.scanSearch:after {
  content: " ";
  display: inline-block;
  position: absolute;
  top: 8px;
  left: 2px;
  width: 32px;
  height: 12px;
  text-align: center;
  border: 0;
  clip-path: polygon(0% 0%, 100% 0%, 50% 100%);
  -moz-clip-path: polygon(0% 0%, 100% 0%, 50% 100%);
  -webkit-clip-path: polygon(0% 0%, 100% 0%, 50% 100%);
  -ms-clip-path: polygon(0% 0%, 100% 0%, 50% 100%);
  -o-clip-path: polygon(0% 0%, 100% 0%, 50% 100%);
  border-top: 1px solid #92e842;
  background: rgba(146,232,66,0.75);
  background: -moz-linear-gradient(top, rgba(146,232,66,0.75) 0%, rgba(146,232,66,0.3) 100%);
  background: -webkit-gradient(left top, left bottom, color-stop(0%, rgba(146,232,66,0.75)), color-stop(100%, rgba(146,232,66,0.3)));
  background: -webkit-linear-gradient(top, rgba(146,232,66,0.75) 0%, rgba(146,232,66,0.3) 100%);
  background: -o-linear-gradient(top, rgba(146,232,66,0.75) 0%, rgba(146,232,66,0.3) 100%);
  background: -ms-linear-gradient(top, rgba(146,232,66,0.75) 0%, rgba(146,232,66,0.3) 100%);
  background: linear-gradient(to bottom, rgba(146,232,66,0.75) 0%, rgba(146,232,66,0.3) 100%);
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#92e842', endColorstr='#92e842', GradientType=0 );
}

#quickPadX-root .searching-container {
  display: inline-block;
  color: #000000;
}

#quickPadX-root .spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  border: 2px solid #000000;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
  vertical-align: middle;
}

/* Keyframes used by both inline overlay spinner and .spinner class */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Overlay for add-to-cart/import flows */
#qp-loading-overlay {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
}

#qp-loading-overlay .qp-overlay-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  padding: 30px;
  border-radius: 8px;
  text-align: center;
}

#qp-loading-overlay .qp-overlay-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #f39c12;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

#qp-loading-overlay #qp-loading-overlay-text,
#qp-loading-overlay .qp-overlay-text {
  font-size: 16px;
  color: #333;
}

/* Success icon to replace spinner on success */
.qp-overlay-icon-success {
  display: inline-block;
  width: 40px;
  height: 40px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: #5cb85c; /* green */
  color: #fff;
  position: relative;
  text-align: center;
}
.qp-overlay-icon-success::before {
  content: "\2713"; /* check mark */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  font-size: 26px;
  font-weight: bold;
}

/* QuickPad description text colors (replaces <font color=...>) */
.qp-desc { /* base styling if needed */ }
.qp-desc--ok { color: #5e5e5e; }
.qp-desc--error { color: #d1151d; }

/* File Upload tab container */
#fileup-div {
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  padding: 16px;
  background: #fff;
  margin-top: 12px;
}

/* Slightly tighter padding on mobile */
#quickPadX-root.mobile #fileup-div {
  padding: 12px;
}

/* Mobile overrides, using wrapper class */
#quickPadX-root.mobile table td a.scanSearch {
  top: 18px;
  right: 0px;
  height: 20px;
  width: 36px;
}

#quickPadX-root.mobile table td a.scanSearch:before {
  font-size: 23px;
  height: 20px;
  width: 36px;
}

#quickPadX-root.mobile table td a.scanSearch:after {
  top: 10px;
  left: 2px;
  width: 32px;
  height: 12px;
}

/* Alerts & helper text for QuickPad UI */
.qp-alert {
  padding: 8px 10px;
  background: #f5f7fa;
  border-left: 3px solid #2c7be5; /* default info color */
  margin: 8px 0;
  font-size: 0.95em;
}
.qp-alert--info { border-color: #2c7be5; }
.qp-help {
  color: #6c757d;
  font-size: 0.9em;
  margin-left: 8px;
}

/* Tabs styling */
.qp-tabs {
  border-bottom: 1px solid #d9d9d9;
  margin-top: 0 !important;
  margin-bottom: -10px;
}
.qp-tab {
  padding: 10px 20px;
  margin-right: 5px;
  border: 1px solid #d9d9d9;
  border-radius: 3px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: #eeeeee; /* theme neutral */
  color: #333;         /* theme text */
  cursor: pointer;
}
.qp-tab:hover {
  background: #e6e6e6;
}
.qp-tab--active {
  background: #ffffff; /* pop active tab */
  color: #333;
  border-color: #5cb85c; /* will be overridden by JS to theme button color if present */
}
.qp-tab:focus {
  outline: 2px solid #2c7be5;
  outline-offset: 2px;
}

/* Page title spacing */
.qp-page-title {
  margin: 0 0 8px 0 !important; /* enforce no top margin */
}

/* Remove extra space at very top of QuickPad content */
#quickPadX-root { margin-top: -12px !important; padding-top: 0; }
#qpcontent { margin-top: 0; }
#qpcontent > tbody > tr:first-child > td { padding-top: 0 !important; }
