.AIT-Modal {
  position: fixed;
  display: none;
  background-color: rgba(0, 0, 0, 0.7);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  overflow: auto;
  opacity: 0;
  z-index: 99999;
  transition: opacity 0.3s ease;
}

.AIT-Modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.AIT-Modal.ready {
  opacity: 1;
}

.AIT-Modal .modal-content {
  position: relative;
  background-color: #ffffff;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  border-radius: 0.5rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  width: var(--max-width, min(90vw, 1200px));
  height: auto;
  min-width: 300px;
  min-height: 300px;
  max-width: 90vw;
  max-height: 90vh;
  padding: 1.5rem;
  margin: 1.75rem auto;
  transform: scale(0.9);
  overflow: auto;
  transition: transform 0.3s ease;
}

/* When there's only a background image, apply it to modal-content */
.AIT-Modal[style*='background-image'] .modal-content {
  background-color: transparent;
  box-shadow: none;
  width: 90vw;
  height: 90vh;
  margin: 0;
  padding: 0;
  border-radius: 0;
}

.AIT-Modal.ready .modal-content {
  transform: scale(1);
}

.AIT-Modal .modal-close {
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  background-color: rgba(0, 0, 0, 0.3);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 30px;
  font-weight: 700;
  width: 30px;
  height: 30px;
  padding: 0 0 5px;
  margin: 0;
  top: 10px;
  right: 10px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.AIT-Modal .modal-close:hover {
  opacity: 1;
}

.AIT-Modal .modal-close:focus {
  outline: none;
}

.AIT-Modal .modal-close:focus-visible {
  outline: 1px solid #aaa;
  outline-offset: 2px;
}

/* When background is on the main modal, make close button more visible */
.AIT-Modal[style*='background-image'] .modal-close {
  top: 20px;
  right: 20px;
}

/* Custom outline for close button on image backgrounds */
.AIT-Modal[style*='background-image'] .modal-close:focus-visible {
  outline: 2px solid #fff;
}

.AIT-Modal .modal-body {
  position: relative;
  z-index: 1;
}

.AIT-Modal .modal-background-image {
  width: 100%;
  height: 100%;
  min-height: 300px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* Hide background-image div when background is on main modal */
.AIT-Modal[style*='background-image'] .modal-background-image {
  display: none;
}

.AIT-Modal .modal-image {
  margin-bottom: 1rem;
}

.AIT-Modal .modal-image img {
  display: block;
  max-width: 100%;
  height: auto;
}

.AIT-Modal .modal-body h2 {
  margin-top: 0;
  margin-bottom: 1rem;
}

.AIT-Modal .Form.AIT-Block .header * {
  color: var(--black);
  text-shadow: 0 0 1px var(--white);
}

.AIT-Modal[style*='background-image'] .Form.AIT-Block .header * {
  color: var(--white);
  text-shadow: 0 0 1px var(--black);
}

.AIT-Modal#buy-tickets-modal .modal-close {
  background-color: rgba(0, 0, 0, 0.7);
}

.AIT-Modal#buy-tickets-modal .modal-content {
  height: min(90%, 90vh);
}

.AIT-Modal#buy-tickets-modal .modal-content .modal-body,
.AIT-Modal#buy-tickets-modal .modal-content iframe {
  height: 100%;
}
