#image-canvas {
  width: 100%; /* Makes canvas responsive */
  height: auto; /* Keeps the aspect ratio */
  border: 1px solid #000;
  cursor: grab;
}

#canvas-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 8px solid #c6c4c4;
  border-top: 8px solid #3498db;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
  display: none;
  z-index: 100;
}

#canvas-container {
  position: relative;
  width: 100%;
  max-width: 400px; /* Max width for larger screens */
  margin: 0 auto; /* Center the container */
  touch-action: none;
  overflow: hidden; /* Prevents scroll or bounce */
}

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

.alert {
  margin: 10px 0;
  border-radius: 5px;
}

/* Button styles */
.custom-file-upload {
  padding: 10px 20px;
  background-color: #3675f4;
  color: white;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 10px;
  transition: background-color 0.3s;
  border: none; /* Remove button border */
  font-size: 16px; /* Ensure font size consistency */
  display: inline-block; /* Match label styling */
  text-align: center;
}

.custom-file-upload:hover {
  background-color: #1347ae;
}

.button-group {
  display: flex;
  gap: 10px; /* Horizontal space between buttons */
  flex-wrap: wrap; /* Allows buttons to wrap to a new line if needed */
  justify-content: center; /* Centers buttons in the container */
}

.btn-solve {
  background-color: #2d9b52;
  color: white;
}

.btn-solve:hover {
  background-color: #086f2a;
}

.btn-clear {
  background-color: #f44336;
  color: white;
}

.btn-clear:hover {
  background-color: #d32f2f;
}

.btn-grey {
  background-color: grey;
  color: white;
}

.btn-grey:hover {
  background-color: darkgrey;
}

.btn-blue {
  background-color: #3675f4;
  color: white;
}

.btn-blue:hover {
  background-color: #1347ae;
  color: white;
}

/* Frame style */
#guideline-frame {
  position: absolute;
  top: 5%;
  left: 5%;
  width: 90%; /* Relative to canvas container */
  height: 90%; /* Adjust according to aspect ratio */
  border: 2px dashed #3498db;
  pointer-events: none;
  z-index: 10;
  box-sizing: border-box;
}

/* Responsive styling for smaller screens */
@media (max-width: 448px) {
  .button-group {
    flex-direction: column; /* Stack buttons vertically */
    align-items: center; /* Center-align the stacked buttons */
  }

  .btn-custom {
    margin-bottom: 10px; /* Add vertical space between buttons */
    width: 100%; /* Full width for a cleaner, mobile-friendly look */
  }

  .btn-custom:last-child {
    margin-bottom: 0; /* Remove margin on the last button */
  }
}
