@keyframes scanLine {
  0% {
    top: 0;
    opacity: 1;
  }

  50% {
    top: calc(100% - 2px);
    opacity: 0.8;
  }

  100% {
    top: 0;
    opacity: 1;
  }
}

@media (max-width: 576px) {
  #qrModal .modal-dialog {
    max-width: 95% !important;
    margin: 1rem;
  }

  #qrModal #qrCameraVideo,
  #qrModal #qrCameraCanvas {
    width: 100% !important;
    height: auto !important;
    max-width: 360px;
  }
}

.qr-modal-file-input {
  display: none;
}

#qrModal .qr-modal-dialog {
  max-width: 520px;
}

#qrModal .qr-modal-content {
  border: none;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
}

#qrModal .qr-modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
  outline: none;
  box-shadow: none;
  opacity: 0.78;
  -webkit-tap-highlight-color: transparent;
}

#qrModal .qr-modal-close-btn:hover {
  color: #0f172a;
  opacity: 1;
  transform: scale(1.06);
}

#qrModal .qr-modal-close-btn:focus-visible {
  opacity: 1;
  color: #0f172a;
}

#qrModal .qr-modal-close-btn span {
  display: block;
  transform: translateY(-1px);
}

#qrModal .qr-modal-body {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 14px;
  position: relative;
  overflow: hidden;
}

#qrModal .qr-modal-layer {
  position: relative;
  z-index: 2;
}

#qrModal .qr-modal-title {
  font-size: 1.5rem;
  color: #0f172a;
}

#qrModal .qr-camera-container {
  position: relative;
  display: inline-block;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

#qrModal .qr-camera-video {
  display: block;
  border-radius: 10px;
}

#qrModal .qr-camera-canvas {
  display: none;
}

#qrModal .qr-scan-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#qrModal .qr-scan-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 180px;
  height: 180px;
}

#qrModal .qr-scan-corner {
  position: absolute;
  width: 24px;
  height: 24px;
}

#qrModal .qr-scan-corner-top-left {
  top: 0;
  left: 0;
  border-top: 3px solid #0d6efd;
  border-left: 3px solid #0d6efd;
  border-radius: 6px 0 0 0;
}

#qrModal .qr-scan-corner-top-right {
  top: 0;
  right: 0;
  border-top: 3px solid #0d6efd;
  border-right: 3px solid #0d6efd;
  border-radius: 0 6px 0 0;
}

#qrModal .qr-scan-corner-bottom-left {
  bottom: 0;
  left: 0;
  border-bottom: 3px solid #0d6efd;
  border-left: 3px solid #0d6efd;
  border-radius: 0 0 0 6px;
}

#qrModal .qr-scan-corner-bottom-right {
  bottom: 0;
  right: 0;
  border-bottom: 3px solid #0d6efd;
  border-right: 3px solid #0d6efd;
  border-radius: 0 0 6px 0;
}

#qrModal .qr-scan-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #0d6efd, transparent);
  animation: scanLine 2s ease-in-out infinite;
}

#qrModal .qr-scan-status {
  font-size: 0.9rem;
  min-height: 20px;
  color: #64748b !important;
}

[data-bs-theme="dark"] #qrModal .qr-modal-content {
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.42);
}

[data-bs-theme="dark"] #qrModal .qr-modal-body {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.98) 0%, rgba(15, 23, 42, 1) 100%);
}

[data-bs-theme="dark"] #qrModal .qr-modal-title {
  color: #e2e8f0;
}

[data-bs-theme="dark"] #qrModal .qr-modal-close-btn {
  color: #cbd5e1;
  opacity: 0.82;
}

[data-bs-theme="dark"] #qrModal .qr-modal-close-btn:hover {
  color: #f8fafc;
  opacity: 1;
}

[data-bs-theme="dark"] #qrModal .qr-modal-close-btn:focus-visible {
  color: #f8fafc;
  opacity: 1;
}

[data-bs-theme="dark"] #qrModal .qr-camera-container {
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
}

[data-bs-theme="dark"] #qrModal .qr-scan-status {
  color: #94a3b8 !important;
}
