@import url("https://fonts.googleapis.com/css2?family=Playpen+Sans:wght@100..800&family=Roboto+Serif:ital,opsz,wght@0,8..144,100..900;1,8..144,100..900&family=Roboto:ital,wght@0,100..900;1,100..900&family=Ubuntu+Sans+Mono:ital,wght@0,400..700;1,400..700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Google+Sans:ital,opsz,wght@0,17..18,400..700;1,17..18,400..700&family=Noto+Sans:ital,wght@0,100..900;1,100..900&display=swap");

:root {
    --terminal-bg: #51576d;
    --terminal-text: #f5f5f5;
    --success-color-sk: #60a561;
    --error-color-sk: #e34a6f;
    --running-color: #00a6ed;
    --border-radius: 0.2rem;
    --shadow:
        rgba(60, 64, 67, 0.3) 0px 1px 2px 0px,
        rgba(60, 64, 67, 0.15) 0px 1px 3px 1px;
}

.skulpt-editor {
    background-color: #fff;
    padding: 0.7em;
    box-shadow:
        rgba(60, 64, 67, 0.3) 0px 1px 2px 0px,
        rgba(60, 64, 67, 0.15) 0px 1px 3px 1px;
    border-radius: 0.5rem;
    margin: 1em 0;
    display: flex;
    flex-direction: column;
}

.skulpt-editor .output__turtle {
    margin-top: 0.3em;
}

.skulpt-editor .output__turtle canvas {
    margin: 0 auto;
}

.skulpt-editor .output__turtle canvas:first-of-type {
    border: 1px solid var(--terminal-bg);
}

.canvas-grid {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Crect width='40' height='40' fill='%23fff' /%3E%3Crect x='50%' width='1' height='100%' fill='rgb(203 213 225)' /%3E%3Crect y='50%' width='100%' height='1' fill='rgb(203 213 225)' /%3E%3C/svg%3E%0A");
    width: 400px;
    height: 300px;
    position: relative;
    display: block;
    /* margin-top: -600px; */
    z-index: 5;
}

.skulpt-editor div.ide .ace_editor {
    margin-bottom: 0.3em;
    /* border: 1px solid lightgray; */
}
.skulpt-editor pre input {
    background-color: transparent;
    border: none;
    outline: none;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    padding: 0;
    margin: 0;
    caret-color: var(--terminal-text);
}

/* 
    Высота и ширина полосы прокрутки меньше стандартных 15 px.
    Помогает на маленьких экранах.
*/
.skulpt-editor div.ide .ace_scrollbar-v {
    width: 10px !important;
}

.skulpt-editor div.ide .ace_scrollbar-h {
    height: 10px !important;
}

.skulpt-editor pre.output__container {
    display: none;
    border-radius: var(--border-radius);
    font-family:
        "Ubuntu Sans Mono", Consolas, "Liberation Mono", "Courier New",
        monospace;
    font-size: 0.95rem;
    white-space: pre-wrap;
    background-color: var(--terminal-bg);
    color: var(--terminal-text);
    padding: 0.8em;
    min-height: 25px;
    max-height: 200px;
    margin: 0;
    overflow: auto;
    transition: border 0.3s ease-in-out;
}

.skulpt-editor button:hover {
    box-shadow: var(--shadow);
    filter: brightness(110%);
}

.sk__editor__func code {
    cursor: pointer;
    background: none;
    color: black;
    text-decoration: underline wavy var(--success-color-sk);
    transition: text-decoration 0.3s ease-in-out;
}

.sk__editor__func code:hover {
    text-decoration-color: #275f28;
}

button.run {
    padding: 0 0.5em;
    background-color: var(--success-color-sk);
    border-color: var(--success-color-sk);
    color: white;
}

button.stop {
    background-color: var(--error-color-sk);
    border-color: var(--error-color-sk);
    color: white;
}

button.general {
    background-color: none;
    color: black;
}

.sk__dropdown img {
    height: 75%;
}

.sk__dropdown,
.sk__toolbar,
.sk__editor__func {
    display: flex;
    gap: 0.1em;
    justify-content: space-between;
}

.sk__dropdown {
    margin-bottom: 0.3em;
}

.sk__dropdown-button {
    padding: 0 0.07em;
    color: white;
    border: none;
    cursor: pointer;
    transition: width 0.3s ease;
    overflow: hidden;
    white-space: nowrap;
    border-radius: var(--border-radius);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sk__editor__func {
    justify-content: flex-start;
    align-items: center;
    margin-top: 0.2em;
    padding-top: 0.2em;
    border-top: 1px dashed var(--terminal-bg);
}

.sk__editor__func img,
.sk__editor__func code {
    display: inline-block;
}

[x-cloak] {
    display: none !important;
}

:root {
    /* Цвета */
    --color-bg-overlay: rgb(0 0 0 / 50%);
    --color-surface: #ffffff;
    --color-border-accent: #60a561;
    --color-bg-muted: #d2d6ee;
    --color-bg-soft: #c5e7c6;
    --color-text-inverse: #ffffff;
    --color-toolbar-idle: #1b3b6f;
    --color-toolbar-active: #000000;

    /* Типографика */
    --font-base: "Noto Sans", system-ui, -apple-system, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --font-size-code: 0.95rem;
    --font-size-h2-code: 1.5rem;
    --font-size-vertical: 0.6rem;

    /* Отступы: только два значения */
    --space-sm: 0.3em;
    --space-lg: 1rem;

    /* Радиус: одно значение */
    --radius: 0.5em;

    /* Модальное окно */
    --modal-width: 70%;
    --modal-height: 70vh;
}

.sk-api-search__formated {
    position: relative;
}

.search__form {
    display: flex;
    flex-direction: column;
    width: 100%;
    position: relative;
    margin-bottom: var(--space-sm);
}

.search__form::before {
    content: "";
    position: absolute;
    left: 0.6rem;
    top: 0.55rem;
    width: 1rem;
    height: 1rem;
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMwYTBhMGEiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0ibHVjaWRlIGx1Y2lkZS1zZWFyY2gtaWNvbiBsdWNpZGUtc2VhcmNoIj48cGF0aCBkPSJtMjEgMjEtNC4zNC00LjM0Ii8+PGNpcmNsZSBjeD0iMTEiIGN5PSIxMSIgcj0iOCIvPjwvc3ZnPg==");
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 1;
}

.search__form input[type="text"] {
    display: inline-block;
    outline: none;
    border: 2px solid rgb(203, 203, 203);
    border-radius: var(--radius);
    padding: 0.25rem 0.5rem 0.25rem 2rem;
    width: 100%;
    text-align: start;
    transition: border-color 0.4s ease;
}

.sk-api-search__formated input[type="text"]:focus {
    border-color: rgb(100, 100, 100);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    overscroll-behavior: contain;
}
.modal-content {
    position: relative;
    background: var(--color-surface);
    padding: var(--space-lg);
    border-radius: var(--radius);
    min-width: min(60ch, 95vw);
    max-width: min(90ch, 95vw);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 24px rgb(0 0 0 / 15%);
}

.fade-enter {
    transition: opacity 0.3s ease-out;
}
.fade-enter-start {
    opacity: 0;
}
.fade-enter-end {
    opacity: 1;
}
.fade-leave {
    transition: opacity 0.2s ease-in;
}
.fade-leave-start {
    opacity: 1;
}
.fade-leave-end {
    opacity: 0;
}

.zoom-enter {
    transition: all 0.3s ease-out;
}
.zoom-enter-start {
    opacity: 0;
    transform: scale(0.9) translateY(1rem);
}
.zoom-enter-end {
    opacity: 1;
    transform: scale(1) translateY(0);
}
.zoom-leave {
    transition: all 0.2s ease-in;
}
.zoom-leave-start {
    opacity: 1;
    transform: scale(1) translateY(0);
}
.zoom-leave-end {
    opacity: 0;
    transform: scale(0.95) translateY(1rem);
}

.modal-content ul {
    list-style: none;
    padding-left: 0;
}

.modal-card {
    flex: 1;
    overflow: auto;
    overscroll-behavior: contain;
}

.modal-card h4.signature {
    overflow: auto;
}

.api__suggestions {
    position: absolute;
    margin-top: var(--space-sm);
    top: 100%; /* прямо под полем ввода */
    left: 0;
    right: 0;
    z-index: 100; /* выше остальных элементов страницы */
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
}

.api__suggestions__item {
    padding: var(--space-sm);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.api__suggestions__item:hover {
    background-color: #60a56126;
}

.api__example {
    margin-bottom: 0.5em;
    padding: 0.2em;
}

.api__example__input,
.api__example__output {
    display: flex;
    width: 100%;
}

.api__example__input > pre,
.api__example__input > code,
.api__example__output > pre,
.api__example__output > code {
    display: inline-block;
    border-radius: inherit;
}

.api__example__input pre,
.api__example__output code {
    flex-grow: 1;
    padding: var(--space-sm);
    border-radius: 0 !important;
}

.api__example__input pre {
    padding: 0.3em !important;
    margin: 0 !important;
}

.api__example__output code {
    background-color: #d0d7dd;
}

.vertical-text {
    writing-mode: sideways-lr;
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--color-toolbar-idle);
    background-color: inherit;
    padding: var(--space-sm);
}

code[class*="language-"] {
    font-size: 0.95rem !important;
}

.modal-toolbar {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
}

.modal-toolbar label {
    padding: 0;
    cursor: pointer;
}

.modal-toolbar input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.modal-toolbar img {
    display: block;
    border: 2px solid var(--color-toolbar-idle);
    border-radius: var(--radius);
    padding: var(--space-sm);
    opacity: 0.45;
    transition: all 0.3s ease-in-out;
}

.modal-toolbar input[type="checkbox"]:checked + img {
    border-color: var(--color-toolbar-active);
    opacity: 1;
}

.modal-card .blackbox {
    width: 80%;
    margin: 0 auto;
    display: flex;
    align-items: stretch;
}

.blackbox > div {
    flex: 1 1 0;
    min-width: 0;
}

.blackbox code {
    background-color: transparent !important;
    color: black;
    font-weight: 600;
}

.blackbox__input li {
    border-bottom: 3px dashed var(--color-border-accent);
    margin-bottom: var(--space-lg);
    text-align: end;
    padding-inline-end: var(--space-sm);
    /* transform: translateY(-0.5rem); */
}

.blackbox__input li.required {
    border-bottom-style: solid;
}

.blackbox__body {
    display: flex;
    flex-wrap: wrap;
    min-height: 2.5em;
    border: 3px solid var(--color-border-accent);
    border-radius: var(--radius);
    background-color: var(--color-bg-soft);
    justify-content: center;
    align-items: center;
    align-content: stretch;
}

.blackbox .blackbox__output {
    display: flex;
    align-items: center;
}

.blackbox .blackbox__output div {
    border-bottom: 3px solid var(--color-border-accent);
    text-align: start;
    padding-inline-start: var(--space-sm);
    width: 100%;
    transform: translateY(-0.5rem);
}
