/* ==========================================================================
   QR Scanner Component — CylTrack Pro
   ========================================================================== */

/* --- Input group container --- */
.scan-input-group {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.scan-input-group.scan-disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* --- Text input --- */
.scan-field {
  flex: 1 1 auto;
  width: 100%;
  height: 48px;
  padding: 12px 16px;
  font-size: 16px; /* prevents iOS auto-zoom */
  line-height: 1.25;
  border: 2px solid #ccc;
  border-radius: 8px;
  background: #fff;
  color: #222;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.scan-field:focus {
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.scan-field:disabled {
  background: #f0f0f0;
  cursor: not-allowed;
}

/* --- Camera button --- */
.scan-camera-btn {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ccc;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 20px;
  transition: background 0.2s, border-color 0.2s;
  padding: 0;
}

.scan-camera-btn:hover {
  background: #f0f4f8;
  border-color: #3498db;
}

.scan-camera-btn:active {
  background: #dce7f0;
}

.scan-camera-btn:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

/* --- Status indicator bar --- */
.scan-status {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.scan-status.flash-pass {
  background: #27ae60;
  opacity: 1;
}

.scan-status.flash-warning {
  background: #f39c12;
  opacity: 1;
}

.scan-status.flash-error {
  background: #e74c3c;
  opacity: 1;
}

/* ==========================================================================
   Camera overlay
   ========================================================================== */
.scan-camera-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
}

.scan-camera-overlay video {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 4px;
}

/* --- Crosshair guide --- */
.scan-camera-overlay .scan-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200px;
  height: 200px;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  pointer-events: none;
  box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.35);
}

/* Corner accents */
.scan-camera-overlay .scan-crosshair::before,
.scan-camera-overlay .scan-crosshair::after {
  content: '';
  position: absolute;
  width: 30px;
  height: 30px;
  border-color: #fff;
  border-style: solid;
}

.scan-camera-overlay .scan-crosshair::before {
  top: -2px;
  left: -2px;
  border-width: 3px 0 0 3px;
  border-radius: 8px 0 0 0;
}

.scan-camera-overlay .scan-crosshair::after {
  bottom: -2px;
  right: -2px;
  border-width: 0 3px 3px 0;
  border-radius: 0 0 8px 0;
}

/* --- Close button --- */
.scan-camera-overlay .scan-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.scan-camera-overlay .scan-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}
