/* Mermaid diagram styling */
.mermaid {
  text-align: center;
  padding: 0.5rem;
  border: 1px solid #e1e5e9;
  border-radius: 6px;
  background-color: #ffffff;
  overflow-x: auto;
  cursor: zoom-in;
  transition: box-shadow 0.2s ease;
}

.mermaid:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Make sure text in diagrams is readable */
.mermaid span {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 18px !important;
}

/* Ensure diagrams don't get cut off */
.mermaid svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Zoom overlay styling */
.mermaid-zoom-overlay {
  backdrop-filter: blur(4px);
}

.mermaid-zoom-overlay .mermaid {
  cursor: zoom-out;
  border: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  max-width: 95vw;
  max-height: 95vh;
  overflow: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .mermaid {
    padding: 0.5rem;
    margin: 0.5rem 0;
  }

  .mermaid-zoom-overlay .mermaid {
    max-width: 98vw;
    max-height: 98vh;
    padding: 10px;
  }
}