/* CLL Virtual Machine Manager - VirtualBox-style theme */

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    background-color: #ececec;
    color: #000;
    font-family: "Segoe UI", Tahoma, Verdana, sans-serif;
    font-size: 12px;
    line-height: 1.4;
    padding-bottom: 26px;
}
body:has(#screen_container[style*="block"]) {
    background-color: #000;
}

a {
    color: #0b4f9e;
    text-decoration: none;
    cursor: pointer;
}
a:hover {
    text-decoration: underline;
}

/* ---------- native widgets ---------- */

button {
    font: 12px "Segoe UI", Tahoma, sans-serif;
    padding: 3px 10px;
    border: 1px solid #9a948a;
    border-radius: 3px;
    background: linear-gradient(#fdfdfd, #e6e3db);
    color: #000;
    cursor: pointer;
}
button:hover {
    background: linear-gradient(#ffffff, #dbe8f7);
    border-color: #7ea3cd;
}
button:active {
    background: #d7d3ca;
}

input[type=text], input[type=number], select {
    font: 12px "Segoe UI", Tahoma, sans-serif;
    border: 1px solid #9a948a;
    border-radius: 2px;
    padding: 2px 4px;
    background: #fff;
    color: #000;
}
input[type=number] {
    width: 75px;
}
input[type=file] {
    font: 12px "Segoe UI", Tahoma, sans-serif;
}

label {
    white-space: nowrap;
}

/* ---------- window chrome ---------- */

#boot_options {
    background: #f1efe9;
    min-height: calc(100vh - 26px);
}

#vb_menubar {
    position: sticky;
    top: 0;
    z-index: 60;
    background: #f5f4f0;
    border-bottom: 1px solid #d5d1c9;
    padding: 0 4px;
    user-select: none;
}
.vb_menu {
    display: inline-block;
    padding: 5px 12px;
    color: #1a1a1a;
}
.vb_menu:hover {
    background: #dce9f9;
}

/* ---------- toolbar ---------- */

#vb_toolbar {
    position: sticky;
    top: 26px;
    z-index: 55;
    display: flex;
    align-items: stretch;
    gap: 2px;
    padding: 4px 6px;
    background: linear-gradient(#fbfbfa, #e7e4dc);
    border-bottom: 1px solid #c9c5bd;
}
.vb_tool {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 82px;
    padding: 4px 2px;
    border: 1px solid transparent;
    border-radius: 3px;
    background: transparent;
    font-size: 11px;
    color: #1a1a1a;
}
.vb_tool:hover {
    background: #dce9f9;
    border-color: #a8c4e0;
    box-shadow: none;
}
.vb_tool:active {
    background: #c4dcf4;
}
.vb_ico {
    display: block;
    width: 28px;
    height: 28px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 28px 28px;
}
.vb_ico_gear {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 4l2.2 2.9 3.4-.9 1 3.4 3.4 1-.9 3.4L28 16l-2.9 2.2.9 3.4-3.4 1-1 3.4-3.4-.9L16 28l-2.2-2.9-3.4.9-1-3.4-3.4-1 .9-3.4L4 16l2.9-2.2-.9-3.4 3.4-1 1-3.4 3.4.9z' fill='%23e8a33d' stroke='%23806a3a' stroke-width='1.4'/%3E%3Ccircle cx='16' cy='16' r='4' fill='%23f6d9a8' stroke='%23806a3a' stroke-width='1.6'/%3E%3C/svg%3E");
}
.vb_ico_import {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 5v12' stroke='%23e8a33d' stroke-width='4'/%3E%3Cpath d='M10 12l6 7 6-7' fill='none' stroke='%23e8a33d' stroke-width='4'/%3E%3Crect x='6' y='23' width='20' height='4' rx='1' fill='%23c98a2f'/%3E%3C/svg%3E");
}
.vb_ico_export {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 19V7' stroke='%23e8a33d' stroke-width='4'/%3E%3Cpath d='M10 12l6-7 6 7' fill='none' stroke='%23e8a33d' stroke-width='4'/%3E%3Crect x='6' y='23' width='20' height='4' rx='1' fill='%23c98a2f'/%3E%3C/svg%3E");
}
.vb_ico_new {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 3l2.6 7.8H27l-6.6 4.9 2.5 7.9L16 18.9l-6.9 4.7 2.5-7.9L5 10.8h8.4z' fill='%23f3c14e' stroke='%23806a3a' stroke-width='1.4'/%3E%3C/svg%3E");
}
.vb_ico_add {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 6v20M6 16h20' stroke='%234ea64e' stroke-width='6' stroke-linecap='round'/%3E%3C/svg%3E");
}
.vb_ico_tools {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M20 5l7 7-4 4-7-7z' fill='%23b9c2cc' stroke='%235d6670' stroke-width='1.6'/%3E%3Cpath d='M17 13L6 24l3 3 11-11z' fill='%23e8a33d' stroke='%23806a3a' stroke-width='1.6'/%3E%3C/svg%3E");
}
.vb_ico_dark {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M22 18a9 9 0 1 1-8-13 7 7 0 0 0 8 13z' fill='%23555f6d' stroke='%233a424c' stroke-width='1.5'/%3E%3C/svg%3E");
}

#pytools {
    position: fixed;
    top: 62px;
    left: 8px;
    z-index: 80;
    width: 320px;
    background: #f7f6f2;
    border: 1px solid #9c968b;
    border-radius: 4px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    padding: 8px;
    font-size: 12px;
}
.pytools_head {
    font-weight: bold;
    margin-bottom: 6px;
    border-bottom: 1px solid #d5d1c9;
    padding-bottom: 4px;
}
.pytools_head span {
    float: right;
    cursor: pointer;
    color: #666;
}
.pytools_row {
    margin: 4px 0;
}
.pytools_status {
    margin-top: 6px;
    padding-top: 4px;
    border-top: 1px solid #e2ddd4;
    color: #444;
    font-family: Consolas, monospace;
    font-size: 11px;
    word-break: break-word;
}

/* ---------- body split ---------- */

#vb_body {
    display: flex;
    min-height: calc(100vh - 90px);
    border-bottom: 1px solid #c9c5bd;
}

#vb_left {
    width: 300px;
    min-width: 220px;
    background: #fff;
    border-right: 1px solid #c9c5bd;
    display: flex;
    flex-direction: column;
}
#vb_tools_header {
    background: linear-gradient(#5b93cf, #3a6fae);
    color: #fff;
    font-weight: bold;
    padding: 6px 10px;
    border-bottom: 1px solid #2f5c92;
}
#vb_tree {
    flex: 1;
    overflow: auto;
}

#vb_right {
    flex: 1;
    background: #f4f2ec;
    padding: 14px 18px;
    overflow: auto;
}

/* ---------- VM list ---------- */

#oses {
    display: block;
}
#oses .th {
    display: none;
}
#oses a.tr {
    display: block;
    padding: 3px 10px;
    border-bottom: 1px solid #eef0f2;
    color: #000;
    white-space: nowrap;
    overflow: hidden;
}
#oses a.tr:hover {
    background: #dce9f9;
    text-decoration: none;
}
#oses a.tr span {
    display: none;
}
#oses a.tr span:nth-child(1) {
    display: inline-block;
    font-weight: normal;
    color: #000;
}
#oses a.tr span:nth-child(3) {
    display: inline-block;
    float: right;
    opacity: 0.75;
}
#oses a.tr span:nth-child(3) div {
    height: 1em;
}

/* ---------- filters ---------- */

#filter {
    background: #f6f5f1;
    border-top: 1px solid #c9c5bd;
    padding: 6px 8px;
    max-height: 200px;
    overflow: auto;
    font-size: 11px;
}
.vb_filter_title {
    font-weight: bold;
    margin-bottom: 4px;
    color: #333;
}
#filter label {
    display: inline-block;
    background: #e7e4dc;
    border: 1px solid #c9c5bd;
    border-radius: 3px;
    padding: 1px 5px;
    margin: 2px 2px 2px 0;
    user-select: none;
}
#filter input[type=checkbox] {
    vertical-align: middle;
    margin: 0 2px 0 0;
}
.vb_filter_reset {
    margin-top: 6px;
}

/* ---------- welcome pane ---------- */

#vb_welcome h1 {
    font-size: 16px;
    margin: 0 0 10px 0;
}
#vb_welcome p {
    max-width: 500px;
    margin: 0 0 10px 0;
    line-height: 1.55;
}
#vb_welcome_art {
    margin-top: 6px;
}
.vb_hide_creepy {
    display: block;
    margin: 8px 0;
    user-select: none;
}

/* ---------- setup form ---------- */

#vb_setup h1 {
    font-size: 16px;
    margin: 0 0 6px 0;
}
.vb_group {
    background: linear-gradient(#e7f0fa, #d5e5f6);
    border: 1px solid #b6cfe8;
    color: #1a3c63;
    font-weight: bold;
    padding: 4px 8px;
    margin: 14px 0 6px 0;
    border-radius: 2px;
}
table.vb_form {
    border-collapse: collapse;
    width: auto;
}
table.vb_form td {
    padding: 3px 8px 3px 0;
    vertical-align: middle;
}
.vb_presets {
    font-weight: normal;
    color: #444;
    margin-top: 2px;
}
#start_emulation {
    padding: 5px 20px;
    font-weight: bold;
    font-size: 13px;
}
.vb_setup_actions {
    margin: 16px 0 4px 0;
}

/* ---------- runtime controls ---------- */

#runtime_options {
    position: sticky;
    top: 0;
    z-index: 60;
    padding: 6px 8px;
    background: linear-gradient(#fbfbfa, #e7e4dc);
    border-bottom: 1px solid #c9c5bd;
}
#runtime_options button {
    margin: 0 3px 3px 0;
}
.vb_scale {
    margin-left: 6px;
}

/* ---------- status bar ---------- */

#vb_statusbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ece9e1;
    border-top: 1px solid #b5b0a8;
    padding: 3px 10px;
    font-size: 11px;
    color: #333;
}
.vb_status_spacer {
    flex: 1;
}
#vb_statusbar code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 11px;
}

/* ---------- emulator screen ---------- */

#log, #runtime_infos, #serial, #filesystem_panel, #debug_panel {
    font-family: DejaVu Sans Mono, monospace;
    font-size: 13px;
    border: 1px solid #333;
    background-color: #000;
    padding: 4px;
    color: #fff;
}
#screen_container:fullscreen {
    display: flex !important;
    align-items: center;
    justify-content: center;
}
#screen_container:fullscreen #vga {
    width: auto !important;
    height: 100% !important;
}
#runtime_infos {
    position: fixed;
    bottom: 30px;
    right: 10px;
    z-index: 40;
    width: 250px;
    margin: 0;
    padding-bottom: 7px;
}
#filesystem_panel {
    position: fixed;
    bottom: 240px;
    right: 10px;
    z-index: 40;
    width: 250px;
    margin: 0;
    padding-bottom: 7px;
}
#log {
    height: 100px;
    width: 550px;
}
#debug_panel {
    white-space: pre;
    float: left;
}
#serial {
    margin: 0;
}
#serial:focus {
    outline: 1px solid rgb(229, 151, 0);
}
#screen {
    white-space: pre;
    position: relative;
    font-family: Liberation Mono, DejaVu Sans Mono, Courier New, monospace;
    font-weight: bold;
    font-size: 15px;
    line-height: normal;
}
#screen, #vga {
    -webkit-transform-origin: top left;
    -moz-transform-origin: top left;
    transform-origin: top left;
}
#vga {
    background-color: #000;
    touch-action: none;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}
#screen_container {
    display: block;
    width: max-content;
    margin: 12px auto;
    outline: 1px solid #555;
}

#loading {
    position: fixed;
    top: 38%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    max-width: 80vw;
    white-space: pre-wrap;
    background: #111;
    color: #fff;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 12px 16px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
}

.phone_keyboard {
    width: 0;
    height: 0;
    resize: none;
    position: absolute;
    opacity: 0;
    left: -9999em;
    top: 0;
    z-index: -10;
    white-space: nowrap;
    overflow: hidden;
}

#terminal {
    max-width: 1024px;
}
.blink {
    animation: blink 0.6s step-start infinite;
}
@keyframes blink {
    50% {
        color: transparent;
    }
}
.blinking-cursor {
    animation: blinking-cursor 0.6s step-start infinite;
}
@keyframes blinking-cursor {
    50% {
        background-color: transparent;
    }
}

/* ---------- OS list family icons ---------- */

.gui_icon {
    height: 1em;
    content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 56 50"><path d="M65.6 102.7h15.3v5.1H65.6z" style="fill:%23445;fill-opacity:1;stroke:none" transform="translate(-64.1 -84.7)"/><path d="M80.9 92.4H118V118H81ZM65 103.6v25.6h38V118H80.8v-14.4z" style="fill:none;stroke:%23445;stroke-width:2;stroke-linecap:square" transform="translate(-64.1 -84.7)"/><path d="M80.9 92.4h37.9v5.1H80.9zm8.7 21.1v-12.3l7.6 7.6-2.7 1.5 1.9 3.2-1.8 1-2-3.4z" style="fill:%23445;fill-opacity:1;stroke:none" transform="translate(-64.1 -84.7)"/></svg>');
}
.tui_icon {
    height: 1em;
    content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 55 48"><g style="fill:%23445"><path d="M91 127h26v5H91z" transform="translate(-64 -85)"/><path d="M118 17h26v5h-26z" transform="rotate(45 70 -120)"/><path d="M-43 139h26v5h-26z" transform="rotate(-45 -134 35)"/></g></svg>');
}

/* ---------- theatre mode ---------- */

.theatre_screen_container {
    position: fixed;
    transform: translate(-50%, -50%);
    top: 50dvh;
    left: 50vw;
    z-index: 2;
    outline: none !important;
    margin: 0 !important;
    float: none;
}
.theatre_runtime_options {
    position: fixed;
    width: 100vw;
    top: 0;
    left: 0;
    padding: 5px !important;
    z-index: 3;
    background-color: black;
    border-bottom: 2px solid #333;
    transform: translate(0%, -50%);
}
.theatre_runtime_options:hover {
    transform: translate(0%, 0%);
}
.theatre_runtime_infos {
    position: fixed;
    bottom: 0;
    z-index: 4;
    margin: 0 !important;
    transform: translate(-10px, calc(100% - 65px));
    opacity: 40%;
}
.theatre_runtime_infos:hover {
    transform: translate(-10px, -5px);
}
.theatre_filesystem_panel {
    position: fixed;
    bottom: 0;
    z-index: 4;
    margin: 0 !important;
    transform: translate(0%, 75%);
    left: 280px;
}
.theatre_filesystem_panel:hover {
    transform: translate(0%, -5px);
}
#theatre_background {
    position: fixed;
    width: 100vw;
    height: 100dvh;
    top: 0;
    left: 0;
    background-color: black;
    display: none;
    z-index: 1;
}
#toggle_ui {
    display: none;
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 5;
}
.theatre_filesystem_panel, .theatre_filesystem_panel {
    opacity: 40%;
}
#toggle_ui, .theatre_runtime_options {
    opacity: 25%;
}
#toggle_ui,
.theatre_runtime_options,
.theatre_runtime_infos,
.theatre_filesystem_panel {
    transition: 0.25s;
}
#toggle_ui:hover,
.theatre_runtime_options:hover,
.theatre_runtime_infos:hover,
.theatre_filesystem_panel:hover {
    opacity: 100%;
}

/* ---------- xterm (copied from xterm.css) ---------- */

.xterm {
    cursor: text;
    position: relative;
    user-select: none;
    -ms-user-select: none;
    -webkit-user-select: none;
}
.xterm.focus,
.xterm:focus {
    outline: none;
}
.xterm .xterm-helpers {
    position: absolute;
    top: 0;
    z-index: 5;
}
.xterm .xterm-helper-textarea {
    padding: 0;
    border: 0;
    margin: 0;
    position: absolute;
    opacity: 0;
    left: -9999em;
    top: 0;
    width: 0;
    height: 0;
    z-index: -5;
    white-space: nowrap;
    overflow: hidden;
    resize: none;
}
.xterm .composition-view {
    background: #000;
    color: #FFF;
    display: none;
    position: absolute;
    white-space: nowrap;
    z-index: 1;
}
.xterm .composition-view.active {
    display: block;
}
.xterm .xterm-viewport {
    background-color: #000;
    overflow-y: scroll;
    cursor: default;
    position: absolute;
    right: 0;
    left: 0;
    top: 0;
    bottom: 0;
}
.xterm .xterm-screen {
    position: relative;
}
.xterm .xterm-screen canvas {
    position: absolute;
    left: 0;
    top: 0;
}
.xterm .xterm-scroll-area {
    visibility: hidden;
}
.xterm-char-measure-element {
    display: inline-block;
    visibility: hidden;
    position: absolute;
    top: 0;
    left: -9999em;
    line-height: normal;
}
.xterm.enable-mouse-events {
    cursor: default;
}
.xterm.xterm-cursor-pointer,
.xterm .xterm-cursor-pointer {
    cursor: pointer;
}
.xterm.column-select.focus {
    cursor: crosshair;
}
.xterm .xterm-accessibility,
.xterm .xterm-message {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    z-index: 10;
    color: transparent;
    pointer-events: none;
}
.xterm .live-region {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.xterm-dim {
    opacity: 1 !important;
}
.xterm-underline-1 { text-decoration: underline; }
.xterm-underline-2 { text-decoration: double underline; }
.xterm-underline-3 { text-decoration: wavy underline; }
.xterm-underline-4 { text-decoration: dotted underline; }
.xterm-underline-5 { text-decoration: dashed underline; }
.xterm-overline {
    text-decoration: overline;
}
.xterm-overline.xterm-underline-1 { text-decoration: overline underline; }
.xterm-overline.xterm-underline-2 { text-decoration: overline double underline; }
.xterm-overline.xterm-underline-3 { text-decoration: overline wavy underline; }
.xterm-overline.xterm-underline-4 { text-decoration: overline dotted underline; }
.xterm-overline.xterm-underline-5 { text-decoration: overline dashed underline; }
.xterm-strikethrough {
    text-decoration: line-through;
}
.xterm-screen .xterm-decoration-container .xterm-decoration {
    z-index: 6;
    position: absolute;
}
.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer {
    z-index: 7;
}
.xterm-decoration-overview-ruler {
    z-index: 8;
    position: absolute;
    top: 0;
    right: 0;
    pointer-events: none;
}
.xterm-decoration-top {
    z-index: 2;
    position: relative;
}

/* ---------- dark mode ---------- */

body.dark {
    background: #1b1b1d;
    color: #e6e6e6;
}
body.dark #boot_options {
    background: #232326;
}
body.dark #vb_menubar {
    background: #2d2d30;
    border-color: #3e3e42;
}
body.dark .vb_menu {
    color: #e6e6e6;
}
body.dark .vb_menu:hover,
body.dark .vb_tool:hover {
    background: #3e3e42;
    border-color: #4e4e52;
}
body.dark #vb_toolbar,
body.dark #runtime_options {
    background: linear-gradient(#2d2d30, #232326);
    border-color: #3e3e42;
}
body.dark .vb_tool {
    color: #e6e6e6;
}
body.dark #vb_tools_header {
    background: linear-gradient(#35618f, #21415f);
}
body.dark #vb_left,
body.dark #oses {
    background: #1b1b1d;
}
body.dark #oses a.tr {
    color: #e6e6e6;
    border-color: #2a2a2c;
}
body.dark #oses a.tr:hover {
    background: #2d3f57;
}
body.dark #oses a.tr span:nth-child(1) {
    color: #e6e6e6;
}
body.dark #vb_right {
    background: #232326;
}
body.dark #filter {
    background: #26262a;
    border-color: #3e3e42;
}
body.dark #filter label {
    background: #3a3a3e;
    border-color: #4e4e52;
    color: #e6e6e6;
}
body.dark .vb_filter_title {
    color: #cfcfcf;
}
body.dark .vb_group {
    background: linear-gradient(#22344a, #1b2a3d);
    border-color: #2f4a6b;
    color: #9fc7ef;
}
body.dark button,
body.dark input[type=text],
body.dark input[type=number],
body.dark input[type=file],
body.dark select {
    background: #333338;
    color: #e6e6e6;
    border-color: #55555a;
}
body.dark button:hover {
    background: #3f3f46;
    border-color: #6a6a72;
}
body.dark #start_emulation {
    background: #35618f;
    color: #fff;
    border-color: #4a7ab0;
}
body.dark a {
    color: #4cc9f0;
}
body.dark a:hover {
    color: #7c5cff;
}
body.dark #vb_statusbar {
    background: #2d2d30;
    color: #c8c8c8;
    border-color: #3e3e42;
}
body.dark #pytools {
    background: #2d2d30;
    border-color: #4e4e52;
}
body.dark .pytools_status {
    color: #bbb;
    border-color: #3e3e42;
}
