.container {
    position: relative;
    width: 100%;
    margin: 2rem 0;
}

.mermaidWrapper {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: var(--ifm-global-radius);
    border: 1px solid var(--ifm-color-emphasis-200);
    padding: 1rem;
    background-color: var(--ifm-background-color);
}

.mermaidWrapper:hover {
    border-color: var(--ifm-color-primary);
}

.diagram {
    transition: transform 0.3s ease;
    transform-origin: center center;
    width: 100%;
    overflow: visible;
}

.diagram :global(svg) {
    width: 100%;
    height: auto;
    min-width: 100%;
}

/* Mermaid diagram title styling */
.diagram :global(.mermaid) {
    text-align: center;
}

.diagram :global(.titleText) {
    text-anchor: middle;
    font-size: 18px;
    font-weight: 600;
    font-family: var(--ifm-font-family-base);
    dominant-baseline: middle;
}

.zoomed {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    width: 95vw;
    height: 90vh;
    padding: 2rem;
    background-color: var(--ifm-background-color);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    border-radius: var(--ifm-global-radius);
    overflow: auto;
}

.zoomed .diagram {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.zoomed .diagram :global(svg) {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    backdrop-filter: blur(2px);
}

.zoomHint {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    font-size: 0.8rem;
    color: var(--ifm-color-emphasis-600);
    background-color: var(--ifm-background-color);
    padding: 0.25rem 0.5rem;
    border-radius: var(--ifm-global-radius);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.mermaidWrapper:hover .zoomHint {
    opacity: 1;
}

/* Dark mode adjustments */
[data-theme='dark'] .overlay {
    background-color: rgba(0, 0, 0, 0.7);
}

[data-theme='dark'] .zoomed {
    background-color: var(--ifm-background-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .zoomed {
        width: 100vw;
        height: 100vh;
        padding: 1rem;
    }
}