/* styles.css */

/* General page styling */
body {
  font-family: Arial, sans-serif;
  margin: 20px;
}

/* Center the main heading */
h1 {
  text-align: center;
}

/* Container for Level Buttons */
#levelButtons {
  display: flex;
  justify-content: center; /* Centers buttons horizontally */
  gap: 15px; /* Space between buttons */
  margin-top: 20px; /* Space above the buttons */
}

/* Style the level buttons */
#levelButtons button {
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  border: 2px solid #333;
  border-radius: 5px;
  background-color: #fff;
  color: #333;
}

#levelButtons button:hover {
  background-color: #f0f0f0;
}

/* Hide elements when needed */
.hidden {
  display: none;
}

/* Center the game board horizontally */
#gameBoard {
  display: flex;
  flex-direction: column;
  align-items: center; /* Center items horizontally */
  justify-content: center; /* Center items vertically if needed */
  margin-top: 20px;
}

/* Wrapper for the thin cat, fraction container, fat cat */
.row-wrapper {
  display: flex;
  align-items: center; /* Vertically align all items */
  justify-content: center; /* Center the row horizontally */
  gap: 10px; /* Space between elements */
}

/* Container for fraction cards */
.fraction-container {
  display: flex;
  align-items: center; /* Vertically center the items */
  gap: 1rem; /* Space between fraction cards */
  margin: 0 10px; /* Horizontal margin */
  padding: 8px;
  border: 1px solid #ddd; /* Optional border to clarify area */
}

/* Each fraction card styling */
.fraction-card {
  display: flex;
  flex-direction: column; /* Stack pizza and label */
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: move; /* Draggable */
  background-color: #f9f9f9;
  border: 2px solid #333;
  border-radius: 4px;
  padding: 8px;
  user-select: none; /* Prevent text selection while dragging */

  /* Add transition for smooth movement */
  transition: opacity 0.2s ease, border 0.2s ease;
}

/* Style for the card being dragged */
.fraction-card.dragging {
  opacity: 0.5;
  border: 2px dashed #555;
}

/* The “pizza” circle */
.pizza {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1px solid #ccc; /* Visible boundary when hidden */
  background: none; /* Initially no background for Levels 2 & 3 */
}

/* Fraction label styling */
.fraction-label {
  font-size: 16px;
  text-align: center;
}

/* Thin and fat cat image styles */
.thin-cat, .fat-cat, .progress-image {
  width: 60px; /* Consistent size */
  height: auto; /* Maintain aspect ratio */
  border-radius: 50%; /* Make images round */
}

/* Progress Row Styling */
.progress-row {
  display: flex;
  align-items: center; /* Vertically align all items */
  justify-content: center; /* Center the row horizontally */
  gap: 5px; /* Space between progress images */
  margin-top: 20px;
}

/* Control Buttons Styling */
.control-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

/* Buttons styling */
button {
  padding: 8px 16px;
  font-size: 16px;
  cursor: pointer;
  border: none;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

/* 'Check the Pizzas!' enabled/disabled */
#checkPizzasButton:not(:disabled) {
  background-color: #4CAF50; /* Green background */
  color: white;
}

#checkPizzasButton:not(:disabled):hover {
  background-color: #45a049;
}

#checkPizzasButton:disabled {
  background-color: #ccc; /* Grey background */
  color: #666;
  cursor: not-allowed;
}

/* 'Check the Answers' enabled/disabled */
#checkAnswersButton:not(:disabled) {
  background-color: #008CBA; /* Blue background */
  color: white;
}

#checkAnswersButton:not(:disabled):hover {
  background-color: #007bb5;
}

#checkAnswersButton:disabled {
  background-color: #ccc;
  color: #666;
  cursor: not-allowed;
}

/* 'Reset' enabled/disabled */
#resetButton:not(:disabled) {
  background-color: #f44336; /* Red background */
  color: white;
}

#resetButton:not(:disabled):hover {
  background-color: #da190b;
}

#resetButton:disabled {
  background-color: #ccc;
  color: #666;
  cursor: not-allowed;
}

/* Message styling */
#message {
  text-align: center;
  width: 100%; /* Full width for proper centering */
  font-weight: bold;
  margin-top: 10px;
}

/* Optional: Smooth transition for progress images */
.progress-image {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Responsive Design */
@media (max-width: 600px) {
  .fraction-card {
    width: 50px;
    height: 70px;
  }

  .pizza {
    width: 50px;
    height: 50px;
  }

  .thin-cat, .fat-cat, .progress-image {
    width: 50px;
  }

  .fraction-container {
    gap: 0.5rem; /* Reduced gap for smaller screens */
    padding: 4px;
  }

  button {
    font-size: 14px;
    padding: 6px 12px;
  }
}
