/* NemoReport AI v2 — custom styles */

/* Mermaid diagrams — full width + readable size */
.md-typeset .mermaid {
  text-align: center;
  margin: 2rem 0;
}

.md-typeset .mermaid svg {
  max-width: 100%;
  height: auto;
  min-height: 400px;
}

/* Wide mermaid container — pro big diagramy */
.mermaid-wide {
  margin: 2rem 0;
  overflow-x: auto;
  background: var(--md-code-bg-color);
  border-radius: 8px;
  padding: 1rem;
}

.mermaid-wide .mermaid {
  min-width: 900px;
}

.mermaid-wide .mermaid svg {
  min-height: 500px;
}

/* Zoom button — viditelný, kontrastní */
.mermaid-zoom-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin: 0.5rem auto 1.5rem;
  padding: 0.6rem 1.2rem;
  background: var(--md-accent-fg-color, #ff5722);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transition: background-color 0.15s, transform 0.1s;
}

.mermaid-zoom-btn:hover {
  background: var(--md-accent-fg-color--transparent, #e64a19);
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.mermaid-zoom-btn:active {
  transform: translateY(0);
}

/* Center button below diagram */
.mermaid-wide + .mermaid-zoom-btn,
.mermaid + .mermaid-zoom-btn {
  display: flex;
  margin-left: auto;
  margin-right: auto;
}

/* Fullscreen zoom dialog */
.mermaid-zoom-dialog {
  width: 95vw;
  height: 95vh;
  max-width: 95vw;
  max-height: 95vh;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: white;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.mermaid-zoom-dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(2px);
}

.mermaid-zoom-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 2rem;
  box-sizing: border-box;
}

.mermaid-zoom-wrap svg {
  max-width: 100%;
  max-height: 100%;
  width: auto !important;
  height: auto !important;
}

.mermaid-zoom-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: #d32f2f;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.mermaid-zoom-close:hover {
  background: #b71c1c;
}

/* Mobile — větší tap target */
@media (max-width: 768px) {
  .mermaid-zoom-btn {
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
  }

  .mermaid-zoom-close {
    padding: 0.7rem 1.2rem;
    font-size: 1rem;
  }
}

/* Tabulky — fit content */
.md-typeset table:not([class]) {
  font-size: 0.85rem;
}
