@term-black: #000000;
@term-red: #cc0000;
@term-green: #4e9a06;
@term-yellow: #c4a000;
@term-blue: #3465a4;
@term-magenta: #75507b;
@term-cyan: #06989a;
@term-white: #d3d7cf;
@term-bright-black: #555753;
@term-bright-red: #ef2929;
@term-bright-green: #8ae234;
@term-bright-yellow: #fce94f;
@term-bright-blue: #32afff;
@term-bright-magenta: #ad7fa8;
@term-bright-cyan: #34e2e2;
@term-bright-white: #ffffff;

@tab-black: rgb(0, 0, 0);
@tab-red: rgb(205, 49, 49);
@tab-green: rgb(0, 128, 0);
@tab-orange: rgb(255, 199, 6);
@tab-yellow: rgb(229, 229, 16);
@tab-blue: rgb(0, 71, 171);
@tab-magenta: rgb(188, 63, 188);
@tab-cyan: rgb(17, 168, 205);
@tab-white: rgb(249, 249, 249);

@tab-black-text: #333;
@tab-white-text: #d7d7d7;

@prompt-green: rgb(0, 177, 10);

@soft-blue: #729fcf;

@active-menu-color: rgb(0, 71, 171);

@import "utils.less";
@import "webshare.less";
@import "views.less";
@import "sidebar.less";
@import "modals.less"; // includes settings
@import "comps.less"; // includes terminal
@import "tabs.less";
@import "cmdinput.less";
@import "lines.less";

// global settings / overrides

:root {
    --fa-style-family: "Font Awesome 6 Sharp";
}

html,
body,
#app,
#main {
    background-color: #000;
    height: 100vh;
}

.content {
    a:hover {
        color: #485fc7;
    }
}

body {
    overflow: hidden;
}

body::-webkit-scrollbar {
    display: none;
}

*::-webkit-scrollbar {
    background-color: #777;
    width: 5px;
    height: 5px;
}

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

input[type="checkbox"] {
    cursor: pointer;
}

// main layout
#main {
    height: 100vh;
    display: flex;
    flex-direction: column;

    .main-content {
        display: flex;
        flex-direction: row;
        background-color: black;
        height: 100%;

        .session-view,
        .history-view,
        .bookmarks-view {
            flex-grow: 1;
            display: flex;
            flex-direction: column;
            min-width: 300px;
            position: relative;

            &.is-hidden {
                display: none;
            }
        }

        .screen-view {
            flex-grow: 1;
            border-right: 1px solid #ccc;
            position: relative;
        }

        .window-view {
            display: flex;
            flex-direction: column;
            position: relative;

            .rendermode-tag {
                position: absolute;
                top: 0;
                right: 0;
                background-color: rgba(78, 154, 6, 0.65);
                color: black;
                padding: 2px 8px 2px 4px;
                border-bottom-left-radius: 5px;
                z-index: 10;
                font-size: 12px;

                &.is-active {
                    color: #ccc;
                }

                .render-mode {
                    padding-top: 2px;
                    font-size: 16px;
                    position: relative;
                    cursor: pointer;
                    color: #ccc;

                    &:hover {
                        color: white;
                    }
                }
            }

            .share-tag {
                color: #ccc;
                position: absolute;
                top: 0;
                left: 40%;
                background-color: darken(rgb(0, 177, 10), 20%);
                padding: 2px 8px 2px 4px;
                z-index: 11;
                font-size: 12px;
                /* border-radius: 0 0 5px 5px; */
                opacity: 0.8;
                display: flex;
                flex-direction: column;

                .share-tag-link {
                    margin-top: 10px;
                    display: none;
                }

                &:hover {
                    .share-tag-title {
                        font-size: 14px;
                        font-weight: bold;
                    }
                    opacity: 1;
                    padding: 20px;
                    width: 250px;
                    border: 1px solid #ccc;
                    border-top: 0;

                    .share-tag-link {
                        display: flex;
                        flex-direction: row;
                        align-items: center;
                        gap: 10px;
                    }
                }
            }

            .window-empty {
                display: flex;
                align-items: center;
                justify-content: center;
                width: 100%;
                padding: 10px;
                height: 100%;
                color: #ccc;
                .mono-font();

                code {
                    background-color: black;
                    color: #4e9a06;
                }

                &.should-fade {
                    opacity: 1;
                    animation: fade-in 2.5s;
                }
            }
        }
    }
}

.remote-field .remote-status {
    top: 4px;
}

.image-renderer {
    padding: 10px;
    img {
        display: block;
    }
}

.renderer-container {
    .error-container {
        color: @term-red;
        font-size: 14px;
        padding: 5px;
    }

    .scroller {
        overflow: auto;
        display: flex;
        flex-direction: row;
    }

    .dropdown {
        background: #dbdbdb;
        color: black;
        border-radius: 6px 6px 0 0;
        font-size: 10px;
        padding: 2px 0 5px 5px;
        outline: none;
    }
}

.renderer-container.code-renderer {
    .scroller {
        padding-top: 10px;
        padding-bottom: 15px;
    }
    
    .monaco-editor .monaco-editor-background {
        background-color: rgba(255, 255, 255, 0.075) !important;
    }
    .cmd-hints {
        display: inline-block;
        position: relative;
        margin-right: 26px;
    }
    .hint-item {
        border-radius: 4px 4px 0 0;
        padding: 3px 9px 2px 8px;
        line-height: 15px;
        text-align: center;
    }
    section {
        transition: height 0.3s ease-in-out;
    }
    .save-enabled {
        color: white;
        background-color: #4e9a06;
    }
    .save-disabled {
        color: rgb(52, 52, 52);
        background-color: #aaaea7;
        cursor: default !important;
    }
    .save-disabled:hover {
        background-color: #aaaea7;
    }
    .close-enabled {
        color: white;
        background-color: #9e0000;
    }
    .close-disabled {
        color: rgb(52, 52, 52);
        background-color: #aaaea7;
        cursor: default !important;
    }
    .close-disabled:hover {
        background-color: #aaaea7;
    }
    .message {
        color: white;
        border-radius: 6px;
        margin-bottom: 1rem;
        padding: 4px 1rem;
        max-width: 80vw;
    }
}

.renderer-container.json-renderer {
    padding: 10px;
    font-size: 12px;
}

.markdown-renderer .markdown {
    padding: 5px;
    line-height: 1.5;
    width: fit-content;

    blockquote {
        background-color: #222;
    }

    code {
        background-color: #222;
        font-size: 14px;
    }

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

.openai-renderer {
    .openai-message {
        display: flex;
        flex-direction: row;
        justify-content: flex-start;

        .openai-role {
            color: @term-bright-green;
            font-weight: bold;
            width: 100px;
        }

        .openai-role.openai-role-assistant {
            color: @term-bright-white;
        }

        .openai-content-user {
            white-space: pre;
            color: white;
        }

        .openai-content-assistant {
            color: white;
        }

        .openai-role-error {
            color: @term-bright-red;
        }

        .openai-content-error {
            color: @term-bright-red;
        }
    }
}
