/* Markdown Preview - Code Block Syntax Highlighting */

/* Base code block styling */
.preview-panel pre code {
    display: block;
}

/* Language labels */
.preview-panel pre code[class*="language-"]::before {
    content: attr(class);
    display: block;
    text-align: right;
    font-size: 0.75em;
    color: var(--neutral-foreground-hint, #666);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.preview-panel pre code.language-javascript::before {
    content: "JavaScript";
}

.preview-panel pre code.language-typescript::before {
    content: "TypeScript";
}

.preview-panel pre code.language-csharp::before,
.preview-panel pre code.language-cs::before {
    content: "C#";
}

.preview-panel pre code.language-html::before {
    content: "HTML";
}

.preview-panel pre code.language-css::before {
    content: "CSS";
}

.preview-panel pre code.language-json::before {
    content: "JSON";
}

.preview-panel pre code.language-xml::before {
    content: "XML";
}

.preview-panel pre code.language-sql::before {
    content: "SQL";
}

.preview-panel pre code.language-python::before {
    content: "Python";
}

.preview-panel pre code.language-bash::before,
.preview-panel pre code.language-sh::before {
    content: "Bash";
}

.preview-panel pre code.language-powershell::before {
    content: "PowerShell";
}

.preview-panel pre code.language-markdown::before,
.preview-panel pre code.language-md::before {
    content: "Markdown";
}

.preview-panel pre code.language-yaml::before,
.preview-panel pre code.language-yml::before {
    content: "YAML";
}

/* Additional markdown preview styles */
.preview-panel h1,
.preview-panel h2,
.preview-panel h3,
.preview-panel h4,
.preview-panel h5,
.preview-panel h6 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
}

.preview-panel h1 {
    font-size: 2em;
    border-bottom: 2px solid var(--neutral-stroke-divider-rest, #d0d0d0);
    padding-bottom: 0.3rem;
}

.preview-panel h2 {
    font-size: 1.5em;
    border-bottom: 1px solid var(--neutral-stroke-divider-rest, #d0d0d0);
    padding-bottom: 0.3rem;
}

.preview-panel h3 {
    font-size: 1.25em;
}

.preview-panel h4 {
    font-size: 1.1em;
}

.preview-panel h5 {
    font-size: 1em;
}

.preview-panel h6 {
    font-size: 0.9em;
    color: var(--neutral-foreground-hint, #666);
}

.preview-panel p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.preview-panel ul,
.preview-panel ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.preview-panel li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.preview-panel blockquote {
    border-left: 4px solid var(--accent-fill-rest, #0078d4);
    margin: 1rem 0;
    padding-left: 1rem;
    color: var(--neutral-foreground-hint, #666);
    font-style: italic;
}

.preview-panel table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1rem;
}

.preview-panel table th,
.preview-panel table td {
    border: 1px solid var(--neutral-stroke-rest, #e0e0e0);
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.preview-panel table th {
    background-color: var(--neutral-layer-2, #f5f5f5);
    font-weight: 600;
}

.preview-panel table tr:nth-child(even) {
    background-color: var(--neutral-layer-2, #fafafa);
}

.preview-panel a {
    color: var(--accent-fill-rest, #0078d4);
    text-decoration: none;
}

.preview-panel a:hover {
    text-decoration: underline;
}

.preview-panel img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Dark theme overrides */
@media (prefers-color-scheme: dark) {
    .preview-panel h1,
    .preview-panel h2 {
        border-bottom-color: var(--neutral-stroke-divider-rest, #4d4d4d);
    }

    .preview-panel h6 {
        color: var(--neutral-foreground-hint, #999);
    }

    .preview-panel blockquote {
        color: var(--neutral-foreground-hint, #999);
    }

    .preview-panel table th {
        background-color: var(--neutral-layer-2, #2d2d2d);
    }

    .preview-panel table th,
    .preview-panel table td {
        border-color: var(--neutral-stroke-rest, #3d3d3d);
    }

    .preview-panel table tr:nth-child(even) {
        background-color: var(--neutral-layer-2, #252525);
    }
}

body[data-theme="dark"] .preview-panel h1,
body[data-theme="dark"] .preview-panel h2 {
    border-bottom-color: var(--neutral-stroke-divider-rest);
}

body[data-theme="dark"] .preview-panel h6 {
    color: var(--neutral-foreground-hint);
}

body[data-theme="dark"] .preview-panel blockquote {
    color: var(--neutral-foreground-hint);
}

body[data-theme="dark"] .preview-panel table th {
    background-color: var(--neutral-layer-2);
}

body[data-theme="dark"] .preview-panel table th,
body[data-theme="dark"] .preview-panel table td {
    border-color: var(--neutral-stroke-rest);
}

body[data-theme="dark"] .preview-panel table tr:nth-child(even) {
    background-color: var(--neutral-layer-2);
}
