/* Mermaid diagram styling for both light and dark modes */
.mermaid {
    width: 100%;
    max-width: 800px;
    margin: 2rem auto;
    text-align: center;
    background-color: var(--bg-secondary);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Ensure SVG content is also centered */
.mermaid svg {
    margin: 0 auto;
    display: block;
    overflow: visible;
}

/* Light mode (default) Mermaid styling */
.mermaid .node rect,
.mermaid .node circle,
.mermaid .node ellipse,
.mermaid .node polygon,
.mermaid .node path {
    fill: #f3f4f6;
    stroke: #d1d5db;
    stroke-width: 1px;
}

.mermaid .edgePath .path {
    stroke: var(--accent-primary);
    stroke-width: 1.5px;
}

.mermaid .edgeLabel {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.mermaid .label {
    color: var(--text-primary);
}

.mermaid .cluster rect {
    fill: var(--bg-secondary);
    stroke: var(--border-color);
}

/* Dark mode Mermaid styling */
[data-theme="dark"] .mermaid .node rect,
[data-theme="dark"] .mermaid .node circle,
[data-theme="dark"] .mermaid .node ellipse,
[data-theme="dark"] .mermaid .node polygon,
[data-theme="dark"] .mermaid .node path {
    fill: #374151;
    stroke: #4b5563;
}

[data-theme="dark"] .mermaid text {
    fill: #e5e7eb !important;
}

[data-theme="dark"] .mermaid .edgePath .path {
    stroke: #60a5fa;
}

[data-theme="dark"] .mermaid .arrowheadPath {
    fill: #60a5fa;
}

[data-theme="dark"] .mermaid .edgeLabel {
    background-color: #1f2937;
    color: #e5e7eb;
}

[data-theme="dark"] .mermaid .label {
    color: #e5e7eb;
}

[data-theme="dark"] .mermaid .cluster rect {
    fill: #1f2937;
    stroke: #4b5563;
}

/* Heading styles */
.prose > h1 {
    font-size: 2.25rem; /* text-4xl */
    font-weight: 800; /* font-extrabold */
    margin-top: 3rem; /* mt-12 */
    margin-bottom: 1.5rem; /* mb-6 */
}

.prose > h2 {
    font-size: 1.875rem; /* text-3xl */
    font-weight: 700; /* font-bold */
    margin-top: 3rem; /* mt-12 */
    margin-bottom: 1.5rem; /* mb-6 */
}

.prose > h3 {
    font-size: 1.5rem; /* text-2xl */
    font-weight: 600; /* font-semibold */
    margin-top: 2rem; /* mt-8 */
    margin-bottom: 1rem; /* mb-4 */
}

.prose > h4 {
    font-size: 1.25rem; /* text-xl */
    font-weight: 600; /* font-semibold */
    margin-top: 2rem; /* mt-8 */
    margin-bottom: 1rem; /* mb-4 */
}

.prose > h5 {
    font-size: 1.125rem; /* text-lg */
    font-weight: 500; /* font-medium */
    margin-top: 1.5rem; /* mt-6 */
    margin-bottom: 0.75rem; /* mb-3 */
}

.prose > h6 {
    font-size: 1rem; /* text-base */
    font-weight: 500; /* font-medium */
    margin-top: 1.5rem; /* mt-6 */
    margin-bottom: 0.75rem; /* mb-3 */
}

/* Paragraph styles */
.prose > p {
    margin-top: 1.5rem; /* my-6 */
    margin-bottom: 1.5rem;
    color: var(--text-secondary); /* text-secondary */
}

/* List styles */
.prose > ul, 
.prose > ol {
    margin-top: 1.5rem; /* my-6 */
    margin-bottom: 1.5rem;
    row-gap: 0.5rem; /* space-y-2 */
}

.prose > ul > li, 
.prose > ol > li {
    margin-left: 1.5rem; /* ml-6 */
    padding-left: 0.5rem; /* pl-2 */
    color: var(--text-secondary); /* text-secondary */
    margin-top: 0.5rem; /* my-2 */
    margin-bottom: 0.5rem;
}

.prose > ul > li {
    list-style-type: disc; /* list-disc */
}

.prose > ol > li {
    list-style-type: decimal; /* list-decimal */
}

/* Other element styles */
.prose > blockquote {
    margin-top: 2rem; /* my-8 */
    margin-bottom: 2rem;
}

.prose > pre {
    margin-top: 2rem; /* my-8 */
    margin-bottom: 2rem;
}

.prose > .mermaid {
    margin-top: 2rem; /* my-8 */
    margin-bottom: 2rem;
    margin-left: auto; /* mx-auto */
    margin-right: auto;
}

.disclaimer {
    border: 2px solid rgba(255, 0, 0, 0.213);
    background-color: rgba(255, 217, 0, 0.029);
    padding: 1em;
    margin-bottom: 1em;
    font-style: italic;
    font-size: 80%;
}
