/* Markdown Styles for Escobar Chat */

/* General markdown content */
.escobar-message-content {
    line-height: 1.5;
    font-size: 14px;
}

/* Specific styles for markdown content */
.markdown-content {
    font-family: var(--jp-content-font-family);
}

/* Override styles for markdown-content to ensure proper rendering */
.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    display: block;
    margin-top: 1em;
    margin-bottom: 0.5em;
    font-weight: bold;
}

.markdown-content h1 {
    font-size: 2em;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.3em;
}

.markdown-content h2 {
    font-size: 1.5em;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.3em;
}

.markdown-content h3 {
    font-size: 1.3em;
}

.markdown-content strong {
    font-weight: bold;
}

.markdown-content em {
    font-style: italic;
}

.markdown-content code {
    font-family: monospace;
    background-color: rgba(0, 0, 0, 0.05);
    padding: 0.2em 0.4em;
    border-radius: 3px;
}

.markdown-content pre {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 1em;
    border-radius: 5px;
    overflow-x: auto;
}

.markdown-content pre code {
    background-color: transparent;
    padding: 0;
}

.markdown-content a {
    color: #0366d6;
    text-decoration: none;
}

.markdown-content a:hover {
    text-decoration: underline;
}

.markdown-content blockquote {
    border-left: 4px solid #ddd;
    padding-left: 1em;
    color: #666;
    margin-left: 0;
}

.markdown-content ul,
.markdown-content ol {
    padding-left: 2em;
    margin-bottom: 1em;
}

.markdown-content table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1em;
}

.markdown-content table th,
.markdown-content table td {
    border: 1px solid #ddd;
    padding: 6px 13px;
}

.markdown-content table th {
    font-weight: bold;
    background-color: rgba(0, 0, 0, 0.05);
}

/* Headings */
.escobar-message-content h1,
.escobar-message-content h2,
.escobar-message-content h3,
.escobar-message-content h4,
.escobar-message-content h5,
.escobar-message-content h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: 600;
    line-height: 1.25;
    color: var(--jp-content-font-color1);
}

.escobar-message-content h1 {
    font-size: 1.8em;
    border-bottom: 1px solid var(--jp-border-color1);
    padding-bottom: 0.3em;
}

.escobar-message-content h2 {
    font-size: 1.5em;
    border-bottom: 1px solid var(--jp-border-color1);
    padding-bottom: 0.3em;
}

.escobar-message-content h3 {
    font-size: 1.3em;
}

.escobar-message-content h4 {
    font-size: 1.1em;
}

.escobar-message-content h5 {
    font-size: 1em;
}

.escobar-message-content h6 {
    font-size: 0.9em;
    color: var(--jp-content-font-color2);
}

/* Paragraphs */
.escobar-message-content p {
    margin-top: 0;
    margin-bottom: 1em;
}

/* Lists */
.escobar-message-content ul,
.escobar-message-content ol {
    margin-top: 0;
    margin-bottom: 1em;
    padding-left: 2em;
}

.escobar-message-content ul ul,
.escobar-message-content ul ol,
.escobar-message-content ol ul,
.escobar-message-content ol ol {
    margin-top: 0;
    margin-bottom: 0;
}

.escobar-message-content li {
    margin-bottom: 0.25em;
}

.escobar-message-content li>p {
    margin-top: 1em;
}

/* Task lists */
.escobar-message-content input[type="checkbox"] {
    margin-right: 0.5em;
    vertical-align: middle;
}

/* Blockquotes */
.escobar-message-content blockquote {
    margin: 0 0 1em;
    padding: 0 1em;
    color: var(--jp-content-font-color2);
    border-left: 0.25em solid var(--jp-border-color1);
}

.escobar-message-content blockquote> :first-child {
    margin-top: 0;
}

.escobar-message-content blockquote> :last-child {
    margin-bottom: 0;
}

/* Code blocks */
.escobar-message-content pre {
    margin-top: 0;
    margin-bottom: 1em;
    padding: 1em;
    overflow: auto;
    font-size: 0.9em;
    line-height: 1.45;
    background-color: var(--jp-layout-color2);
    border-radius: 3px;
}

.escobar-message-content pre code {
    display: block;
    padding: 0;
    overflow: visible;
    font-size: inherit;
    line-height: inherit;
    word-wrap: normal;
    background-color: transparent;
    border: 0;
}

/* Inline code */
.escobar-message-content code {
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 0.9em;
    background-color: var(--jp-layout-color2);
    border-radius: 3px;
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

/* Tables */
.escobar-message-content .table-wrapper {
    overflow-x: auto;
    max-width: 100%;
    margin-bottom: 1em;
}

.escobar-message-content table {
    width: 100%;
    margin-top: 0;
    margin-bottom: 0;
    border-spacing: 0;
    border-collapse: collapse;
    table-layout: fixed;
}

.escobar-message-content table th,
.escobar-message-content table td {
    padding: 8px 12px;
    border: 1px solid var(--jp-border-color1);
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.escobar-message-content table th {
    font-weight: 600;
    background-color: var(--jp-layout-color2);
    border-bottom-width: 2px;
    /* Make header border more prominent */
}

.escobar-message-content table tr {
    background-color: var(--jp-layout-color0);
}

.escobar-message-content table tr:nth-child(2n) {
    background-color: var(--jp-layout-color1);
}

/* Ensure equal column widths */
.escobar-message-content table colgroup col {
    width: auto;
}

/* Links */
.escobar-message-content a {
    color: var(--jp-brand-color1);
    text-decoration: none;
}

.escobar-message-content a:hover {
    text-decoration: underline;
}

/* Images */
.escobar-message-content img {
    max-width: 100%;
    box-sizing: content-box;
    background-color: var(--jp-layout-color0);
}

/* Horizontal rule */
.escobar-message-content hr {
    height: 0.25em;
    padding: 0;
    margin: 1.5em 0;
    background-color: var(--jp-border-color1);
    border: 0;
}

/* Syntax highlighting with highlight.js */
.hljs {
    display: block;
    overflow-x: auto;
    padding: 0.5em;
    color: var(--jp-content-font-color1);
    background: var(--jp-layout-color2);
}

.hljs-comment,
.hljs-quote {
    color: #998;
    font-style: italic;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-subst {
    color: #d73a49;
}

.hljs-number,
.hljs-literal,
.hljs-variable,
.hljs-template-variable,
.hljs-tag .hljs-attr {
    color: #005cc5;
}

.hljs-string,
.hljs-doctag {
    color: #032f62;
}

.hljs-title,
.hljs-section,
.hljs-selector-id {
    color: #6f42c1;
}

.hljs-subst {
    font-weight: normal;
}

.hljs-type,
.hljs-class .hljs-title {
    color: #458;
    font-weight: bold;
}

.hljs-tag,
.hljs-name,
.hljs-attribute {
    color: #000080;
    font-weight: normal;
}

.hljs-regexp,
.hljs-link {
    color: #009926;
}

.hljs-symbol,
.hljs-bullet {
    color: #990073;
}

.hljs-built_in,
.hljs-builtin-name {
    color: #0086b3;
}

.hljs-meta {
    color: #999;
    font-weight: bold;
}

.hljs-deletion {
    background: #fdd;
}

.hljs-addition {
    background: #dfd;
}

.hljs-emphasis {
    font-style: italic;
}

.hljs-strong {
    font-weight: bold;
}

/* Dark theme syntax highlighting */
body[data-jp-theme-light="false"] .hljs-comment,
body[data-jp-theme-light="false"] .hljs-quote {
    color: #7f848e;
}

body[data-jp-theme-light="false"] .hljs-keyword,
body[data-jp-theme-light="false"] .hljs-selector-tag,
body[data-jp-theme-light="false"] .hljs-subst {
    color: #ff7b72;
}

body[data-jp-theme-light="false"] .hljs-number,
body[data-jp-theme-light="false"] .hljs-literal,
body[data-jp-theme-light="false"] .hljs-variable,
body[data-jp-theme-light="false"] .hljs-template-variable,
body[data-jp-theme-light="false"] .hljs-tag .hljs-attr {
    color: #79c0ff;
}

body[data-jp-theme-light="false"] .hljs-string,
body[data-jp-theme-light="false"] .hljs-doctag {
    color: #a5d6ff;
}

body[data-jp-theme-light="false"] .hljs-title,
body[data-jp-theme-light="false"] .hljs-section,
body[data-jp-theme-light="false"] .hljs-selector-id {
    color: #d2a8ff;
}

body[data-jp-theme-light="false"] .hljs-type,
body[data-jp-theme-light="false"] .hljs-class .hljs-title {
    color: #8ac6f2;
}

body[data-jp-theme-light="false"] .hljs-tag,
body[data-jp-theme-light="false"] .hljs-name,
body[data-jp-theme-light="false"] .hljs-attribute {
    color: #7ee787;
}

body[data-jp-theme-light="false"] .hljs-regexp,
body[data-jp-theme-light="false"] .hljs-link {
    color: #f0883e;
}

body[data-jp-theme-light="false"] .hljs-symbol,
body[data-jp-theme-light="false"] .hljs-bullet {
    color: #f0883e;
}

body[data-jp-theme-light="false"] .hljs-built_in,
body[data-jp-theme-light="false"] .hljs-builtin-name {
    color: #ffa657;
}

body[data-jp-theme-light="false"] .hljs-meta {
    color: #7f848e;
}

body[data-jp-theme-light="false"] .hljs-deletion {
    background: #fdd;
}

body[data-jp-theme-light="false"] .hljs-addition {
    background: #dfd;
}