body {
    font-family: Arial, sans-serif;
    margin: 0;
    background-color: #f4f4f4;
    box-sizing: border-box;
}
button i {
    pointer-events: none;
}

#taco-title {
    color: #333;
    /*float: left;*/
    margin: 6px;
    max-width: 33%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    line-height: 1;
}
#taco-title>* {margin: 0;}
#taco-title>small {font-size: 10px;}

.taco-tools {
    height: 35px;
    text-align: right;
    position: sticky;
    top: -28px;
    width: 512px;
    max-width: 66%;
    float: right;
    background-color: inherit;
    z-index: 1000000;
}

.taco-tools input {
    padding: 6px;
}

.taco-tools>*{
    display: inline-block;
    margin: 3px;
}

.taco-tools button {
    padding: 6px 9px;
    font-size: 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    line-height: 1;
}

.taco-tools button:hover {
    background-color: #0056b3;
}
.taco-tools .top-panel {
    width: 100%;
    margin: 0;
    height: 100%;
    background-color: inherit;
}
.taco-tools .sliding-panel {
    visibility: hidden;
    box-sizing: border-box;
    display: inline-block;
    position: absolute;
    top: 35px;
    right: 0;
    z-index: -1;
    background-color: #FFFA;
    backdrop-filter: blur(3px);
    padding: 0 3px 3px;
    white-space: nowrap;
    transform: translate(0, -37px);
    transition: all 0.6s ease-in-out;
}
.taco-tools .sliding-panel:after{
    content:'\FE3E';
    position: absolute;
    top: 100%;
    right: 0;
    color: #999;
    backdrop-filter: blur(3px);
    visibility: visible;
}
.taco-tools:hover .sliding-panel {
    visibility: visible;
    transform: translate(0, 0);
}

.taco-tools .sliding-panel .fadein-panel {
    display: none;
    position: absolute;
    height: auto;
    top: 35px;
    right: 20px;
    background-color: #FFFA;/*inherit;*/
    backdrop-filter: blur(3px);
    transition: all 0.3s ease-in-out;
    white-space: normal;
}

.taco-tools .fadein-panel>i {
    box-sizing: content-box;
    padding: 6px 6px;
    margin: 1.5px;
    font-size: 16px;
    background-color: #00ff9b;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    line-height: 1;
    width: 16px;
    height: 16px;
    text-align: center;
    position: relative;
}
.taco-tools .fadein-panel>i * {pointer-events: none;}
.taco-tools .fadein-panel>i i:nth-child(2) {
    font-size: 12px;
    position: absolute;
    top: 3px;
    right: 1px;
    color: #999;
}

#domTreeOutput.hidding-panel {
    box-sizing: border-box;
    display: inline-block;
    position: absolute;
    top: 0;
    z-index: 1;
    height: 100%;
    max-width: 30%;
    color: white;
    background-color: #0b3b6987;
    padding: 12px 12px 12px 0;
    overflow-y: auto;
    text-align: left;
    box-shadow: 0px 0px 5px black;
    backdrop-filter: blur(3px);
    transform-origin: top left;
    transform: translate(calc(-100% - 6px), 0);
    transition: all 0.2s ease-in-out;
}
#domTreeOutput.hidding-panel:after{
    content:'\00BB';
    position: absolute;
    top: 0;
    left: 100%;
    backdrop-filter: blur(3px);
    background-color: #087879a6;
}
#domTreeOutput.hidding-panel:hover, #domTreeOutput.hidding-panel.drag-on {transform: translate(-11px, 0);}
#domTreeOutput.hidding-panel>* {
    display: block;
    margin: 0;
    padding: 0;
}
#domTreeOutput.hidding-panel ul {
    padding: 0 0 0 12px;
}
#domTreeOutput.hidding-panel li {
    list-style: none;
    padding: 3px 0 0 0;
    cursor: pointer;
}
#domTreeOutput.hidding-panel li>ul {display: none;}
/*#domTreeOutput.hidding-panel li:hover>ul {display: block;}*/
#domTreeOutput.hidding-panel li>label {
    box-sizing: border-box;
    pointer-events: none;
    position: relative;
    color: #EEE;
    border: 1px solid white;
    padding: 2px 4px;
    white-space: nowrap;
    width: 100%;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 60px;
}
#domTreeOutput.hidding-panel li:hover>label {
    color: white;
}
#domTreeOutput.hidding-panel li>label .remove-element {
    display: none;
    position: absolute;
    top: 0;
    right: 0;
    margin: 0;
    pointer-events: auto;
}
#domTreeOutput.hidding-panel li:hover>label .remove-element {
    display: block;
}
#domTreeOutput.hidding-panel .remove-element:hover {
    color: #FFF;
    background-color: #218838;
}

#sandbox-container.taco {
    position: relative;
    box-sizing: border-box;
    background-color: white;
    border: 1px solid #ddd;
    margin: 0;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#sandbox.taco {
    box-sizing: border-box;
    width: 100%;
    height: calc(100vh - 80px);
    border: 2px dashed #ccc;
    padding: 0;
    overflow: auto;
    position: relative;
    z-index: 0;
}

#sandbox.taco * {
    /*margin: 10px;
    padding: 5px;
    border: 1px solid #eee;
    background-color: #f9f9f9;*/
    cursor: pointer; /* To make them clickable for editing */
}
/*#sandbox *:hover {border: 1px solid #777;}*/

/* Dialog Styling */

#htmlElementDialog {
    /*z-index: 1000001;*/
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
}

.ui-dialog {
    max-width: 90%;
    font-size: 14px;
    z-index: 1000001!important;
}

.ui-dialog .ui-dialog-titlebar {
    background-color: #007bff;
    color: white;
    border-radius: 5px 5px 0 0;
}

.ui-dialog .ui-dialog-content {
    padding: 20px;
}

.ui-dialog label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.ui-dialog select,
.ui-dialog input[type="text"],
.ui-dialog input[type="number"] {
    width: calc(100% - 10px);
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.ui-dialog fieldset {
    border: 1px solid #ddd;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.ui-dialog legend {
    font-weight: bold;
    color: #555;
    padding: 0 5px;
}

.ui-dialog button {
    padding: 8px 15px;
    font-size: 14px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

.ui-dialog button:hover {
    background-color: #218838;
}

#htmlElementDialog .prefab, #htmlElementDialog .tagsel {
    display: inline-block;
    margin: 0 5px;
    vertical-align: top;
}

.tagsel{
    width: 160px;
}
#tagSelect {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    font-size: 26px;
}

#htmlElementDialog .prefab {
    max-width: calc(100% - 185px);
    color: #000;
    white-space: nowrap;
    overflow-y: hidden;
    overflow-x: auto;
}

#htmlElementDialog .prefab .btn {
    margin: 3px;
    padding: 3px 6px;
    background-color: #AFA;
    box-shadow: 1px 1px 3px #333;
    cursor: pointer;
}
#htmlElementDialog .prefab .btn:hover {
    box-shadow: 2px 2px 5px #555;
}
#htmlElementDialog .prefab .btn:active {
    box-shadow: 0px 0px 1px #111;
}
    
#tagInfo {display: block; min-height: 20px;}
#htmlContent {
    width: 100%;
    height: 80px;
    max-width: 100%; 
    min-width: 100%;
    overflow: auto;
    margin: 5px 0 0;
    border: 1px solid #AAA;
}
#useTextLab {
    display: inline-block;
    white-space: nowrap;
}
#useMarkLab {
    display: inline-block;
    white-space: nowrap;
}
#useHTMLLab {
    display: inline-block;
    white-space: nowrap;
}
#insEditElement {
    float: right;
    /*display: grid;*/
}
#insAt {width: auto;}

#openCssDialogBtn {
    background-color: #ffc107;
    color: #333;
}

#openCssDialogBtn:hover {
    background-color: #e0a800;
}

#addCustomCssBtn {
    background-color: #17a2b8;
}

#addCustomCssBtn:hover {
    background-color: #138496;
}

#selectedCssProperties {
    margin-top: 15px;
    border-top: 1px dashed #ccc;
    padding-top: 10px;
}

#cssPreviewList {
    list-style: none;
    padding: 0;
    margin: 0;
}

#cssPreviewList li {
    background-color: #e9ecef;
    padding: 5px 10px;
    margin-bottom: 5px;
    border-radius: 3px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/*#cssPreviewList li .remove-css-prop {
    background: none;
    border: none;
    color: red;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    padding: 0;
    margin-left: 10px;
}*/

.attribute-input-group, .css-prop-input-group {
    width: 100%;
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.attribute-input-group label, .css-prop-input-group label {
    flex: 0 0 120px; /* Fixed width for labels */
    margin-right: 10px;
    font-weight: normal;
}

.attribute-input-group input, .css-prop-input-group input, .css-prop-input-group select {
    flex: 1; /* Take remaining space */
    width: auto; /* Override specific width for dialog inputs */
    margin-bottom: 0;
}

.attribute-input-group .remove-attr, .css-prop-input-group .remove-css-prop, #domTreeOutput.hidding-panel .remove-element {
    background: none;
    border: none;
    color: red;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
}
.attribute-input-group .remove-attr, .css-prop-input-group .remove-css-prop {
    padding: 3px;
    margin: 3px;
}
.attribute-input-group .remove-attr:hover {
    color: #FFF;
    background-color: #218838;
}
.css-prop-input-group .remove-css-prop:hover {
    color: #FFF;
    background-color: #17a2b8;
}


/* The wrapper div that holds the image and controls */
.interactive-wrapper.taco-ctrl {
    position: relative; /* Changed to relative to start, JS will make it absolute */
    /*display: inline-block;*/
    cursor: move;
    user-select: none; /* Prevents text selection during drag */
    background-color: #7779;
    backdrop-filter: blur(3px);
}

/* The image itself. Pointer-events are disabled so clicks go to the wrapper. */
.interactive-wrapper.taco-ctrl img {
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Common style for control handles */
.control-handle.taco-ctrl {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #007bff;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    /*opacity: 0;*/
    transition: opacity 0.2s ease-in-out;
}

/* Show handles on wrapper hover */
.interactive-wrappe.taco-ctrlr:hover .control-handle {
    opacity: 1;
}

/* Resize handle (bottom-right) */
#resize-handle.taco-ctrl {
    bottom: -10px;
    right: -10px;
    cursor: se-resize;
}

/* Rotate handle (top-right) */
#rotate-handle.taco-ctrl {
    top: -10px;
    right: -10px;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M23 4v6h-6"/><path d="M1 20v-6h6"/><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"/></svg>') 10 10, auto;
}

.splash.taco-ctrl {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    z-index: 99999999999;
}
.splash.taco-ctrl .info-box {
    margin: 10% auto;
    vertical-align: middle;
    width: 80%;
    padding: 20px;
    background-color: #3FD9;
    backdrop-filter: blur(3px);
    border: 1px solid #777;
    box-shadow: 6px 6px 12px #333;
    box-sizing: border-box;
}
.splash.taco-ctrl .hdr {text-align: center;}

.modal-popup {
    position: absolute;
    top: 100px;
    right: 20%;
    width: 320px;
    max-width: 60%;
    box-shadow: 3px 3px 9px #333;
    background-color: #DFEA;
    backdrop-filter: blur(3px);
    padding: 10px;
}
.modal-popup .close {
    position: absolute;
    top: 2px;
    right: 2px;
    cursor: pointer;
}

.modal-popup.font-sel.taco-ctrl>div {
    display: inline-block;
    margin: 2px 5px;
    vertical-align: top;
}
.modal-popup.font-sel.taco-ctrl input {
    width: 40px;
}
.modal-popup.font-sel.taco-ctrl div.clrs {
    position: relative;
}
.modal-popup.font-sel.taco-ctrl div.bgrad {
    max-width: 100%;
    overflow: auto;
}
.modal-popup.font-sel.taco-ctrl .clrs button {
    position: absolute;
    top: 18px;
    right: 0;
    width: 22px;
    height: 27px;
    padding: 0;
}