:root {
    --fallback-title-bar-height: 40px;
}

body {
    font-family: system-ui, "Raleway", sans-serif;
}

.draggable {
    app-region: drag;
    /* Pre-fix app-region during standardization process */
    -webkit-app-region: drag;
}

.nonDraggable {
    app-region: no-drag;
    /* Pre-fix app-region during standardization process */
    -webkit-app-region: no-drag;
}

#searchResults {
    display: flex;
    align-items: center;
    margin-left: .5%;
}

#replaceButton,
#searchButton {
    border-style: ridge;
    border-radius: 50%;
    cursor: pointer;
}

#titleBarContainer {
    position: fixed;
    top: env(titlebar-area-y, 0);
    height: env(titlebar-area-height, var(--fallback-title-bar-height));
    width: 99vw;
}

#titleBar {
    position: absolute;
    top: 0;
    display: flex;
    user-select: none;
    height: 100%;
    left: 0;
    width: 86vw;
    color: #FFFFFF;
    font-weight: bold;
    text-align: center;
}

#titleBar>span {
    margin-top: auto;
    margin-bottom: auto;
    padding: 0px 16px 0px 16px;
}

#titleBar>input {
    flex: .5;
    margin: 8px;
    border-radius: 5px;
    border: none;
    padding: 8px;
}

#mainUI {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: env(titlebar-area-height, var(--fallback-title-bar-height));
    overflow-y: scroll;
    margin-top: 5px;
}

.editor {
    margin: 0 auto;
    height: 91vh;
    padding: 16px;
    overflow-x: clip;
    border-radius: 30px;
    overflow-y: scroll;
    font-family: system-ui, "Raleway", sans-serif;
    font-size: 16px;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.editor-toolbar button {
    background-color: transparent;
    border: none;
    cursor: pointer;
    outline: none;
    padding: 8px;
    margin-right: 8px;
    font-size: 20px;
}

.editor-content {
    width: 99%;
    height: 78%;
    border-radius: 10px;
    border-width: thin;
    overflow: auto;
    display: none;
    padding: 5px;
}

.editor-content.active {
    display: block;
}

.line-numbers {
    position: absolute;
    left: 0;
    top: 0;
    width: 50px;
    background-color: #f8f8f8;
    border-right: 1px solid #ddd;
    padding-right: 10px;
    box-sizing: border-box;
}

/* textarea {
    position: absolute;
    left: 50px;
    top: 0;
    width: calc(100% - 50px);
    height: 100%;
    padding: 0;
    margin: 0;
    resize: none;
    box-sizing: border-box;
    font-family: monospace;
    line-height: 1.2em;
} */

#moreInfo {
    display: flex;
    justify-content: flex-end;
    width: -webkit-fill-available;
}

#logo {
    width: 38px;
    height: 38px;
    content: url("/src/images/bizlogo-128.png");
    scale: .8;
}

.tab-bar-tab-cont {
    display: flex;
    padding: .2%;
    align-items: stretch;
    height: 3vh;
    width: 15vw;
}

.tab-bar-tab {
    width: 99%;
    overflow: clip;
}


.tab-bar {
    display: flex;
    overflow-x: auto;
    margin-bottom: 16px;
    max-width: 97%;
    max-height: 50px;
    border-radius: 15px;
    border-style: solid;
    border-width: thin;
    padding: 8px 16px;
}

.tab-bar button {
    background-color: transparent;
    border: none;
    cursor: pointer;
    outline: none;
    font-size: 100%;
}

.settings-menu {
    width: 20vw;
    position: fixed;
    left: 0;
    height: 91vh;
    overflow: auto;
    padding: 16px;
    transition: transform 0.3s ease-in-out;
    transform: translateX(-100%);
    border-radius: 30px;
}

.settings-menu.open {
    transform: translateX(0);
    margin-left: 10px;
}

.settings-menu-toggle {
    cursor: pointer;
    color: #757575;
}

#settingOpts {
    display: flex;
    flex-direction: column;
}

.optionLabel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 5vh;
}

.toggle {
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    border: 0;
    outline: 0;
    cursor: pointer;
    margin: 10px;
}

.toggle:before {
    content: "";
    width: 16px;
    height: 16px;
    display: block;
    position: absolute;
    left: 0;
    top: -1px;
    border-radius: 50%;
    background: rgb(255, 255, 255);
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
}

.toggle:after {
    content: "";
    width: 30px;
    height: 14px;
    display: inline-block;
    background: #e6ffff;
    border-radius: 18px;
    clear: both;
}


.toggle,
.toggle:before,
.toggle:after,
.toggle:checked:before,
.toggle:checked:after {
    transition: ease 0.3s;
    -webkit-transition: ease 0.3s;
}

.slider {
    border-radius: 15px;
    width: 20%;
    padding: 5px;
}

.editor-container {
    margin-left: 0;
    transition: margin-left 0.3s ease-in-out;
}

.editor-container.open {
    margin-left: 24vw;
}

.noTouch {
    pointer-events: none;
    cursor: default;
    user-select: none;
}

.listItem {
    border-style: ridge;
    border-radius: 10px;
    padding: 5px;
    text-align: center;
    list-style: auto;
    cursor: pointer;
}

/* Custom Material Icons */
.material-icons-round {
    font-family: 'Material Icons Round', sans-serif;
    font-weight: normal;
    font-style: normal;
    font-size: 3vh;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}


::highlight(found) {
    background-color: red;
    color: white;
  }

@media (prefers-color-scheme: dark) {
    html {
        background: black;
    }

    #replaceButton,
    #searchButton {
        color: white;
        background: black;
    }

    .editor {
        border: 1px solid #5f5e5e;
        color: white;
    }

    .tab-bar-tab,
    .closer,
    .editor-toolbar button {
        color: #a9a7a7;
    }

    .editor-toolbar button:hover {
        color: #fbfbfb;
    }

    .closer.active,
    .tab-bar-tab.active {
        color: black;
    }

    .tab-bar-tab-cont.active {
        background-color: #a9a7a7;
        border-radius: 12px;
        color: black;
    }

    .tab-bar {
        border: 1px solid #5f5e5e;
        background-color: #000000;
    }

    .editor-content {
        border: 1px solid #5f5e5e;
        background-color: #000000;
        color: #e0e0e0;
    }

    .settings-menu {
        background-color: #000000;
        border: 1px solid #5f5e5e;
        color: #e0e0e0;
    }

    .toggle:checked:before {
        left: 16px;
        box-shadow: -1px 1px 3px #5f5e5e
    }

    .toggle:checked:after {
        background: #e0e0e0;
    }

    .slider {
        background-color: grey;
        color: white;
    }
}

@media (prefers-color-scheme: light) {
    html {
        background: white;
    }

    #replaceButton,
    #searchButton {
        color: black;
        background: white;
    }

    .editor {
        border: 1px solid #e0e0e0;
        color: #333333;
    }


    .editor-toolbar button {
        color: #757575;
    }

    .editor-toolbar button:hover {
        color: #212121;
    }

    .tab-bar-tab-cont.active {
        background-color: #212121;
        border-radius: 12px;
        color: white;
    }

    .tab-bar {
        border: 1px solid #e0e0e0;
        background-color: #f9f9f9;
    }

    .editor-content {
        color: black;
        border: 1px solid #e0e0e0;
        background-color: #f9f9f9;
    }

    .settings-menu {
        background-color: #f0f0f0;
        border-right: 1px solid #e0e0e0;
        color: black;
    }
}


/* https://developer.mozilla.org/en-US/docs/Web/CSS/@media/device-posture */

@media (device-posture: folded) and (orientation: landscape) {
    .list-view {
        margin-inline-end: 60px;
    }
}

@media (device-posture: folded) and (orientation: portrait) {
    .list-view {
        margin-block-end: 60px;
    }
}