.breadcrumb {
    padding: 2px;
    background-color: #f5f5f5;
    color: #337ab7;
}

.entity-icon {
    display: inline-block;
    margin-right: 0.35rem;
}

.entity-icon-user {
    color: #f4a261;
}

.entity-icon-organization {
    color: grey;
}

.entity-icon-category {
    color: orange;
}

.entity-icon-course {
    color: grey;
}

.entity-icon-chapter {
    color: orange;
}

.entity-icon-lesson {
    color: grey;
}

.entity-icon-exercise {
    color: orange;
}

.entity-icon-audit {
    color: grey;
}

.tree-toggle-btn,
.tree-toggle-spacer {
    display: inline-flex;
    width: 1.25rem;
    justify-content: center;
    vertical-align: middle;
}

.tree-toggle-spacer--leaf-only {
    width: 0;
    min-width: 0;
}

.tree-toggle-btn {
    line-height: 1;
    text-decoration: none;
}

/* Add red star for required fields */
.required:after {
    color: #dc3545;
    content: "*";
    margin-left: 4px;
    position: absolute;
}

/* right align labels in forms 
https://github.com/twbs/bootstrap/issues/20643#issuecomment-325579156 */
@media (min-width: 768px) {
    .row > .col-form-label {
        text-align: right;
    }
}

/* mobile and tablet */
@media (max-width: 992px) {
    #cart-span {
        margin-right: 14px;
    }

    .has-cart-items {
        border-color: red !important;
    }
    .has-cart-items .navbar-toggler-icon {
        background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 0, 0, 0.8)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E");
    }
}

/* upload files - start*/
.drop-area.highlight {
    background: #dddddd;
}

.gallery img {
    margin-bottom: 10px;
    margin-right: 10px;
    vertical-align: middle;
}

/* upload files - end*/

@media print {
    .container {
        max-width: fit-content;
        margin: 0 0 0 7mm;
    }

    div {
        break-inside: avoid;
    }

    .hide-on-print,
    nav {
        display: none !important;
    }

    body {
        font-size: 0.8rem;
    }

    .solution-div img {
        max-height: 180px;
    }
}

@media not print {
    .hide-on-not-print {
        display: none;
    }
}

.show {
    opacity: 1;
}
.hide {
    opacity: 0;
    transition: opacity 400ms;
}

.show-green {
    color: green;
}
.hide-green {
    color: black;
    transition: color 400ms;
}

.markdown-preview {
    border-width: 1px;
    border-top-width: 0;
    border-style: solid;
    padding: 6px 12px;
    min-height: 58px;
}

.markdown-preview-only {
    border-top-width: 1px;
}

.markdown-preview-amber {
    border-color: #bb815d;
    background-color: #fff9f8;
}

.markdown-preview-gray {
    border-color: #ced4da;
    background-color: #f9f9f9;
}

.markdown-textarea {
    border-bottom-style: dashed;
}

.markdown-textarea-amber {
    border-color: #bb815d;
}

.markdown-editor__panel--preview blockquote {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem 0.75rem 1.25rem;
    border-left: 0.25rem solid #d1d5db;
    color: #495057;
    background-color: transparent;
}

.markdown-editor__panel--preview blockquote p:last-child {
    margin-bottom: 0;
}

/* Overwrite some katex settings */
.katex-display.fleqn > .katex {
    padding-left: 0; /* avoid a space on the left in display-mode (commands surrounded by "$$" */
}

/* Overwrite some highlight.js settings */
.hljs-title.function_ {
    _color: #cfcfa0;
}

/* https://stackoverflow.com/a/50931961 */
.btn-group-xs > .btn,
.btn-xs {
    padding: 0px 5px;
    font-size: 14px;
    border-radius: 3px;
}

.hints-div p {
    margin-bottom: 0;
}

.answer-div p {
    margin-bottom: 0;
}

.solution-div img {
    _max-height: 150px;
}

.theory-input,
.statement-input,
.description-input {
    border-radius: 0;
    border-bottom-width: 0;
    border-color: #bb815d;
}

.solution-input {
    border-radius: 0;
    border-bottom-width: 0;
    border-color: #008000;
}

.lesson-details-page {
    --lesson-editor-primary-size: 50%;
}

.lesson-content-reader {
    margin-top: 1.5rem;
    _border: 1px solid #dee2e6;
    _background: linear-gradient(180deg, #ffffff 0%, #fcfcfd 100%);
    _box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.lesson-content-reader__body {
    _padding: 1.5rem;
    min-height: 18rem;
    overflow: auto;
}

.lesson-content-reader__source {
    white-space: pre-wrap;
    word-break: break-word;
}

.markdown-editor {
    --markdown-editor-split: 50%;
    --markdown-editor-inline-max-height: 400px;
    --markdown-editor-vertical-textarea-min-height: 100px;
    --markdown-editor-toolbar-height: 2.75rem;
    margin-top: 1.5rem;
    border: 1px solid #d7dbe1;
    border-radius: 0.375rem;
    background: #fff;
    overflow: hidden;
}

.markdown-toggle .markdown-editor {
    margin-top: 0;
}

.markdown-toggle--preview .markdown-editor__toolbar,
.markdown-toggle--preview .markdown-editor__panel--markdown,
.markdown-toggle--preview .markdown-editor__resize-bar {
    display: none;
}

.inline-action-separator {
    color: #6c757d;
    font-weight: 300;
}

.circular-reorder-button {
    line-height: 1;
}

.markdown-editor--fullscreen {
    position: fixed;
    inset: 0;
    z-index: 1040;
    margin: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    background: #fff;
    overflow: auto;
}

body.markdown-editor-page-lock {
    overflow: hidden;
}

.markdown-editor__toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: var(--markdown-editor-toolbar-height);
    padding: 0.375rem 0.5rem;
    border-bottom: 1px solid #d7dbe1;
}

.markdown-editor--uploading .markdown-editor__toolbar {
    opacity: 0.7;
}

.markdown-editor--drop-active {
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

.markdown-editor--drop-active .markdown-editor__panel--markdown {
    background: #f0f7ff;
}

.markdown-editor__body {
    display: flex;
    flex-direction: column;
}

.markdown-editor--layout-vertical .markdown-editor__body {
    flex-direction: row;
    max-height: var(--markdown-editor-inline-max-height);
    min-height: var(--markdown-editor-vertical-textarea-min-height);
    overflow: hidden;
}

.markdown-editor--fullscreen.markdown-editor--layout-vertical .markdown-editor__body {
    height: calc(100vh - var(--markdown-editor-toolbar-height) - 1.5rem);
    max-height: none;
}

.markdown-editor__panel {
    min-width: 0;
    min-height: 0;
}

.markdown-editor--layout-horizontal .markdown-editor__panel--markdown,
.markdown-editor--layout-horizontal .markdown-editor__panel--preview {
    width: 100%;
}

.markdown-editor--layout-vertical .markdown-editor__panel--markdown {
    width: var(--markdown-editor-split);
    min-height: var(--markdown-editor-vertical-textarea-min-height);
}

.markdown-editor--layout-vertical .markdown-editor__panel--preview {
    flex: 1;
    min-height: var(--markdown-editor-vertical-textarea-min-height);
}

.markdown-editor__textarea {
    width: 100%;
    padding: 0.75rem;
    border: 0;
    border-radius: 0;
    resize: none;
    line-height: 1.5;
}

.markdown-editor--layout-horizontal .markdown-editor__textarea {
    overflow: auto;
}

.markdown-editor--layout-vertical .markdown-editor__textarea {
    height: 100%;
    min-height: var(--markdown-editor-vertical-textarea-min-height);
    overflow: auto;
}

.markdown-editor__panel--preview {
    padding: 0.75rem;
}

.markdown-editor--layout-horizontal .markdown-editor__panel--preview {
    overflow: visible;
}

.markdown-editor--layout-vertical .markdown-editor__panel--preview {
    overflow: auto;
}

.markdown-editor__resize-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 0.625rem;
    cursor: row-resize;
    background: #eef2f7;
    touch-action: none;
    user-select: none;
}

.markdown-editor--layout-vertical .markdown-editor__resize-bar {
    width: 0.625rem;
    height: auto;
    cursor: col-resize;
}

.markdown-editor__resize-bar span {
    width: 2.25rem;
    height: 0.125rem;
    background: #9aa3b1;
}

.markdown-editor--layout-vertical .markdown-editor__resize-bar span {
    width: 0.125rem;
    height: 2.25rem;
}

.markdown-editor__footer {
    display: none;
    height: 0.875rem;
    border-top: 1px solid #d7dbe1;
    background: #f7f8fb;
}

.markdown-editor--fullscreen.markdown-editor--layout-vertical .markdown-editor__footer {
    display: block;
}

/* Remove the margin between an image and the label below it. The original margin comes from the parent of <img>, meaning from <p> */
#theory-preview-div p:has(img),
#theory-div p:has(img),
#statement-preview-div p:has(img),
#statement-div p:has(img),
#solution-preview-div p:has(img),
#solution-div p:has(img) {
    margin-bottom: 0px;
}

/* Hide the browser native password reveal buttons in input fields; we have our own custom toggle button */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear,
input[type="password"]::-webkit-contacts-auto-fill-button,
input[type="password"]::-webkit-credentials-auto-fill-button {
    display: none;
    visibility: hidden;
    pointer-events: none;
}

h1,
.h1 {
    font-size: 1.7rem;
}
h2,
.h2 {
    font-size: 1.4rem;
}
h3,
.h3 {
    font-size: 1.2rem;
}
h4,
.h4 {
    font-size: 1rem;
}
h5,
.h5 {
    font-size: 0.85rem;
}
h6,
.h6 {
    font-size: 0.7rem;
}

.form-control {
    _border-radius: 0;
}
