/* CATSTL CSS */

:root {
    --min-width: 420px;
    --min-height: 300px;
    --title-height: 65px;
}

html {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin: 0px;
    padding: 0px;
    color: #333;
    background-color: #888888;
    font-family: sans-serif, Helvetica, Arial;
    font-size: 16px;
    overflow-y: hidden;
}

*, *::before, *::after {
  box-sizing: border-box;
}

form {
    display: flex;
    flex-direction: column;
    flex: 1;
}

table, td, th { 
    border: 1px solid #ccc; 
    border-collapse: collapse;
}
table {
    width: 100%;
}
th {
    background-color: #eee;
}
th, td {
    padding: 3px 5px;
}

button {
    font-size: 10pt;
}

details {
    border: 1px solid #ccc; 
    border-radius: 2px;
    padding: 10px;
}

summary {
    padding: 4px 7px;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}
summary:hover {
    background: #eee;
}

textarea {
    font-size: 1em;
}

input {
    font-size: 10pt;
}

input[type="checkbox"] {
    cursor: pointer;
}
input[type="checkbox"][checked] {
    background-color: #2196F3 !important;
    cursor: pointer;
}
input[type="radio"] {
    margin: 0 4px;
    vertical-align: middle;
    cursor: pointer;
}
input[type="number"],
input[type="text"] {
    width: 100%;
    margin: 2px 0;
    border: 1px solid #999; 
    border-radius: 3px;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    padding: 2px;
    -moz-appearance:textfield;
    appearance:textfield;
}
input[type="text"] {
    padding: 5px;
}
input[type="number"]:disabled,
input[type="text"]:disabled {
    border-color: #dcdcdc;
    color: #dcdcdc;
}

label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
}

select {
    min-width: 90px;
    max-width: 100%;
    height: 23px;
    padding: 2px;
    cursor: pointer;
    margin: 2px 0;
    font-size: 10pt;
    border: 1px solid #999; 
    border-radius: 3px;
}
select:disabled {
    border-color: #dcdcdc;
    color: #dcdcdc;
}

fieldset {
    border: none;
    padding: 0;
    margin: 0;
}
fieldset:disabled {
    color: #dcdcdc;
}

/* catstl parent */
.catstl-main {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    display: block;
    text-align: center;
    box-sizing: border-box;
}

/* box frame */
.box_frame {
    background-color: #fff;
    width: 100%;
    margin-bottom: 10px;
    padding: 5px;
    flex-wrap: wrap;
    display: flex;
    text-align: left;
    box-sizing: border-box;
}
.box_frame.menu {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.workspace_frame {
    height: 100%;
    max-height: calc(100vh);
    margin-bottom: 0;
    flex-direction: column;
    flex-wrap: nowrap;
    overflow: hidden;
}

/* tabs */
.tab_class {
    width: 80px;
    height: 26px;
    line-height: 26px;
    background-color: #d9d9d9;
    border: 1px solid #cccccc; 
    border-radius: 2px 2px 0 0;
    margin-right: 5px;
    font-size: 0.8em;
    text-align: center;
    display: block;
    float: left;
    order: -1;
    cursor:pointer;
}

.menu_tabs_top {
    margin: 0 10px;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.menu_tabs_row {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    gap: 4px;
}

.menu_tabs_top .tab_class {
    float: none;
    order: 0;
    flex: 0 0 auto;
    margin-right: 0;
}

.tab_class:hover {
    opacity: 0.8;
}

input[name="tab_name_input"], 
input[name="tab_name_output"] {
    display: none;
}

.tab_content {
    overflow: hidden;
    padding: 0;
    min-height: 0;
    height: 0;
    border: none;
    box-sizing: border-box;
}

.tab_panel {
    display: none;
    width: 100%;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 10px 5px;
    font-size: 0.8em;
    box-sizing: border-box;
}

.tab_title {
    font-weight: bold;
    margin-bottom: 5px;
}

input:checked + .tab_class {
    background-color: #fff;
    border-bottom-color: #fff;
    z-index: 1;
}

#tab_import:checked ~ .menu_tabs_top label[for="tab_import"],
#tab_export:checked ~ .menu_tabs_top label[for="tab_export"],
#tab_create_shape:checked ~ .menu_tabs_top label[for="tab_create_shape"],
#tab_transform:checked ~ .menu_tabs_top label[for="tab_transform"],
#tab_face_edit:checked ~ .menu_tabs_top label[for="tab_face_edit"],
#tab_face_create:checked ~ .menu_tabs_top label[for="tab_face_create"],
#tab_setting:checked ~ .menu_tabs_top label[for="tab_setting"],
#tab_help:checked ~ .menu_tabs_top label[for="tab_help"] {
    background-color: #fff;
    border-bottom-color: #fff;
    z-index: 1;
}

input:checked + .tab_class + .tab_content {
    display: block;
    width: 100%;
    min-height: 0;
    margin: -1px;
    padding: 10px 5px;
    border: 1px solid #fff; 
    border-top-color: #d9d9d9; 
    font-size: 0.8em;
    overflow: auto;
}

.menu input:checked + .tab_class + .tab_content {
    flex: 0 0 auto;
    height: auto;
    max-height: none;
    min-height: 0;
    margin: 0;
    box-sizing: border-box;
    overflow: visible;
}

#tab_import:checked ~ .workspace_row .menu .tab_import,
#tab_export:checked ~ .workspace_row .menu .tab_export,
#tab_create_shape:checked ~ .workspace_row .menu .tab_create_shape,
#tab_transform:checked ~ .workspace_row .menu .tab_transform,
#tab_face_edit:checked ~ .workspace_row .menu .tab_face_edit,
#tab_face_create:checked ~ .workspace_row .menu .tab_face_create,
#tab_setting:checked ~ .workspace_row .menu .tab_setting,
#tab_help:checked ~ .workspace_row .menu .tab_help {
    display: block;
}

.menu {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
}
.menu table {
    width: 100%;
    margin: 5px 0 10px 0;
}
.menu th,
.menu td {
    box-sizing: border-box;
    vertical-align: middle;
}
.menu label {
    margin: 0 5px;
}

/* button */
.btn_catstl {
    color: #fff;
    background-color: #2196F3;
    border: 1px solid #2196F3;
    border-radius: 3px;
    height: 30px;
    padding: 4px 7px;
    line-height: 1;
    margin: 2px 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}
.btn_catstl:hover {
    color: #333;
    background-color: #eee;
    border: 1px solid #333;
}
.btn_catstl[disabled] {
    color: #fff;
    background-color: #DCDCDC;
    border: 1px solid #DCDCDC;
}

.btn_icon {
    width: 40px;
    border: 2px solid #fff; 
    cursor:pointer;
}
.btn_icon.disabled {
    filter: grayscale(1);
    opacity: 0.5;
}
.btn_icon.selected {
    border: 2px solid #000fff; 
    border-radius: 10px;
}
.btn_icon:hover {
    opacity: 0.7;
}
.btn_icon.disabled:hover {
    opacity: 0.5;
}
.space_icon {
    margin-right: 8px;
}

/* textbox */
input.textbox_catstl {
  border-radius: 2px;
  font-size: 1em;
  padding: 2px 6px;
  height: 25px;
}
input.textbox_catstl:disabled {
    background: #efefef;
    opacity: 0.7;
}

/* window */
.window_area {
  position: relative;
  margin: 10px;
  margin-right: 2px;
  font-size: 0.8em;
}
.workspace_row {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    overflow: hidden;
    align-items: stretch;
}
.left_sidebar {
    width: 300px;
    min-width: 300px;
    height: auto;
    min-height: 0;
    margin: 10px 8px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}
.part_panel {
    margin: 0;
    flex: 0 0 230px;
    min-height: 180px;
}
.window_area_view {
    flex: 1 1 auto;
    margin: 10px 10px 10px 0;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow-x: auto;
    overflow-y: auto;
}
.window_icon {
    display: flex;
    gap: 0px;
    margin: 10px;
    min-height: 35px;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: center;
    align-items: center;
}
.window_icon .btn_icon {
    display: block;
    flex: 0 0 35px;
    width: 35px;
    height: 35px;
    min-width: 35px;
    min-height: 35px;
}

.top_bar {
    display: flex;
    flex: 0 0 var(--title-height);
    width: 100%;
}
.site_title {
    height: var(--title-height);
    line-height: var(--title-height);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 30px;
    width: 180px;
    padding-left: 20px;
    flex-shrink: 0;
}

/* part tree*/
.part_tree_table {
    margin-top: 0px !important;
    margin-bottom: 0 !important;
    width: 100%;
    min-width: 0;
    height: 100%;
}
.part_tree_table th {
    padding: 0px 5px;
    height: 25px;
}
.part_tree_table td {
    vertical-align: top;
    padding: 0;
}

.part_tree {
    list-style: none;
    width: 100%;
    height: calc(100% - 10px);
    overflow: auto;
    padding: 10px 5px;
    margin: 0px 0px;
    box-sizing: border-box;
}
.part_list {
    position: relative;
    padding-left: 0;
    margin-left: 15px;
    margin-bottom: 10px;
    list-style: none;
}
.part_list::before {
    content: "";
    display: block;
    position: absolute;
    top: .35em;
    left: -15px;
    width: 0;
    height: 0;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent transparent #333;
}
.part_tree ol {
    background-color: #fff;
}
.part_name {
    margin-bottom: 1px;
}
.part_name.selected {
    color: #fff;
    background-color: #767676;
}
.part_name:hover {
    background-color: #e9e9e9;
}
.part_name.selected:hover {
    color: #fff;
    background-color: #767676;
    opacity: 0.8;
}
.face_list {
    position: relative;
    padding-left: 0px;
    margin-left: -15px;
    list-style: none;
    margin-bottom: 1px;
}
.face_list::before {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    bottom: -1px;
    left: -15px;
    width: 0;
    border-left: 1px solid #333;
}
.face_list::after {
    content: "";
    display: block;
    position: absolute;
    top: 50%;
    left: -15px;
    width: 10px;
    border-bottom: 1px solid #333;
}
.face_list.selected {
    color: #fff;
    background-color: #767676;
}
.face_list.invisible {
    display: block;
    color: #ccc;
}
.face_list:hover {
    background-color: #e9e9e9;
}
.face_list.selected:hover {
    color: #fff;
    background-color: #767676;
    opacity: 0.8;
}

.contextmenu {
    display: none;
    position: fixed;
    width: 250px;
    background-color: #fff;
    border: 1px solid #ccc;
    box-shadow: 1px 1px 1px rgba(0,0,0,.2);
    z-index: 1000;
}
.contextmenu.show {
    display: block;
}
.contextmenu ul {
    list-style: none;
    padding: 0;
    margin: 5px 0px;
    line-height: 170%;
}
.contextmenu ul li {
    padding: 2px 20px;
    color: #333;
    margin-bottom: 2px;
}
.contextmenu ul li:hover {
    background-color: #e9e9e9;
}
.contextmenu hr {
    border: 1px solid #ccc;
    margin: 5px;
}

/* canvas */
.view_switch {
    display: flex;
    gap: 4px;
}
.view_switch input {
    display: none;
}
.view_tab_label {
    padding: 2px 12px;
    height: 20px;
    line-height: 20px;
    border: 1px solid #cccccc;
    border-radius: 4px 4px 0 0;
    background-color: #d9d9d9;
    cursor: pointer;
}
.view_tab_label:hover {
    opacity: 0.8;
}
.view_switch input:checked + .view_tab_label {
    background-color: #fff;
    border-bottom-color: #fff;
}
.view_panel_content {
    display: none;
}
.view_panel_content.is_active {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}
.canvas_container {
    position: relative;
    width: 100%;
    flex: 1 1 auto;
    min-width: var(--min-width);
    min-height: var(--min-height);
}
.canvas {
    display: block;
    border: 1px solid #808080; 
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}
.text_message {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 2px 5px;
}
.text_message.printed {
    color: #fff;
    background-color: #0000ff;
    border-radius: 3px;
    font-weight: bold;
    opacity: 0.7;
}
.out_info {
    margin-top: 10px;
    margin-left: 10px;
}

/* out textarea */
.out_textarea {
    resize: none;
    width: 100%; 
    min-width: var(--min-width);
    min-height: var(--min-height);
    height: 100%;
    padding: 10px;
    font-size: 14px;
    box-sizing: border-box;
}

/* setting area */
.file_import {
    line-height: 30px;
    text-align: center;
}

.input_vec3 {
    display: flex;
    gap: 4px;
    flex-direction: row;
}
.input_vec3 input {
    width: 68px;
}

.input_number {
    width: 68px !important;
}

/* help icon */
.help_tooltip {
    display: inline-block;
    position: relative;
}
.help_icon {
	border-radius:50%;
	width:15px;
	height:15px;
	line-height:16px;
	vertical-align:middle;
	font-size:1em;
	text-align:center;
	background-color:#888888;
	color:white;
	cursor:pointer;
}
.help_tooltip::before,
.help_tooltip::after {
    -webkit-transition: all 0.2s;
    opacity: 0;
    position: absolute;
    transition: all 0.2s;
    visibility: hidden;
    z-index: 11;
}
.help_tooltip::before {
    background: #5f6368;
    border-radius: 3px;
    color: #fff;
    content: attr(data_tooltip);
    display: block;
    font-size: 11px;
    font-weight: 600;
    left: calc(100% + 13px);
    padding: 5px 10px;
    white-space: pre;
    text-align: left;
}
.help_tooltip:hover {
    cursor: pointer;
}
.help_tooltip:hover::before {
    opacity: 1;
    visibility: visible;
}
.help_tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* loading */
#loading {
    display: table;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background-color: #fff;
    opacity: 0.8;
    z-index: 10;
}

#loading .loadingMsg {
    display: table-cell;
    text-align: center;
    vertical-align: middle;
    padding-top: 140px;
    background: url("../files/loading_image.gif") center center no-repeat;
}

/* other */
.nowrap {
    white-space: nowrap;
}

.margin_bottom10 {
    margin-bottom: 10px;
}
.margin_bottom20 {
    margin-bottom: 20px;
}
.margin_top20 {
    margin-top: 20px;
}
.margin_right10 {
    margin-right: 10px;
}

.wait-cursor,
.wait-cursor * {
    cursor: wait !important;
}