
/* Styles for Markdown Viewer */
.markdown-viewer {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: inherit;
    color: inherit;
    overflow: hidden; /* Prevent overall container from scrolling */
}

.markdown-viewer-header {
    padding: 15px;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0; /* Prevent header from shrinking */
}

.markdown-content {
    flex: 1;
    padding: 10px;
    overflow-y: auto; /* Only this container should scroll */
    background-color: var(--color-surface);
    color: inherit;
    margin: 0 10px 0 0 ;
}

.markdown-content-workflow {
    flex: 1;
    padding: 10px;
    overflow-y: auto; /* Only this container should scroll */
    background-color: var(--color-background);
    color: inherit;
    margin: 0 10px 0 0 ;
}

/* Style for rendered markdown - applies to all markdown containers */
#rendered-markdown,
#rendered-tab-content {
    color: var(--color-text-secondary);
    background-color: inherit;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    letter-spacing: 0.8px;
    line-height: 1.6;
    font-weight: 430;
}

/* Headings */
#rendered-markdown h1,
#rendered-markdown h2,
#rendered-markdown h3,
#rendered-tab-content h1,
#rendered-tab-content h2,
#rendered-tab-content h3 {
    color: var(--color-text-secondary);
    margin-top: 0.5em;
    margin-bottom: 0.25em;
}

#rendered-markdown h3,
#rendered-tab-content h3 {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.15em;
}

/* Paragraphs */
#rendered-markdown p,
#rendered-tab-content p {
    margin-top: 0.2em;
    margin-bottom: 0.3em;
}

/* Lists - unified styles for all markdown and chat containers */
#rendered-markdown ul, 
#rendered-markdown ol,
#rendered-tab-content ul,
#rendered-tab-content ol,
.llm ul,
.llm ol {
    margin-left: 2em;
    margin-bottom: 0.5em;
    margin-top: 0.5em;
    display: block;
    padding-left: 0.5em;
    list-style-position: outside;
}

#rendered-markdown li,
#rendered-tab-content li,
.llm li {
    margin-bottom: 0.4em;
    display: list-item;
    padding-left: 0.3em;
}

#rendered-markdown ul ul, 
#rendered-markdown ol ol,
#rendered-markdown ul ol,
#rendered-markdown ol ul,
#rendered-tab-content ul ul,
#rendered-tab-content ol ol,
#rendered-tab-content ul ol,
#rendered-tab-content ol ul,
.llm ul ul, 
.llm ol ol,
.llm ul ol, 
.llm ol ul {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

/* List style types */
#rendered-markdown ul,
#rendered-tab-content ul,
.llm ul {
    list-style-type: disc;
}

#rendered-markdown ul ul,
#rendered-tab-content ul ul,
.llm ul ul {
    list-style-type: circle;
}

#rendered-markdown ol,
#rendered-tab-content ol {
    list-style-type: decimal;
}

/* Blockquotes */
#rendered-markdown blockquote,
#rendered-tab-content blockquote {
    border-left: 4px solid var(--color-surface-active) !important;
    padding-left: 16px !important;
    margin-left: 0 !important;
}

/* Mermaid diagram styles - applies to all containers */
.markdown-content .mermaid polygon,
.markdown-content-workflow .mermaid polygon,
#rendered-tab-content .mermaid polygon {
    fill: rgba(255, 255, 255, 0.9) !important;
}

/* Override SVG text to be dark */
.markdown-content .mermaid .label,
.markdown-content-workflow .mermaid .label,
#rendered-tab-content .mermaid .label {
    color: #000000 !important;
    font-weight: normal !important;
}

.markdown-content .mermaid text,
.markdown-content-workflow .mermaid text,
#rendered-tab-content .mermaid text {
    fill: #000000 !important;
    font-weight: normal !important;
}

.markdown-content .mermaid .node rect,
.markdown-content .mermaid .node circle,
.markdown-content .mermaid .node polygon,
.markdown-content .mermaid .node path,
.markdown-content-workflow .mermaid .node rect,
.markdown-content-workflow .mermaid .node circle,
.markdown-content-workflow .mermaid .node polygon,
.markdown-content-workflow .mermaid .node path,
#rendered-tab-content .mermaid .node rect,
#rendered-tab-content .mermaid .node circle,
#rendered-tab-content .mermaid .node polygon,
#rendered-tab-content .mermaid .node path {
    stroke: #000000 !important;
}

/* Make all arrow parts blue and thicker */
.markdown-content .mermaid .edgePath .path,
.markdown-content .mermaid .flowchart-link,
.markdown-content .mermaid line,
.markdown-content-workflow .mermaid .edgePath .path,
.markdown-content-workflow .mermaid .flowchart-link,
.markdown-content-workflow .mermaid line,
#rendered-tab-content .mermaid .edgePath .path,
#rendered-tab-content .mermaid .flowchart-link,
#rendered-tab-content .mermaid line {
    stroke: #5aa0d5 !important;
    stroke-width: 4px !important;
}

.markdown-content .mermaid .arrowheadPath,
.markdown-content .mermaid marker path,
.markdown-content-workflow .mermaid .arrowheadPath,
.markdown-content-workflow .mermaid marker path,
#rendered-tab-content .mermaid .arrowheadPath,
#rendered-tab-content .mermaid marker path {
    fill: #5aa0d5 !important;
    stroke: #5aa0d5 !important;
}

/* Edge thickness classes */
.edge-thickness-normal,
.markdown-content .mermaid .edge-thickness-normal,
.markdown-content-workflow .mermaid .edge-thickness-normal,
#rendered-tab-content .mermaid .edge-thickness-normal {
    stroke-width: 4px !important;
}

.edge-thickness-thick,
.markdown-content .mermaid .edge-thickness-thick,
.markdown-content-workflow .mermaid .edge-thickness-thick,
#rendered-tab-content .mermaid .edge-thickness-thick {
    stroke-width: 5px !important;
}

/* Improve marker visibility */
.markdown-content .mermaid marker,
.markdown-content-workflow .mermaid marker,
#rendered-tab-content .mermaid marker {
    fill: #5aa0d5 !important;
}

/* Additional styles for edge paths */
.markdown-content .mermaid .edgePaths .path,
.markdown-content-workflow .mermaid .edgePaths .path,
#rendered-tab-content .mermaid .edgePaths .path {
    stroke: #5aa0d5 !important;
    stroke-width: 4px !important;
}

.markdown-content .mermaid .edgeLabel,
.markdown-content-workflow .mermaid .edgeLabel,
#rendered-tab-content .mermaid .edgeLabel {
    background-color: rgba(204, 241, 235, 0.9) !important;
    color: #000000 !important;
}

.mermaid-container1, 
.mermaid-container2 {
    margin: 0 auto;
}

/* Style for code blocks */
#rendered-markdown pre,
#rendered-tab-content pre {
    background-color: var(--color-surface-elevated);
    border-radius: 4px;
    padding: 12px;
    overflow-x: auto;
    margin: 15px 0;
}

#rendered-markdown code,
#rendered-tab-content code {
    font-family: monospace;
    color: var(--color-text);
}

/* Ensure scrollbar styling is consistent */
.markdown-content::-webkit-scrollbar {
    width: 8px;
}

.markdown-content::-webkit-scrollbar-track {
    background: var(--color-background);
}

.markdown-content::-webkit-scrollbar-thumb {
    background-color: var(--color-border);
    border-radius: 4px;
}

/* Container styling to maintain consistency */
.content__section {
    display: grid;
    grid-template-columns: 45% 0.1% 54.9%;
    height: 100%;
}

.markdown-content .highlight-red,
.markdown-content-workflow .highlight-red,
#rendered-tab-content .highlight-red,
#rendered-markdown .highlight-red {
    color: #d9534f;
}

.markdown-content .highlight-blue,
.markdown-content-workflow .highlight-blue,
#rendered-tab-content .highlight-blue,
#rendered-markdown .highlight-blue {
    color: #4f71d9;
}

.markdown-content .highlight-green,
.markdown-content-workflow .highlight-green,
#rendered-tab-content .highlight-green,
#rendered-markdown .highlight-green {
    color: #88b651;
}

#rendered-tab-content table,
#rendered-markdown table,
.markdown-content table,
.markdown-content-workflow table {
    width: 80%;
    border-collapse: collapse;
    margin: 10px 10px;
}

#rendered-tab-content th,
#rendered-markdown th,
.markdown-content th,
.markdown-content-workflow th{
    border: 1px solid var(--color-border);
    background-color: var(--color-surface-hover);
    padding: 10px 10px;
    text-align: center;
    font-weight: bold;
}

#rendered-tab-content td,
#rendered-markdown td,
.markdown-content td,
.markdown-content-workflow td {
    border: 1px solid var(--color-border);
    padding: 10px 10px;
    text-align: left;
}

/* EditorJS Container Styling */
.editorjs-container {
    background: var(--color-surface);
    border-radius: 8px;
    padding: 1px;
    min-height: 600px;
    max-width: 100%;
    box-sizing: border-box;
}

/* EditorJS Editor Styling */
.editorjs-editor {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 20px;
    min-height: 600px;
    color: var(--color-text-muted);
    box-sizing: border-box;
    width: 100%;
}

/* EditorJS Controls */
.editorjs-controls {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 15px;
}

/* EditorJS Content Block Styling */
.ce-block__content {
    max-width: 100%;
    margin-left: 20px;
}

.ce-toolbar__content {
    max-width: 100%;
    margin-right: 20px; /* Move to right instead of left */
    margin-left: auto; /* Push to right side */
}

/* Additional styling to ensure toolbar stays inside editor */
.ce-toolbar {
    right: 0;
    left: auto; /* Override default left positioning */
    transform: none; /* Remove any transform that might affect positioning */
}

/* For the plus button toolbar */
.ce-toolbar--opened {
    right: 0;
    left: auto;
}

.cdx-block {
    color: var(--color-text-muted);
}

/* EditorJS Paragraph */
.ce-paragraph {
    line-height: 1.6em;
}

/* EditorJS Headers */
.ce-header {
    font-weight: 600;
    color: var(--color-text);
}

/* EditorJS Code Blocks */
.ce-code__textarea {
    background: var(--color-background);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

/* EditorJS Toolbar */
.ce-toolbar__actions {
    background: var(--color-surface);
}

.ce-toolbar__plus,
.ce-toolbar__settings-btn {
    color: var(--color-text-muted);
}

.ce-toolbar__plus:hover,
.ce-toolbar__settings-btn:hover {
    background: var(--color-surface-hover);
}
