.container {
  position: relative;
  display: inline-block;
  margin: 20px;
}
canvas {
  position: absolute;
  top: 0;
  left: 0;
}
#sourceCanvas {
  z-index: 1;
}
#maskCanvas {
  z-index: 2;
  pointer-events: none;
}
.controls {
  margin: 20px;
}
#negativeBtn {
  padding: 10px 20px;
  background-color: #FF6347;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
#negativeBtn.negativeMode {
  background-color: #FF4500;
}
#resetBtn {
  padding: 10px 20px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 10px;
}

#resetBtn:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}
#testImage1, #testImage2 {
  padding: 10px 20px;
  background-color: #2196F3;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 10px;
}
#imageInput {
  margin-left: 10px;
}

#testImage1:hover, #testImage2:hover {
  background-color: #1976D2;
}
.spinner {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #2196F3;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 1000;
}

.spinner-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.file-input-container {
  margin-top: 10px;
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}
