/* Reset and fullscreen styles */
html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#viewer {
  width: 100%;
  height: 100%;
}

/* Menu styling */
.menu {
  position: absolute;
  top: 0;
  width: 300px;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 10px;
  box-sizing: border-box;
  z-index: 10;
  font-family: 'CustomFont';
  overflow-y: auto;
}

#menu {
  left: 0;
}

.feedback-panel {
  right: 0;
  text-align: right;
}

/* Progress bar */
#progressContainer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  z-index: 1000;
}

#progressBar {
  width: 0%;
  height: 100%;
  background: cyan;
  transition: width 0.2s ease-out;
}

/* Screentree container */
.screentree {
  border: 1.5px solid rgba(248, 248, 248, 0.3);
  border-radius: 4px;
  padding: 10px;
  max-height: 200px;
  overflow-y: auto;
  margin-top: 10px;
  margin: 5px;
}

.panel-container {
  margin-bottom: 10px;
  background: rgba(0, 0, 0, 0.8);
  color: #f8f8f8;
  padding: 10px;
  box-sizing: border-box;
  font-family: 'CustomFont';
  overflow-x: hidden; 
  border: 1.5px solid rgba(248, 248, 248, 0.3);
  border-radius: 4px;
}

.panel-header {
  cursor: pointer;
  font-size: 1.2em;
  margin-bottom: 8px;
}

.panel-content {
  overflow-y: auto;
  overflow-x: hidden;
  transition: max-height 0.3s ease;
  max-height: 1000px; /* fully expanded state */
}

.panel-content.collapsed {
  max-height: 0;
}

/* Utility classes */
.flex-row {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.menu-header {
  margin: 0px;
}

/* Spacing for triangle count */
.triangle-count {
  margin: 0 6px;
}

/* Hide native checkbox */
.hidden-checkbox {
  display: none;
}

/* Custom button styling */
.custom-button {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  border: 1.5px solid rgba(248, 248, 248, 0.3);
  border-radius: 4px;
  margin: 5px;
  padding: 5px;
  transition: border-color 0.2s ease-out;
}

button.custom-button {
  appearance: none;
  background: none;
  outline: none;
}

.custom-button img {
  height: 24px;
  width: 24px;  
  object-fit: contain;
  vertical-align: middle;
  opacity: 0.3;
  transition: opacity 0.2s ease-out;
}

input[type="checkbox"]:checked + label.custom-button {
  border-color: rgba(248, 248, 248, 1);
}

input[type="checkbox"]:checked + label.custom-button img {
  opacity: 1;
}

.custom-button:active {
  border-color: rgba(248, 248, 248, 1);
}

/* Additional styling from your original CSS */

@font-face {
  font-family: 'CustomFont';
  src: url('/util/font.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  text-transform: uppercase;
}

body {
  font-family: 'CustomFont';
  background-color: #222222;
  color: #f8f8f8;
  margin: 0;
  padding: 0;
}

#dropArea {
  width: 50%;
  height: 50px;
  margin: 30px auto;
  border: 2px dashed #ccc;
  line-height: 50px;
  text-align: center;
  transition: border 0.3s;
  position: relative;
  z-index: 1000;
  color: #f8f8f8;
}

#dropArea.highlight {
  border-color: #333;
  color: #ffffff;
}

#viewer {
  margin: 0 auto;
}

#title {
  text-align: center;
  font-size: 2em;
  margin: 20px 0;
}

/* Editor Overlay */
.editor-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 2000;
  display: flex;
  flex-direction: column;
}

/* Canvas Container */
.canvas-container {
  position: relative;
  margin: auto;
}

/* UI Panel */
.ui-panel {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #14161c;
  color: #f8f8f8;
  padding: 10px;
  border-radius: 4px;
  z-index: 2100;
  font-family: 'CustomFont', sans-serif;
}

/* Layers Management */
.layers-container {
  margin: 3px;
  height: 400px;
  overflow-y: auto;
  border: 1.5px solid #ccc;
  border-radius: 4px;
  padding: 10px;
  background-color: #14161c;
  color: #f8f8f8;
}
.layers-container .layers-title {
  font-weight: bold;
  margin-bottom: 5px;
}
.layer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  cursor: pointer;
}
.layer-item .left-side {
  display: flex;
  align-items: center;
}
.layer-item input[type="checkbox"],
.layer-item input[type="radio"] {
  margin-right: 5px;
}
.layer-item label {
  margin-left: 5px;
}

/* Button Container */
.button-container {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

/* Additional classes for elements created in JS */
.add-layer-button {
  width: 100%;
  margin-top: 5px;
}

.layer-edit-input {
  margin-left: 5px;
  font-family: 'CustomFont';
  font-size: inherit;
  background-color: #14161c;
  color: #f8f8f8;
  border: 1px solid #ccc;
  padding: 2px;
  border-radius: 4px;
  width: 150px;
  box-sizing: border-box;
}

/* Brush Settings Floating Popup */
.brush-floating {
  position: absolute;
  z-index: 3000;
}

/* Container Styles */
.brush-container {
  color: #f8f8f8;
  padding: 8px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  position: relative;
  max-width: 300px;
  font-family: 'CustomFont', sans-serif;
}

/* Slider Row */
.slider-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

/* Toggle Row */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 10px;
}

/* Color Preview Row */
.color-preview-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 10px;
}

/* Color Preview Element */
#colorDisplay {
  width: 60px;
  height: 30px;
  border: 1px solid #000;
  cursor: pointer;
}

/* Recent Colors Container */
.recent-colors {
  font-size: 0.9em;
  display: flex;
  align-items: center;
}

.recent-colors span {
  margin-right: 5px;
}

/* Color Swatch */
.color-swatch {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 1px solid #000;
  margin-right: 3px;
  cursor: pointer;
}

/* Color Wheel Canvas */
canvas.color-wheel {
  display: block;
  cursor: crosshair;
  margin: 0 auto;
  touch-action: none;
}

/* Floating Brush Container (Right-Click Popup) */
.brush-floating {
  position: absolute;
  z-index: 3000;
}

/* Scene Object Styles */
.scene-object {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  margin-bottom: 5px;
}

/* Visibility toggle icon */
.visibility-toggle {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* Object name styling */
.object-name {
  transition: opacity 0.2s ease-out;
}
