.cmdstr-code {
    position: relative;
    display: flex;
    flex-direction: row;
    padding: 0px 10px 0px 0;

    &.is-large {
        .use-button {
            height: 28px;
            width: 28px;
        }

        .code-div code {
            .mono-font(14px);
        }
    }

    &.limit-height .code-div {
        max-height: 58px;
    }

    &.limit-height.is-large .code-div {
        max-height: 68px;
    }

    .use-button {
        flex-grow: 0;
        padding: 3px;
        border-radius: 3px 0 0 3px;
        font-size: 12px;
        height: 22px;
        width: 22px;
        display: flex;
        align-items: center;
        justify-content: center;
        align-self: flex-start;
        cursor: pointer;
        background-color: black;

        &:hover {
            background-color: #777;
        }
    }

    .code-div {
        background-color: black;
        display: flex;
        flex-direction: row;
        min-width: 100px;
        overflow: auto;
        border-left: 1px solid #777;

        code {
            flex-shrink: 0;
            min-width: 100px;
            color: white;
            .mono-font(12px);
            white-space: pre;
            padding: 2px 8px 2px 8px;
            background-color: black;
        }
    }

    .copy-control {
        width: 0;
        position: relative;
        display: block;
        visibility: hidden;

        .inner-copy {
            position: absolute;
            bottom: -1px;
            right: -20px;
            font-size: 9px;
            padding: 2px;
            padding-left: 4px;
            cursor: pointer;
            width: 20px;
            background-color: black;
            border: 1px solid #333;
            color: #777;
            &:hover {
                color: white;
            }
        }
    }

    &:hover .copy-control {
        visibility: visible !important;
    }
}

.terminal-wrapper {
    position: relative;

    .term-block {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: transparent;
        z-index: 10;
    }

    .xterm-screen {
        &::-webkit-scrollbar {
            display: none;
        }
    }

    &.focus .xterm {
        .xterm-screen {
            overflow-y: scroll;
            overscroll-behavior: contain;
        }

        .xterm-viewport {
            overscroll-behavior: contain;
        }
    }

    &.focus .xterm-viewport {
        &::-webkit-scrollbar {
            background-color: #777;
            width: 5px;
            height: 5px;
        }

        &::-webkit-scrollbar-thumb {
            background: white;
        }
    }

    .xterm-viewport {
        &::-webkit-scrollbar {
            background-color: #222;
            width: 5px;
            height: 5px;
        }

        &::-webkit-scrollbar-thumb {
            background: #555;
        }
    }
}

body .xterm .xterm-viewport {
    overflow-y: auto;
    width: calc(100% + 5px);
}

.checkbox-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 23px;

    input {
        opacity: 0;
        width: 0;
        height: 0;
    }

    .slider {
        position: absolute;
        content: "";
        cursor: pointer;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        background-color: #333;
        transition: 0.5s;
        border-radius: 33px;
    }

    .slider:before {
        position: absolute;
        content: "";
        height: 18px;
        width: 18px;
        left: 3px;
        bottom: 3px;
        background-color: white;
        transition: 0.5s;
        border-radius: 50%;
    }

    input:checked + .slider {
        background-color: @term-green;
    }

    input:checked + .slider:before {
        transform: translateX(18px);
    }
}

.button.is-prompt-green {
    background-color: #222;
    color: @term-white;

    &:hover {
        background-color: @term-green;
        color: @term-bright-white;
    }
}

.button.is-plain,
.button.is-prompt-cancel {
    background-color: #222;
    color: @term-white;

    &:hover {
        background-color: #666;
        color: @term-bright-white;
    }
}

.button.is-prompt-danger {
    background-color: #222;
    color: @term-white;

    &:hover {
        background-color: @tab-red;
        color: @term-bright-white;
    }
}

.button.is-inline-height {
    height: 22px;
}

.button input.confirm-checkbox {
    margin-right: 5px;
}

.cmd-hints {
    .mono-font(10px);
    display: flex;
    flex-direction: row;

    .hint-item {
        padding: 0px 5px 0px 5px;
        border-radius: 0 0 3px 3px;
        cursor: pointer;
    }

    .hint-item:not(:last-child) {
        margin-right: 8px;
    }

    .hint-item.color-green {
        color: black;
        background-color: @tab-green;

        &:hover {
            color: white;
        }
    }

    .hint-item.color-nohover-green {
        color: black;
        background-color: @tab-green;
        cursor: default;
    }

    .hint-item.color-white {
        color: black;
        background-color: @term-white;

        &:hover {
            background-color: @term-bright-white;
        }
    }

    .hint-item.color-nohover-white {
        color: black;
        background-color: @term-white;
        cursor: default;
    }

    .hint-item.color-blue {
        color: black;
        background-color: @tab-blue;

        &:hover {
            color: white;
        }
    }

    .hint-item.color-nohover-blue {
        color: black;
        background-color: @tab-blue;
        cursor: default;
    }
}

.markdown {
    color: @term-white;
    margin-bottom: 10px;

    code {
        background-color: black;
        color: white;
        .mono-font();
        padding: 5px;
    }

    code.inline {
        padding-top: 0;
        padding-bottom: 0;
    }

    .title {
        color: white;
        margin-top: 16px;
        line-height: 1.25;
        margin-bottom: 8px;
    }

    strong {
        color: white;
    }

    a {
        color: #32afff;
    }

    table {
        tr th {
            color: white;
        }
    }

    ul {
        list-style-type: disc;
        list-style-position: outside;
        margin-left: 16px;
    }

    ol {
        list-style-position: outside;
        margin-left: 19px;
    }

    blockquote {
        margin: 4px 10px 4px 10px;
        border-radius: 3px;
        background-color: #444;
        padding: 2px 4px 2px 6px;
    }

    pre {
        background-color: inherit;
        margin: 4px 10px 4px 10px;
        padding: 2px 4px 2px 6px;
    }

    .title.is-1 {
        font-size: 32px;
        border-bottom: 1px solid #777;
        padding-bottom: 6px;
    }
    .title.is-2 {
        font-size: 24px;
        border-bottom: 1px solid #777;
        padding-bottom: 6px;
    }
    .title.is-3 {
        font-size: 20px;
    }
    .title.is-4 {
        font-size: 16px;
    }
    .title.is-5 {
        font-size: 14px;
    }
    .title.is-6 {
        font-size: 14px;
    }
}

.markdown > *:first-child {
    margin-top: 0 !important;
}

.copied-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    opacity: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    .mono-font(12px);
    animation-name: fade-in-out;
    animation-duration: 0.3s;
}

.loading-spinner {
    display: inline-block;
    position: absolute;
    top: calc(40% - 8px);
    left: 30px;
    width: 20px;
    height: 20px;

    div {
        box-sizing: border-box;
        display: block;
        position: absolute;
        width: 16px;
        height: 16px;
        margin: 2px;
        border: 2px solid #777;
        border-radius: 50%;
        animation: loader-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
        border-color: #777 transparent transparent transparent;
    }

    div:nth-child(1) {
        animation-delay: -0.45s;
    }

    div:nth-child(2) {
        animation-delay: -0.3s;
    }

    div:nth-child(3) {
        animation-delay: -0.15s;
    }
}

#measure {
    position: absolute;
    z-index: -1;
    top: -5000px;

    .mono {
        .mono-font();
    }

    .pre {
        white-space: pre;
    }
}

.text-button {
    .mono-font(12px, 700);
    color: @term-white;
    cursor: pointer;
    background-color: #171717;
    outline: 2px solid #171717;

    &:hover,
    &:focus {
        color: @term-white;
        background-color: #333;
        outline: 2px solid #333;
    }

    &.connect-button {
        color: @term-green;
        &:hover {
            color: @term-green;
        }
    }

    &.disconnect-button {
        color: @term-red;
        &:hover {
            color: @term-red;
        }
    }

    &.success-button {
        color: @term-green;
        &:hover {
            color: @term-green;
        }
    }

    &.error-button {
        color: @term-red;
        &:hover {
            color: @term-red;
        }
    }

    &.grey-button {
        color: #666;
        &:hover {
            color: #666;
        }
    }

    &.disabled-button {
        &:hover,
        &:focus {
            outline: none;
            background-color: #171717;
        }
        cursor: default;
    }
}

.focus-indicator {
    position: absolute;
    display: none;
    width: 5px;
    border-radius: 3px;
    height: calc(100% - 20px);
    top: 10px;
    left: 0;
    z-index: 8;

    &.selected {
        display: block;
        background-color: #666 !important;
    }

    &.active,
    &.active.selected {
        display: block;
        background-color: @tab-blue !important;
    }

    &.active.selected.fg-focus {
        display: block;
        background-color: @tab-green !important;
    }
}

.focus-parent:hover .focus-indicator {
    display: block;
    background-color: #222;
}

#main .term-prompt {
    font-size: 14px;

    i {
        margin-right: 3px;
    }

    .term-prompt-branch {
        color: @term-white;
    }

    .term-prompt-python {
        color: @term-bright-magenta;
    }

    .term-prompt-remote {
        i {
            margin-right: 0;
        }
    }

    .term-prompt-remote {
        color: @term-bright-green;

        &.color-green {
            color: @term-bright-green;
        }

        &.color-red {
            color: @term-bright-red;
        }

        &.color-blue {
            color: @term-bright-blue;
        }

        &.color-yellow {
            color: @term-bright-yellow;
        }

        &.color-magenta {
            color: @term-bright-magenta;
        }

        &.color-cyan {
            color: @term-bright-cyan;
        }

        &.color-white {
            color: @term-bright-white;
        }

        &.color-orange {
            color: @tab-orange;
        }
    }

    .term-prompt-cwd {
        color: @term-bright-green;
    }

    .term-prompt-end {
        color: @term-bright-green;
    }
}

.remote-status {
    font-size: 8px;
    margin-right: 5px;
    position: relative;
    top: -3px;
    color: #c4a000;

    &.status-init,
    &.status-disconnected {
        color: #c4a000;
    }

    &.status-connecting {
        color: #c4a000;
    }

    &.status-connected {
        color: #4e9a06;
    }

    &.status-error {
        color: #cc0000;
    }
}
