/* Modal overlay (background) */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex; /* Flexbox for vertical centering */
  justify-content: center;
  align-items: center; /* Center vertically */
  visibility: hidden; /* Modal hidden by default */
  opacity: 0; /* Invisible by default */
  transition: visibility 0s, opacity 0.3s ease; /* Smooth fade-in/out */
}

/* Modal becomes visible when this class is added */
.modal.show {
  visibility: visible; /* Modal visible */
  opacity: 1; /* Modal fully opaque */
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.modal-close-icon {
  font-size: 32px;
  color: #aaa;
  cursor: pointer;
  transition: color 0.3s;
}

/* Modal content */
.modal-content {
  background-color: #fff;
  padding: 20px;
  border-radius: var(--radius-m);
  width: 80%;
  max-width: 500px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  animation: fadeIn 0.3s ease;
  margin: 0; /* Remove margin to use flexbox centering */
}

/* Modal close button */
.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 24px;
  font-weight: bold;
  color: #aaa;
  cursor: pointer;
  transition: color 0.3s;
}

.modal-close:hover,
.modal-close:focus {
  color: #000;
}

/* Fade-in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Responsive design for mobile screens */
@media screen and (max-width: 600px) {
  .modal-content {
    width: 90%; /* Wider on smaller screens */
    padding: 15px;
  }
}
