.quiz-img-container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6); /* Gap between cards */
  justify-content: center; /* Center cards if there are fewer than 3 */
}

.quiz-img-item {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  /* padding: var(--space-6); */
  text-align: center;
  /* margin-bottom: var(--space-2); Adjust margin as gap is handled by container */
  display: flex;
  flex-direction: column;
  align-items: center;
  /* gap: var(--space-2); */
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  flex: 1 1 calc(33.333% - (2 * var(--space-6) / 3)); /* Up to 3 cards per line with gap */
  max-width: calc(33.333% - (2 * var(--space-6) / 3)); /* Ensure max width for 3 columns */
  min-width: 280px; /* Minimum width to prevent cards from becoming too small */
  overflow: hidden; /* Prevent overflow */
}

@media (max-width: 1024px) { /* Adjust for smaller screens, e.g., 2 cards per row */
  .quiz-img-item {
    flex: 1 1 calc(50% - (1 * var(--space-6) / 2));
    max-width: calc(50% - (1 * var(--space-6) / 2));
  }
}

@media (max-width: 768px) { /* Adjust for even smaller screens, e.g., 1 card per row */
  .quiz-img-item {
    flex: 1 1 100%;
    max-width: 100%;
  }
}

.quiz-img-image {
  width: 100%;
  height: -webkit-fill-available;
  object-fit: contain;
  /* margin-bottom: var(--space-5); */
  /* border-radius: var(--radius);
  margin: 9px 0px 0px 0px; */
}

#verify-button {
  display: block;
  width: fit-content;
  margin: var(--space-8) auto; /* More margin for prominence */
  padding: var(--space-4) var(--space-8); /* Larger padding */
  font-size: var(--font-size-xl); /* Larger font size */
  font-weight: bold;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  background-color: var(--primary); /* Primary button color */
  color: white; /* White text */
  border: none; /* No border */
  box-shadow: var(--shadow-md); /* Subtle shadow */
}

#verify-button:hover:not(:disabled) {
  background-color: var(--primary-dark); /* Darker on hover */
  box-shadow: var(--shadow-lg); /* Stronger shadow on hover */
  transform: translateY(-2px); /* Lift effect */
}

#verify-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}


.quiz-img-choices {
  display: flex;
  flex-direction: column; /* Stack options vertically */
  gap: var(--space-2); /* Gap between vertical options */
  width: 100%; /* Ensure choices take full width of the card */
  padding: 10px;
}

.quiz-choice-img {
  width: 100%; /* Make buttons take full width */
  padding: var(--space-3) var(--space-6); /* Adjusted padding for vertical stacking */
  background: white;
  border: 2px solid var(--gray-300); /* Thicker border */
  border-radius: var(--radius-md); /* Slightly more rounded corners */
  font-size: var(--font-size-base); /* Adjusted font size */
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
  position: relative; /* For feedback icon positioning */
  box-shadow: var(--shadow-sm); /* Subtle shadow */
}
.quiz-choice-img:active {
  transform: scale(0.98); /* Slightly reduce size on click */
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: var(--primary);
  box-shadow: var(--shadow-md); /* Stronger shadow */
}

.quiz-choice-img:hover:not(:disabled) {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: var(--primary);
  box-shadow: var(--shadow-md); /* Stronger shadow */
}

.quiz-choice-img.selected {
  border-color: var(--primary); /* Primary color border when selected */
  background-color: var(--primary-light); /* Light primary background */
  color: var(--primary-dark); /* Dark primary text */
  box-shadow: var(--shadow-md); /* Clearer shadow for selected state */
  transform: translateY(-2px); /* Slight lift for selected state */
}

.quiz-choice-img.correct {
  background: var(--success-light); /* Light green background */
  color: var(--success-dark); /* Dark green text */
  border-color: var(--success); /* Green border */
  animation: pop 0.3s ease-out;
  box-shadow: var(--shadow-md); /* Add shadow for consistency */
}

.quiz-choice-img.incorrect {
  background: var(--error-light); /* Light red background */
  color: var(--error-dark); /* Dark red text */
  border-color: var(--error); /* Red border */
  animation: shake 0.5s;
  box-shadow: var(--shadow-md); /* Add shadow for consistency */
}

.quiz-choice-img:disabled {
  cursor: not-allowed;
  opacity: 0.7; /* Slightly less opaque when disabled */
}

.quiz-choice-img .feedback-icon {
  width: 28px; /* Slightly larger icon */
  height: 28px; /* Slightly larger icon */
  right: var(--space-3); /* Adjusted position */
  top: 50%;
  translate: 0 -50%;
  position: absolute;
}

.quiz-choice-img .feedback-icon.success {
  color: var(--success-dark); /* Darker success color */
}

.quiz-choice-img .feedback-icon.error {
  color: var(--error-dark); /* Darker error color */
}

@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); } /* More pronounced shake */
  40%, 80% { transform: translateX(8px); }
}



/* Editor Mode Styles */
.editor-mode-active .quiz-img-item {
  cursor: pointer;
  position: relative;
}

/* Prevent choice buttons from being clickable in edit mode */
.editor-mode-active .quiz-choice-img {
  pointer-events: none;
}
