/* Modal overlay for Mermaid diagrams */
.mermaid-figure {
  display: block;
  margin: 0.75rem 0;
  cursor: zoom-in;
}
.mermaid-figure svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Fullscreen overlay */
.mermaid-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.mermaid-modal-overlay.open {
  display: flex;
}

.mermaid-modal-content {
  background: #fff;
  padding: 1rem;
  border-radius: 6px;
  max-width: 95vw;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Ensure pasted SVG scales nicely */
.mermaid-modal-content svg {
  display: block;
  max-width: 100%;
  width: 100%;
  height: auto;
}

.mermaid-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
}

/* Positioning container for close button */
.mermaid-modal-wrapper {
  position: relative;
}

@media (prefers-reduced-motion: reduce) {
  .mermaid-modal-overlay,
  .mermaid-modal-content {
    transition: none !important;
  }
}
