/* Python lab: editor and console, coloured like IDLE so it matches what pupils use in school.
   --lab-font (code and console) and --lab-text (instructions) are set by font-size.js. */

:root { --lab-font: 15px; --lab-text: 16px; --lab-bg: #ffffff; }

/* Background setting: a pale tint behind the editor and console; IDLE's text colours are unchanged */
.lab-bg-cream { --lab-bg: #fdf6d8; }
.lab-bg-yellow { --lab-bg: #fff3b0; }
.lab-bg-blue { --lab-bg: #dbeefb; }

.lab-editor .CodeMirror {
    height: 100%;
    min-height: 16rem;
    font-family: Consolas, "Courier New", monospace;
    font-size: var(--lab-font);
    line-height: 1.45;
    border-radius: 8px;
}

/* IDLE classic highlighting */
.cm-s-idle.CodeMirror { background: var(--lab-bg); color: #000000; }
.cm-s-idle .CodeMirror-gutters { background: rgba(0, 0, 0, .045); border-right: 1px solid rgba(0, 0, 0, .13); }
.cm-s-idle .CodeMirror-linenumber { color: #8a8a8a; }
.cm-s-idle .CodeMirror-cursor { border-left: 2px solid #000000; }
.cm-s-idle div.CodeMirror-selected, .cm-s-idle .CodeMirror-focused div.CodeMirror-selected { background: #c3d9ff; }
.cm-s-idle .cm-keyword { color: #ff7700; }
.cm-s-idle .cm-builtin { color: #900090; }
.cm-s-idle .cm-string, .cm-s-idle .cm-string-2 { color: #00aa00; }
.cm-s-idle .cm-comment { color: #dd0000; }
.cm-s-idle .cm-def { color: #0000ff; }
.cm-s-idle .cm-number, .cm-s-idle .cm-variable, .cm-s-idle .cm-variable-2, .cm-s-idle .cm-operator, .cm-s-idle .cm-property { color: #000000; }
.cm-s-idle .cm-error { color: #000000; background: none; }
.cm-s-idle .CodeMirror-matchingbracket { background: #d8e8ff; color: inherit !important; outline: 1px solid #9fbfff; }
.cm-s-idle.CodeMirror-readonly .CodeMirror-cursor { display: none; }

.CodeMirror-hints { font-family: Consolas, "Courier New", monospace; font-size: var(--lab-font); z-index: 50; }

/* Console: IDLE shell colours (output blue, errors red, typed input black) */
.lab-console {
    margin: 0;
    height: 100%;
    min-height: 10rem;
    overflow: auto;
    background: var(--lab-bg);
    color: #000000;
    border-radius: 8px;
    padding: .6rem .75rem;
    font-family: Consolas, "Courier New", monospace;
    font-size: var(--lab-font);
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}
.lab-console .lab-stdout { color: #0000ff; }
.lab-console .lab-stderr { color: #dd0000; }
.lab-console .lab-stdin { color: #000000; }
.lab-console .lab-prompt { color: #000000; }
.lab-console .lab-chart { display: block; max-width: 100%; height: auto; }
.lab-console .lab-input {
    /* typed straight into the console, as in IDLE: no box */
    font: inherit;
    color: inherit;
    background: transparent;
    border: 0;
    outline: none;
    padding: 0;
    width: 40ch; /* runner.js fits it to the rest of the prompt's line */
    max-width: 100%;
}

.lab-turtle {
    display: none;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
}
.lab-turtle.is-used { display: block; }
.lab-turtle canvas { display: block; width: 100%; height: auto; }

.lab-btn {
    font: inherit;
    font-weight: 600;
    border-radius: 8px;
    padding: .5rem 1.1rem;
    cursor: pointer;
    border: 1px solid transparent;
}
.lab-btn:disabled { opacity: .45; cursor: default; }
.lab-btn-run { background: #16a34a; color: #ffffff; }
.lab-btn-stop { background: #dc2626; color: #ffffff; }
.lab-btn-quiet { background: var(--bg-tertiary, #2a2f3a); color: var(--text-primary, #ffffff); border-color: var(--border-color, #3a4150); text-decoration: none; display: inline-block; }
.lab-status { font-size: .85rem; opacity: .8; }

/* Text size control (font-size.js) */
.lab-textsize { display: inline-flex; align-items: center; gap: .3rem; }
.lab-textsize .label { color: var(--text-secondary); font-size: .9rem; }
.lab-textsize button {
    font-family: inherit;
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: .25rem .55rem;
    cursor: pointer;
}
.lab-textsize button:hover:not(:disabled) { border-color: var(--text-secondary); }
.lab-textsize button:disabled { opacity: .4; cursor: default; }
.lab-textsize .small { font-size: .8rem; }
.lab-textsize .big { font-size: 1.15rem; }
.lab-textsize .reset { font-size: .85rem; padding: .3rem .5rem; }

/* High contrast (Background setting): black background; IDLE's colours lightened, each 9:1 or more on black */
.lab-bg-contrast { --lab-bg: #000000; }
/* Dark (Background setting): a dark blue. It is put on with lab-bg-contrast, so it has that setting's white text and
   lightened colours; these lines, after High contrast's below, change its black and greys to dark blues. */
.lab-bg-dark { --lab-bg: #141d4a; }
.lab-bg-contrast .cm-s-idle.CodeMirror { color: #ffffff; }
.lab-bg-contrast .cm-s-idle .CodeMirror-gutters { background: #141414; border-right-color: #555555; }
.lab-bg-contrast .cm-s-idle .CodeMirror-linenumber { color: #c8c8c8; }
.lab-bg-contrast .cm-s-idle .CodeMirror-cursor { border-left-color: #ffffff; }
.lab-bg-contrast .cm-s-idle div.CodeMirror-selected, .lab-bg-contrast .cm-s-idle .CodeMirror-focused div.CodeMirror-selected { background: #1f4f8f; }
.lab-bg-contrast .cm-s-idle .cm-keyword { color: #ffa04d; }
.lab-bg-contrast .cm-s-idle .cm-builtin { color: #e2a6ff; }
.lab-bg-contrast .cm-s-idle .cm-string, .lab-bg-contrast .cm-s-idle .cm-string-2 { color: #7ee07e; }
.lab-bg-contrast .cm-s-idle .cm-comment { color: #ff8a8a; }
.lab-bg-contrast .cm-s-idle .cm-def { color: #9cc0ff; }
.lab-bg-contrast .cm-s-idle .cm-number, .lab-bg-contrast .cm-s-idle .cm-variable, .lab-bg-contrast .cm-s-idle .cm-variable-2,
.lab-bg-contrast .cm-s-idle .cm-operator, .lab-bg-contrast .cm-s-idle .cm-property, .lab-bg-contrast .cm-s-idle .cm-error { color: #ffffff; }
.lab-bg-contrast .cm-s-idle .CodeMirror-matchingbracket { background: #3a3a00; outline-color: #ffd84d; }
.lab-bg-contrast .lab-console { color: #ffffff; border: 1px solid #555555; }
.lab-bg-contrast .lab-console .lab-stdout { color: #9cc0ff; }
.lab-bg-contrast .lab-console .lab-stderr { color: #ff8a8a; }
.lab-bg-contrast .lab-console .lab-stdin, .lab-bg-contrast .lab-console .lab-prompt { color: #ffffff; }
.lab-bg-contrast .lab-editor .CodeMirror { border: 1px solid #555555; }
.lab-bg-contrast .CodeMirror-hints { background: #000000; border-color: #555555; }
.lab-bg-contrast .CodeMirror-hint { color: #ffffff; }
.lab-bg-contrast li.CodeMirror-hint-active { background: #1f4f8f; color: #ffffff; }
.lab-bg-dark .cm-s-idle .CodeMirror-gutters { background: #0e1638; border-right-color: #3a4680; }
.lab-bg-dark .cm-s-idle .CodeMirror-linenumber { color: #aab3d8; }
.lab-bg-dark .cm-s-idle div.CodeMirror-selected, .lab-bg-dark .cm-s-idle .CodeMirror-focused div.CodeMirror-selected { background: #2f4fa8; }
.lab-bg-dark .lab-console, .lab-bg-dark .lab-editor .CodeMirror { border-color: #3a4680; }
.lab-bg-dark .CodeMirror-hints { background: #141d4a; border-color: #3a4680; }
.lab-bg-dark li.CodeMirror-hint-active { background: #2f4fa8; }

/* Colour-blind safe (Settings): IDLE's red comments and green strings, and its orange keywords against
   green strings, look alike with red-green colour blindness. Strings go blue, comments grey and italic,
   keywords a darker orange in bold; every pair stays clearly apart for protan and deutan vision. */
.lab-cb .cm-s-idle .cm-keyword { color: #c45500; font-weight: 700; }
.lab-cb .cm-s-idle .cm-builtin { color: #8a2be2; }
.lab-cb .cm-s-idle .cm-string, .lab-cb .cm-s-idle .cm-string-2 { color: #0072b2; }
.lab-cb .cm-s-idle .cm-comment { color: #707070; font-style: italic; }
.lab-cb .cm-s-idle .cm-def { color: #000080; font-weight: 700; }
.lab-cb.lab-bg-contrast .cm-s-idle .cm-keyword { color: #ffb000; }
.lab-cb.lab-bg-contrast .cm-s-idle .cm-builtin { color: #fff0a0; }
.lab-cb.lab-bg-contrast .cm-s-idle .cm-string, .lab-cb.lab-bg-contrast .cm-s-idle .cm-string-2 { color: #4fb3ff; }
.lab-cb.lab-bg-contrast .cm-s-idle .cm-comment { color: #9a9a9a; }
.lab-cb.lab-bg-contrast .cm-s-idle .cm-def { color: #ffffff; }

/* Easy-read (Settings): Atkinson Hyperlegible, more line, letter and word spacing, thicker cursor */
.lab-dys .lab-editor .CodeMirror,
.lab-dys .lab-console,
.lab-dys .CodeMirror-hints { font-family: "Atkinson Hyperlegible Mono", Consolas, "Courier New", monospace; line-height: 1.8; letter-spacing: .04em; }
.lab-dys .brief { font-family: "Atkinson Hyperlegible Next", system-ui, sans-serif; line-height: 1.8; letter-spacing: .03em; word-spacing: .12em; }
.lab-dys .cm-s-idle .CodeMirror-cursor { border-left-width: 3px; }
