:root {
    --red-diff: rgba(255, 0, 0, .1);
    --green-diff: rgba(0, 255, 128, .1);
    --git-diff: rgba(143, 143, 143, 0.38);
}

html {
    @apply bg-gray-50 dark:bg-gray-800;
}

p a:hover, h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover {
    @apply underline;
}

input {
    @apply placeholder-gray-300 dark:placeholder-gray-400;
}

:not(pre) > code[class*="language-"], pre[class*="language-"] {
    @apply bg-white dark:bg-gray-900 mt-1 pt-1;
}

pre {
    font-size: 0.8em !important;
}

.code {
    font-family: Menlo,Consolas,Liberation Mono,monospace;
    overflow-x: auto;
    padding: 5px 10px 5px;
}

.code .line-num {
    width: 4%;
    text-align: right;
    vertical-align: top;
}

code.hljs {
    background: transparent !important;
}


.red-diff {
    background-color: var(--red-diff);
}

.green-diff {
    background-color: var(--green-diff);
}

.gray-diff {
    background-color: var(--git-diff);
    @apply py-4;
}

#logged-button:hover .username {
    @apply hidden;
}

#logged-button:hover .logout {
    @apply block;
}

.cm-line, .cm-gutter {
    @apply bg-white dark:bg-gray-900 dark:caret-white caret-slate-700 px-1;
}

.cm-activeLine, .cm-activeLineGutter {
    @apply bg-gray-50 dark:bg-gray-800;
}

.cm-gutters {
    border: none !important;
}

.cm-gutterElement {
    @apply text-gray-700 dark:text-gray-300 px-4;
}

.code td {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.code tbody {
    line-height: 18.2px;
}

#editor {
    height: 337px;
    max-height: 337px;
}

.cm-editor {
    height: 337px;
    min-height: 100px;
    max-height: none;
    resize: vertical;
    overflow: hidden;
}

.line-code.selected {
    background-color: rgb(255, 247, 190) !important;
    box-shadow: inset 4px 0 0 rgb(255, 213, 65) !important;
}

.dark .line-code.selected {
    background-color: rgb(54, 49, 32) !important;
    box-shadow: inset 4px 0 0 rgb(161, 128, 21) !important;
}

.line-code {
    @apply pl-2 dark:text-slate-300 text-slate-700;
    background: none !important;
}

.line-num {
    @apply cursor-pointer text-slate-600 dark:text-slate-400 hover:text-black dark:hover:text-white;
}

table.csv-table {
    @apply w-full whitespace-pre text-xs;
}

table.csv-table thead {
    text-align: left;
}

table.csv-table thead tr {
    @apply bg-slate-100 dark:bg-slate-800;
}

table.csv-table thead tr th {
    @apply border py-2 px-1 border-slate-300 dark:border-slate-700;
}

table.csv-table tbody td {
    @apply border py-1.5 px-1 border-slate-200 dark:border-slate-800;
}

dl.dl-config {
    @apply grid grid-cols-3 text-sm;
}

dl.dl-config dt {
    @apply col-span-1 text-gray-700 dark:text-slate-300 font-bold;
}

dl.dl-config dd {
    @apply ml-1 col-span-2 break-words;
}

.markdown-body {
    @apply dark:bg-gray-900;
}

.markdown-body pre {
    @apply flex relative items-start p-0;
}

.markdown-body .code-div {
    @apply p-4 max-w-full overflow-x-auto;
}

.markdown-body code {
    @apply overflow-auto whitespace-pre;
}

.markdown-body img {
    @apply bg-transparent dark:bg-transparent;
}

.markdown-body .markdown-alert-title svg.octicon {
    margin-right: 0.5rem;
}

.chroma.preview.markdown pre code {
    @apply p-4;
}

.mermaid {
    background: #f6f8fa !important;
}

.dark .mermaid {
    background: #1f2937 !important;
}

.hidden-important {
    @apply hidden;
}

/*
 * A hack to ensure that Jupyter output images are always rendered with a
 * neutral background color, even if the image itself does not have one, since
 * Jupyter usually outputs images with transparent or light backgrounds.
 */
.dark .jupyter-output img {
    background-color: #888;
}

.pdfobject-container {
    @apply min-h-[700px] h-[700px];
}
