#file-input {
  display: none;
}

.dropzone {
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: #f8f9fa;
}

.dropzone:hover {
  border-color: #6c757d;
  background-color: #e9ecef;
}

.dropzone.border-primary {
  border-color: #0d6efd !important;
  background-color: #f8f9ff;
}

#camera-modal .modal-content {
  height: 100vh;
}

#camera-modal .modal-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: flex-start;
  padding-top: calc(env(safe-area-inset-top, 0px) + 15px);
  padding-left: 15px;
  padding-right: 15px;
  padding-bottom: 15px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
  border: none;
}

#camera-modal .modal-body {
  padding: 0;
}

#camera-container {
  position: relative;
  width: 100%;
  height: 100vh;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Landscape warning overlay - only shown in landscape */
.landscape-warning-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  color: #fff;
  text-align: center;
  padding: 2rem;
}

.landscape-warning-content {
  max-width: 400px;
}

.landscape-warning-content h4 {
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

.landscape-warning-content p {
  margin: 0;
  opacity: 0.8;
}

/* Show warning only when in landscape orientation on mobile devices */
@media (orientation: landscape) and (max-width: 991.98px) {
  .landscape-warning-overlay {
    display: flex;
  }

  /* Hide camera UI elements in landscape */
  .viewfinder-overlay,
  .camera-controls,
  .captured-photos-strip {
    display: none !important;
  }
}

.viewfinder-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewfinder-frame {
  position: relative;
  width: 85%;
  height: 75%;
  max-width: 600px;
  max-height: 500px;
  border: 2px dashed rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.3);
  cursor: move;
  touch-action: none;
}

.viewfinder-frame::before {
  content: 'Drag to move • Drag corners to resize';
  position: absolute;
  bottom: -35px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 13px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  opacity: 0.9;
  pointer-events: none;
}

.corner {
  position: absolute;
  width: 44px;
  height: 44px;
  border-color: #fff;
  border-style: solid;
  cursor: pointer;
  z-index: 10;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
  pointer-events: auto;
}

.corner:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.corner.top-left {
  top: -2px;
  left: -2px;
  border-width: 4px 0 0 4px;
  border-radius: 4px 0 0 0;
  cursor: nw-resize;
}

.corner.top-right {
  top: -2px;
  right: -2px;
  border-width: 4px 4px 0 0;
  border-radius: 0 4px 0 0;
  cursor: ne-resize;
}

.corner.bottom-left {
  bottom: -2px;
  left: -2px;
  border-width: 0 0 4px 4px;
  border-radius: 0 0 0 4px;
  cursor: sw-resize;
}

.corner.bottom-right {
  bottom: -2px;
  right: -2px;
  border-width: 0 4px 4px 0;
  border-radius: 0 0 4px 0;
  cursor: se-resize;
}

.captured-photos-strip {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  display: flex;
  gap: 24px;
  padding: 15px 20px;
  padding-bottom: calc(15px + env(safe-area-inset-bottom, 0px));
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.6);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.5) transparent;
  min-height: 130px;
  align-items: center;
}

.captured-photo {
  position: relative;
  flex-shrink: 0;
  width: 80px;
  height: 100px;
}

.captured-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.captured-photo .photo-number {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 500;
}

.captured-photo .remove-photo {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #dc3545;
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.captured-photo .remove-photo:hover {
  background: #c82333;
  transform: scale(1.1);
}

.captured-photo .crop-photo {
  position: absolute;
  top: -8px;
  left: -8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #0d6efd;
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  opacity: 1;
}

.captured-photo .crop-photo:hover {
  background: #0a5cd4;
  transform: scale(1.1);
}


.camera-controls {
  position: absolute;
  bottom: 160px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.pb-safe {
  padding-bottom: env(safe-area-inset-bottom, 20px);
}

#capture-btn {
  width: 72px;
  height: 72px;
  border: 4px solid #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

#capture-btn:active {
  transform: scale(0.9);
  background-color: #e9ecef;
}

#done-camera-btn {
  font-weight: 500;
}

#crop-modal .modal-content {
  height: 100vh;
}

#crop-modal .modal-header {
  background: #212529;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  padding-top: calc(env(safe-area-inset-top, 0px) + 35px);
  padding-bottom: 20px;
  min-height: 80px;
}

#crop-modal .modal-header .btn-close {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
}

#crop-modal .modal-footer {
  background: #212529;
  border-top: 1px solid #495057;
  padding-bottom: calc(15px + env(safe-area-inset-bottom, 0px));
}

#crop-modal .modal-title {
  font-size: 1rem;
  margin: 0 auto;
}

.crop-container {
  width: 100%;
  height: calc(100vh - 120px);
  min-height: 300px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#crop-image {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.cropper-view-box {
  outline-color: #0d6efd;
  outline-width: 2px;
}

.cropper-line,
.cropper-point {
  background-color: #0d6efd;
}

/* Rotation preview transitions */
.split-preview {
  transition: transform 0.3s ease;
}

.split-preview.rotate-90 {
  transform: rotate(90deg);
}

.split-preview.rotate-180 {
  transform: rotate(180deg);
}

.split-preview.rotate-270 {
  transform: rotate(270deg);
}

/* Page number stepper styles */
.page-number-stepper {
  justify-content: center;
}

.page-number-stepper .btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
}

.page-number-stepper .page-decrement {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.page-number-stepper .page-increment {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.page-number-stepper .page-number-input {
  border-left: 0;
  border-right: 0;
  font-weight: 500;
  font-size: 1rem;
  min-height: 44px;
}

.page-number-stepper .page-number-input:focus {
  border-color: #dee2e6;
  box-shadow: none;
}

/* Remove number input spinners */
.page-number-input::-webkit-outer-spin-button,
.page-number-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.page-number-input[type=number] {
  -moz-appearance: textfield;
}

@media (max-width: 575.98px) {
  #crop-modal .modal-dialog {
    margin: 0;
    max-width: 100%;
    height: 100%;
  }

  #crop-modal .modal-content {
    border-radius: 0;
    height: 100vh;
  }

  #crop-modal .modal-footer {
    padding-bottom: calc(25px + env(safe-area-inset-bottom, 20px));
  }

  .crop-container {
    height: calc(100vh - 200px);
  }

  #camera-modal .modal-dialog {
    margin: 0;
    max-width: 100%;
    height: 100%;
  }

  #camera-modal .modal-content {
    border-radius: 0;
  }

  #camera-modal .modal-header {
    padding-top: calc(env(safe-area-inset-top, 0px) + 10px);
  }

  .captured-photos-strip {
    bottom: 20px;
    padding: 15px 20px;
    padding-bottom: calc(15px + env(safe-area-inset-bottom, 20px));
    min-height: 140px;
  }

  .camera-controls {
    bottom: 180px;
  }

  #capture-btn {
    width: 72px;
    height: 72px;
  }
}

/* Batch Upload Wizard Styles */

/* Step Wizard Progress Line */
.wizard-progress-line {
  position: absolute;
  top: 20px;
  left: 0;
  z-index: 0;
  height: 2px;
}

/* Step Circle */
.wizard-step-circle {
  width: 40px;
  height: 40px;
}

/* Spinner Sizes */
.spinner-lg {
  width: 3rem;
  height: 3rem;
}

/* Split Preview Container */
.split-preview-container {
  min-height: 200px;
  max-height: 300px;
  overflow: hidden;
}

/* Split Preview Image Positioning */
.split-preview-positioned {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Max Width Constraints */
.max-w-70 {
  max-width: 70px;
}