/* Snackbar Styling */
#snackbar {
  visibility: hidden; /* Hidden by default. */
  min-width: 250px; /* Set a default minimum width */
  margin-left: -125px; /* Divide value of min-width by 2 */
  background-color: #333; /* Black background color */
  color: #fff; /* White text color */
  text-align: center; /* Centered text */
  border-radius: 0.5rem; /* Rounded corners */
  padding: 16px; /* Padding */
  position: fixed; /* Sit on top of the screen */
  z-index: 1; /* Add a z-index if needed */
  left: 50%; /* Center the snackbar */
  bottom: 30px; /* 30px from the bottom left corner of the screen */
  font-size: 1rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#snackbar.show {
  visibility: visible; /* Show the snackbar */
  /* Fadeout delay matches showErrorSnackbar's 6000ms JS timeout (6s total
     shown - 0.5s fadeout = 5.5s delay) -- these two have to move together,
     or the snackbar fades out on schedule then snaps back to fully visible
     until the JS timeout actually removes the .show class. */
  -webkit-animation:
    fadein 0.5s,
    fadeout 0.5s 5.5s;
  animation:
    fadein 0.5s,
    fadeout 0.5s 5.5s;
}

#snackbar.error {
  background-color: #ef4444; /* Red background for error */
}

/* Success Snackbar Styling */
#success_snackbar {
  visibility: hidden; /* Hidden by default. */
  min-width: 250px; /* Set a default minimum width */
  margin-left: -125px; /* Divide value of min-width by 2 */
  background-color: #333; /* Black background color */
  color: #fff; /* White text color */
  text-align: center; /* Centered text */
  border-radius: 0.5rem; /* Rounded corners */
  padding: 16px; /* Padding */
  position: fixed; /* Sit on top of the screen */
  z-index: 1; /* Add a z-index if needed */
  left: 50%; /* Center the snackbar */
  bottom: 30px; /* 30px from the bottom left corner of the screen */
  font-size: 1rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#success_snackbar.show {
  visibility: visible; /* Show the snackbar */
  -webkit-animation:
    fadein 0.5s,
    fadeout 0.5s 2.5s;
  animation:
    fadein 0.5s,
    fadeout 0.5s 2.5s;
}

#success_snackbar.success {
  /* Was a neon rgb(3, 216, 56) -- Kyalo flagged it as too bright against the
     rest of the UI. Matched to Tailwind's green-800, the same dark green
     already used elsewhere in the app for a settled "success" state (e.g.
     the WINNER badge in reports.php), rather than picking a new shade. */
  background-color: #166534;
}

/* Animations to fade the snackbar in and out */
@-webkit-keyframes fadein {
  from {
    bottom: 0;
    opacity: 0;
  }
  to {
    bottom: 30px;
    opacity: 1;
  }
}

@keyframes fadein {
  from {
    bottom: 0;
    opacity: 0;
  }
  to {
    bottom: 30px;
    opacity: 1;
  }
}

@-webkit-keyframes fadeout {
  from {
    bottom: 30px;
    opacity: 1;
  }
  to {
    bottom: 0;
    opacity: 0;
  }
}

@keyframes fadeout {
  from {
    bottom: 30px;
    opacity: 1;
  }
  to {
    bottom: 0;
    opacity: 0;
  }
}
