@font-face {
  font-family:'Scribbles';
  src:url(ScribblesNo_ligatures-Regular.ttf);
}
/* Modal Background */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  backdrop-filter: blur(5px);
}

/* Modal Container */
.modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  background-color: white;
  width: 90%;
  max-width: 500px;
  z-index: 1001;
  box-shadow: 0 2px 30px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  overflow: hidden; /* This prevents any internal elements from creating space */
}

/* Animation for modal appearance */
.modal.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Modal Header */
.modal-header {
  margin: 0; /* Remove any margin */
  padding: 20px;
  background-color: rgb(199, 89, 89);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  line-height: 1; /* Adjust line height to prevent extra space */
}

.modal-title {
  font-size: 1.25rem;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s ease-out 0.2s;
  color: white;
  display: block; /* Ensures proper text alignment */
  margin: 0; /* Remove any margin */
  padding: 0; /* Remove any padding */
}

.modal.show .modal-title {
  opacity: 1;
  transform: translateY(0);
}

/* Close Button */
.close-button {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 5px;
  opacity: 0;
  transform: rotate(-90deg);
  transition: all 0.3s ease-out 0.2s;
  line-height: 1; /* Adjust line height to prevent extra space */
  display: flex; /* Use flexbox for better alignment */
  align-items: center;
  justify-content: center;
  margin: 0; /* Remove any margin */
}

.modal.show .close-button {
  opacity: 1;
  transform: rotate(0);
}

.close-button:hover {
  transform: rotate(90deg);
  opacity: 0.8;
}

/* Modal Body */
.modal-body {
  padding: 20px;
  line-height: 1.5;
  opacity: 0;
  font-size: 20px;
  transform: translateY(20px);
  transition: all 0.3s ease-out 0.3s;
}

.modal.show .modal-body {
  opacity: 1;
  transform: translateY(0);
}

/* Modal Footer */
.modal-footer {
  padding: 20px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease-out 0.4s;
}

.modal.show .modal-footer {
  opacity: 1;
  transform: translateY(0);
}

/* Button Styles */
.btn {
  font-family: 'Scribbles';
  padding: 8px 16px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  transform: scale(1);
  text-decoration: none;
  display: inline-block;
}

.btn:hover {
  transform: scale(1.05);
}

.btn-primary {
  background-color: #007bff;
  color: white;
}

.btn-primary:hover {
  background-color: #0056b3;
  box-shadow: 0 2px 10px rgba(0, 123, 255, 0.4);
  color: white;
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background-color: #545b62;
  box-shadow: 0 2px 10px rgba(108, 117, 125, 0.4);
  color: white;
}

/* Show Modal */
.show {
  display: block;
  opacity: 1;
}

/* Test Button */
.test-btn {
  margin: 20px;
}

/* Animation for modal exit */
.modal.hiding {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
}