/* Base Overlay */
.mt-overlay {
  --mto-bg: white;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

/* NEW: No Backdrop Variant */
.mt-overlay.mt-no-backdrop {
  background-color: transparent;
  pointer-events: none;
  /* Allows clicking through the empty space to the table below */
}

.mt--overlay-show-all .mt-overlay-content [hidden] {
  display: block !important;
}

.mt-overlay-header {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-bottom: 0.5em;
  margin-right: 20px;
  padding-left: 10px;

  .mt-overlay-title {
    margin: 0;
    text-align: left;
  }

  .mt-overlay-back {
    background-color: transparent;
    color: currentColor;
    padding: 0 10px;
    margin-left: -10px;
    font-size: 30px;
  }
}

/* Overlay content box */
.mt-overlay-content-wrap {
  background-color: var(--mto-bg);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  min-width: 300px;
  text-align: center;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  /* Re-enables interaction for the box even if backdrop is transparent */

  h3 {
    font-size: 24px;
  }
}

.mt-overlay.mt-is-attached {
  align-items: center;
  justify-content: center;
}

.mt-overlay.mt-is-attached .mt-overlay-content-wrap {
  z-index: 10001;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border: 1px solid #ddd;
  /* Centering logic relative to the JS-provided coordinates */
  left: 50% !important;
  transform: translateX(-50%) !important;
  margin: 0 auto;
}

#mt-overlay-title {
  font-size: 30px;
}

.mt-overlay-generic .mt-overlay-content-wrap {
  max-width: 700px;
}

.mt-overlay-comment .mt-overlay-content-wrap {
  max-width: 500px;
}

.mt-overlay-content {
  flex: 1;
  overflow-y: auto;
  padding-inline: 10px;

  textarea {
    min-height: 7em;
  }
}

/* Close button */
.mt-overlay-close {
  position: absolute;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  top: 0;
  right: 0;
  font-size: 40px;
  cursor: pointer;
  line-height: 1;
  color: var(--kt-on-background, #36322dff);
  background-color: transparent;
  padding: 0;
  border-radius: 8px;
}

.mt-overlay-actions {
  margin-top: 12px;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.mt-secondary-button {
  display: inline-block;
  margin-right: 20px;
}

.mt-overlay-trigger,
.mt-overlay-trigger-attached {
  cursor: pointer;
}

/* Fix for SVG/children intercepting clicks */
.mt-overlay-trigger *,
.mt-overlay-trigger-attached * {
  pointer-events: none;
}

#mt-overlay-message video {
  width: 100%;
  height: auto;
  display: block;
  margin-top: 10px;
}