:root {
  --nfmm-overlay-bg: rgba(0, 0, 0, 0.753);
  --nfmm-content-bg: #fff;
  --nfmm-radius: 12px;
  --nfmm-padding: 2rem;
  --nfmm-shadow: 0 0 10px rgba(0, 0, 0, 0.941);
}

.nfmm-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--nfmm-overlay-bg);
  backdrop-filter: blur(2px);
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 2rem;
}

.nfmm-modal.active {
  display: flex;
  animation: nfmm-fadein 0.25s ease-out;
}

@keyframes nfmm-fadein {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Keep overflow on both containers:
   - .nfmm-modal-content: prevents double scrollbars when the content is taller than max-height
   - .nfmm-modal-scroll: ensures rounded corners are preserved on the scrollable area
*/

.nfmm-modal-content {
  background: var(--nfmm-content-bg);
  max-height: 70vh;
  overflow: auto;
  padding: var(--nfmm-padding);
}

.nfmm-modal-scroll {
  background: var(--nfmm-content-bg);
  max-height: 70vh;
  overflow-y: auto;
  border-radius: 12px;
  background: #fff;
  max-width: 700px;
  width: 100%;
  box-shadow: var(--nfmm-shadow);
}

.nfmm-close {
  position: absolute;
  top: 3rem;
  right: 2rem;
  color: #ffffff;
  background-color: transparent;
  border: none;
  font-family: "Lucida Sans", "Lucida Sans Regular", "Lucida Grande",
    "Lucida Sans Unicode", Geneva, Verdana, sans-serif;
  font-size: 42px;
  cursor: pointer;
  padding: 0;
  transition: color 0.3s ease-in-out;
}

.nfmm-close:hover {
  color: #cccccc;
}

.nfmm-spinner {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  transform: translate(-50%, -50%);
  border: 4px solid #ccc;
  border-top-color: #333;
  border-radius: 50%;
  animation: nfmm-spin 1s linear infinite;
}

@keyframes nfmm-spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@media (max-width: 1024px) {
  .nfmm-modal-scroll {
    max-width: 80%;
  }
}

@media (max-width: 768px) {
  .nfmm-modal-scroll {
    max-width: 100%;
    height: auto;
    max-height: 85vh;
    margin-top: 2rem;
  }

  .nfmm-modal-content {
    padding: 1.25rem;
  }

  .nfmm-close {
    font-size: 34px;
    top: 3rem;
    right: 1rem;
  }
}
