/* Apply box-sizing globally */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Basic styling for the form */
body {
  font-family: Arial, sans-serif;
  padding: 20px;
  background-color: #f5f5f5;
}

h1 {
  text-align: center;
  margin-bottom: 20px;
}

form {
  max-width: 600px;
  margin: 0 auto;
  background-color: #fff;
  padding: 20px;
  padding-right: 10px; /* Add right padding */
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.form-group {
  margin-bottom: 15px;
  padding-right: 8px; /* Adjusted based on your CSS */
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

input[type="text"], input[type="number"], input[type="color"] {
  width: 100%;
  padding: 8px;
  padding-right: 8px; /* Add right padding */
  border: 1px solid #ccc;
  border-radius: 5px;
}

#tasks-container {
  margin-top: 20px;
  margin-bottom: 20px;
}

.task-group {
  border: 2px solid #ccc; /* Default border color */
  padding: 15px;
  padding-right: 8px; /* Add right padding */
  border-radius: 5px;
  margin-bottom: 10px;
  background-color: #fafafa;
  max-width: 100%; /* Ensure it doesn't exceed container's width */
}

.task-group h3 {
  margin: 0;
  margin-right: 10px; /* Space between name and color button */
}

.task-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

/* Style the color picker as a button */
.color-button {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  padding: 0;
  background-color: transparent;
  position: relative; /* Set relative positioning to contain the absolute color input */
}

.color-button input[type="color"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0; /* Make the color input invisible */
  cursor: pointer;
}

/* Buttons */
button {
  padding: 10px 20px;
  font-size: 1em;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-right: 10px; /* Add spacing between buttons */
}

#add-task-btn {
  background-color: #4caf50; /* Green */
  color: #fff;
  margin-bottom: 20px;
}
#remove-task-btn {
  background-color: #f44336; /* Red */
  color: #fff;
  margin-bottom: 20px;
}

#add-task-btn:hover, #remove-task-btn:hover {
  opacity: 0.8;
}

#save-btn {
  background-color: #2196f3; /* Blue */
  color: #fff;
  width: 100%;
}

#save-btn:hover {
  opacity: 0.8;
}

#back-btn {
  background-color: #888; /* Blue */
  color: #fff;
  width: 100%;
  margin-top: 10px;
}

#back-btn:hover {
  opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 600px) {
  form {
    padding: 15px;
  }

  button {
    width: 100%;
    margin-right: 0; /* Remove right margin on small screens */
    margin-bottom: 10px; /* Add bottom margin for spacing */
  }

  .task-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .color-button {
    margin-top: 10px;
  }
}
