/* app/static/css/markdown-content.css */

/* Container for rendered markdown */
.markdown-content {
    /* Reset MVP.css styles */
    all: revert;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    max-width: 100%;
    margin: 0;
    padding: 20px;
}

/* Headings */
.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
}

.markdown-content h1 { font-size: 2em; }
.markdown-content h2 { font-size: 1.5em; }
.markdown-content h3 { font-size: 1.25em; }
.markdown-content h4 { font-size: 1em; }
.markdown-content h5 { font-size: 0.875em; }
.markdown-content h6 { font-size: 0.85em; }

/* Paragraphs and lists */
.markdown-content p,
.markdown-content ul,
.markdown-content ol {
    margin-bottom: 16px;
}

.markdown-content ul,
.markdown-content ol {
    padding-left: 2em;
}

/* Center images and add shadow/border */
.markdown-content img {
    max-width: 100%;
    height: auto;
    margin: 24px auto; /* Increased vertical margin */
    display: block; /* Makes centering work */
    border-radius: 8px; /* Rounded corners */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Subtle shadow */
}

/* Code blocks */
.markdown-content pre {
    padding: 16px;
    overflow: auto;
    /* font-size: 85%; */
    line-height: 1.45;
    background-color: #f6f8fa;
    border-radius: 8px; /* Increased border radius */
    margin: 24px auto; /* Center code blocks */
    max-width: 90%; /* Limit width */
    border: 1px solid #e1e4e8; /* Subtle border */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); /* Subtle shadow */
}

.markdown-content code {
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    background-color: rgba(27, 31, 35, 0.05);
    border-radius: 3px;
}

.markdown-content pre code {
    padding: 0;
    background-color: transparent;
}

/* Center Mermaid diagrams */
.markdown-content .mermaid {
    background-color: transparent;
    padding: 1rem;
    margin: 24px auto; /* Increased margin */
    text-align: center;
    max-width: 90%; /* Limit width */
}

.markdown-content .mermaid svg {
    max-width: 100%;
    height: auto;
    margin: 0 auto; /* Center SVG */
}

/* Blockquotes */
.markdown-content blockquote {
    padding: 0 1em;
    color: #6a737d;
    border-left: 0.25em solid #dfe2e5;
    margin: 0 0 16px 0;
}

/* Tables */
.markdown-content table {
    display: block;
    width: 100%;
    overflow: auto;
    margin: 16px auto; /* Center tables */
    border-spacing: 0;
    border-collapse: collapse;
    max-width: 90%; /* Limit width */
}

.markdown-content table th,
.markdown-content table td {
    padding: 6px 13px;
    border: 1px solid #dfe2e5;
}

.markdown-content table tr {
    background-color: #fff;
    border-top: 1px solid #c6cbd1;
}

.markdown-content table tr:nth-child(2n) {
    background-color: #f6f8fa;
}

/* Links */
.markdown-content a {
    color: #0366d6;
    text-decoration: none;
}

.markdown-content a:hover {
    text-decoration: underline;
}

/* Horizontal rules */
.markdown-content hr {
    height: 0.25em;
    padding: 0;
    margin: 24px auto; /* Center and increase margin */
    background-color: #e1e4e8;
    border: 0;
    max-width: 90%; /* Limit width */
}

/* Syntax highlighting theme overrides */
.hljs {
    background: transparent !important;
    padding: 0 !important;
}

/* Add responsive adjustments */
@media (max-width: 768px) {
    .markdown-content pre,
    .markdown-content table,
    .markdown-content .mermaid,
    .markdown-content hr {
        max-width: 100%; /* Full width on mobile */
    }
    
    .markdown-content img {
        margin: 16px auto; /* Slightly reduced margins on mobile */
    }
}