/* Legacy Markdown editor fields */
.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;
}

.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%;
}

.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;
}

.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;
}

.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;
}
