/* Diagram Content Type Styles - Mermaid.js */

.diagram-container {
    width: 100%;
}

.diagram-wrapper {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Loading state */
.diagram-wrapper .diagram-loading {
    width: 100%;
}

/* Once rendered, the wrapper should not center (SVG handles its own layout) */
.diagram-wrapper.rendered {
    display: block;
}

/* SVG responsive sizing */
.diagram-wrapper svg {
    max-width: 100%;
    height: auto;
}

/* Dark mode */
.dark .diagram-wrapper {
    background: #111827;
    border-color: #374151;
}

/* Error state */
.diagram-wrapper .diagram-error {
    width: 100%;
    padding: 1rem;
}

.diagram-wrapper .diagram-error .error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.diagram-wrapper .diagram-error pre {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 0.75rem;
    font-size: 0.75rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    color: #6b7280;
}

.dark .diagram-wrapper .diagram-error pre {
    background: #1f2937;
    border-color: #374151;
    color: #9ca3af;
}

/* Responsive - horizontal scroll on small screens for complex diagrams */
@media (max-width: 768px) {
    .diagram-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .diagram-wrapper svg {
        min-width: 400px;
    }
}
