@font-face {
  font-family: 'Everett';
  src: url('./public/fonts/Everett-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'Everett';
  src: url('./public/fonts/Everett-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Everett';
  src: url('./public/fonts/Everett-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
}

body {
  margin: 0;
  font-family: 'Everett', Arial, sans-serif;
  background: #000;
  color: #fff;
  overflow: hidden;
}

#heading {
  position: absolute;
  top: 20px;
  left: 30px;
  z-index: 100;
}

#heading h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.border {
  width: 100px;
  height: 2px;
  background: #fff;
  margin: 10px 0;
}

/* Left Panel Container */
#left-panel-container {
  position: absolute;
  top: 60px;
  left: 20px;
  z-index: 100;
  width: 300px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Studio Selection Panel - Separate at Top */
#studio-selection-panel {
  background: rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  border: 1px solid #333;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.panel-section {
  padding: 20px;
}

.panel-section h3 {
  margin: 0 0 15px 0;
  font-size: 16px;
  color: #fff;
  font-weight: 500;
}

.panel-section .panel-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-section .panel-content label {
  font-size: 14px;
  color: #ccc;
  margin-bottom: 5px;
}

/* Main Tools Panel - Scrollable Below */
#main-tools-panel {
  background: rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  border: 1px solid #333;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* Custom scrollbar styling for main tools panel */
#main-tools-panel::-webkit-scrollbar {
  width: 8px;
}

#main-tools-panel::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

#main-tools-panel::-webkit-scrollbar-thumb {
  background: #fff;
  border-radius: 4px;
  transition: background 0.2s ease;
}

#main-tools-panel::-webkit-scrollbar-thumb:hover {
  background: #ccc;
}

#main-tools-panel::-webkit-scrollbar-corner {
  background: transparent;
}

/* Firefox scrollbar styling */
#main-tools-panel {
  scrollbar-width: thin;
  scrollbar-color: #fff rgba(0, 0, 0, 0.2);
}

.tool-section {
  border-bottom: 1px solid #333;
  padding: 20px;
}

.tool-section:last-child {
  border-bottom: none;
}

.tool-section h3 {
  margin: 0 0 15px 0;
  font-size: 16px;
  color: #fff;
  font-weight: 500;
}

.tool-content,
.panel-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0px;
  transition: all 0.3s ease;
  overflow: hidden;
}

.panel-content.collapsed {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.tool-content label,
.panel-content label {
  font-size: 14px;
  color: #ccc;
  margin-bottom: 5px;
}

.tool-content input[type="file"],
.panel-content input[type="file"] {
  padding: 10px;
  border: 1px solid #555;
  border-radius: 6px;
  background: #222;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

.tool-content input[type="file"]:hover,
.panel-content input[type="file"]:hover {
  background: #333;
  border-color: #666;
}

.tool-content input[type="range"],
.panel-content input[type="range"] {
  width: 100%;
  margin-bottom: 5px;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: #333;
  border-radius: 3px;
  outline: none;
}

.tool-content input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: -6px;
}

.tool-content input[type="range"]::-webkit-slider-thumb:hover {
  background: #ccc;
  transform: scale(1.1);
}

.tool-content input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.tool-content input[type="range"]::-moz-range-thumb:hover {
  background: #ccc;
  transform: scale(1.1);
}

.tool-content input[type="range"]::-moz-range-track {
  height: 6px;
  background: #333;
  border-radius: 3px;
}

.tool-content input[type="range"]::-moz-range-progress {
  height: 6px;
  background: #ccc;
  border-radius: 3px;
}

.tool-content input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: #333;
  border-radius: 3px;
}

.tool-content button,
.panel-content button {
  background: #333;
  color: #fff;
  border: none;
  padding: 8px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tool-content button:hover:not(:disabled),
.panel-content button:hover:not(:disabled) {
  background: #555;
  transform: translateY(-1px);
}

.tool-content button:disabled,
.panel-content button:disabled {
  background: #555;
  cursor: not-allowed;
  transform: none;
}

.file-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.file-input-row input[type="file"] {
  flex: 1;
  min-width: 0;
}

#reset-button {
  background: #333 !important;
  min-width: 36px;
  padding: 8px !important;
  flex-shrink: 0;
}

#reset-button:hover {
  background: #555 !important;
}

#add-camera-btn {
  background: #333 !important;
}

#add-camera-btn:hover {
  background: #555 !important;
}

/* Studio Selection Dropdown */
#studio-dropdown {
  padding: 10px;
  border: 1px solid #555;
  border-radius: 6px;
  background: #222;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  width: 100%;
}

#studio-dropdown:hover {
  background: #333;
  border-color: #666;
}

#studio-dropdown:focus {
  outline: none;
  border-color: #777;
  background: #333;
}

/* Props Section Styling */
.props-subsection {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #333;
}

.props-subsection:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.props-subsection .custom-dropdown {
  margin-bottom: 12px;
}

.props-subsection input[type="file"] {
  margin-bottom: 12px;
  width: 100%;
  box-sizing: border-box;
}

/* Custom Dropdown with Thumbnails */
.custom-dropdown {
  position: relative;
  width: 100%;
}

.dropdown-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  border: 1px solid #555;
  border-radius: 6px;
  background: #222;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropdown-selected:hover {
  background: #333;
  border-color: #666;
}

.dropdown-selected.open {
  border-radius: 6px 6px 0 0;
  border-color: #777;
  background: #333;
}

.dropdown-arrow {
  transition: transform 0.2s ease;
  color: #aaa;
  width: 16px;
  height: 16px;
}

.dropdown-selected.open .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #222;
  border: 1px solid #777;
  border-top: none;
  border-radius: 0 0 6px 6px;
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1000;
  display: none;
}

.dropdown-options.open {
  display: block;
}

.dropdown-option {
  display: flex;
  align-items: center;
  padding: 10px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-size: 14px;
}

.dropdown-option:hover {
  background: #333;
}

.dropdown-option.selected {
  background: #444;
}

.dropdown-option.loading {
  color: #666;
  font-style: italic;
  justify-content: center;
}

.dropdown-option-thumbnail {
  width: 48px;
  height: 48px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 4px;
  margin-right: 12px;
  flex-shrink: 0;
  border: 1px solid #444;
}

.dropdown-option-text {
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Props buttons */
#add-prop-button, #place-model-button {
  background: #333 !important;
}

#add-prop-button:hover:not(:disabled), 
#place-model-button:hover:not(:disabled) {
  background: #555 !important;
}

#add-prop-button:disabled,
#place-model-button:disabled {
  background: #555 !important;
  cursor: not-allowed;
}

#emissive-value {
  font-size: 12px;
  color: #aaa;
  text-align: center;
  margin-top: 5px;
}

/* Background Transform Controls */
.texture-transform-section {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #333;
}

.texture-transform-section h4 {
  margin: 0 0 15px 0;
  font-size: 14px;
  color: #fff;
  font-weight: 500;
}

.transform-row {
  margin-bottom: 15px;
}

.transform-row > label {
  display: block;
  font-size: 13px;
  color: #ccc;
  margin-bottom: 8px;
  font-weight: 500;
}

.numerical-control-group {
  display: flex;
  gap: 8px;
}

.numerical-control {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.numerical-control label {
  font-size: 12px;
  color: #aaa;
  margin-bottom: 0;
}

.numerical-input-container {
  display: flex;
  align-items: stretch;
  border: 1px solid #555;
  border-radius: 4px;
  background: #222;
  overflow: hidden;
}

.numerical-input-container input[type="number"] {
  flex: 1;
  border: none;
  background: transparent;
  color: #fff;
  padding: 6px 8px;
  font-size: 12px;
  text-align: center;
  outline: none;
  min-width: 0;
}

.numerical-input-container input[type="number"]:focus {
  background: #333;
}

/* Hide number input spinners */
.numerical-input-container input[type="number"]::-webkit-outer-spin-button,
.numerical-input-container input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.numerical-input-container input[type="number"] {
  -moz-appearance: textfield;
}

.decrement-btn,
.increment-btn {
  background: #333 !important;
  color: #fff !important;
  border: none;
  padding: 5px 5px !important;
  margin: 0;
  width: 20px;
  height: 100%;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1;
}

.decrement-btn i,
.increment-btn i {
  margin: 0;
  padding: 0;
  line-height: 1;
}

.decrement-btn:hover,
.increment-btn:hover {
  background: #444 !important;
  color: #fff !important;
}

.decrement-btn:active,
.increment-btn:active {
  background: #555 !important;
  transform: none;
}

.decrement-btn {
  border-right: 1px solid #555;
}

.increment-btn {
  border-left: 1px solid #555;
}

#progress-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
  text-align: center;
}


/* Selection Controls Area - Scrollable Container */
#selection-controls-area {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1000;
  width: 360px;
  max-height: calc(100vh - 320px);
  overflow-y: auto;
  overflow-x: hidden;
}

/* Custom scrollbar styling for control panels */
#selection-controls-area::-webkit-scrollbar {
  width: 8px;
}

#selection-controls-area::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

#selection-controls-area::-webkit-scrollbar-thumb {
  background: #fff;
  border-radius: 4px;
  transition: background 0.2s ease;
}

#selection-controls-area::-webkit-scrollbar-thumb:hover {
  background: #ccc;
}

#selection-controls-area::-webkit-scrollbar-corner {
  background: transparent;
}

/* Firefox scrollbar styling */
#selection-controls-area {
  scrollbar-width: thin;
  scrollbar-color: #fff rgba(0, 0, 0, 0.2);
}

#model-controls,
#camera-controls-panel {
  background: rgba(0, 0, 0, 0.5);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #333;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  margin-bottom: 20px;
  width: 360px;
  box-sizing: border-box;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.panel-header h3 {
  margin: 0;
  font-size: 16px;
  color: #fff;
  font-weight: 500;
}

.collapse-btn {
  background: none !important;
  color: #ccc !important;
  border: none;
  padding: 4px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  min-width: 24px;
  height: 24px;
}

.collapse-btn:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.1) !important;
}

.panel-content {
  transition: all 0.3s ease;
  overflow: hidden;
}

.panel-content.collapsed {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
}

#control-buttons,
#camera-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

#model-delete-row,
#camera-delete-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 15px;
}

#control-buttons button,
#camera-buttons button,
#model-delete-row button,
#camera-delete-row button {
  background: #333;
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 400;
  flex: 1;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

#model-delete-row button,
#camera-delete-row button {
  max-width: calc(33.333% - 5.33px);
}

#control-buttons button:hover,
#camera-buttons button:hover,
#model-delete-row button:hover,
#camera-delete-row button:hover {
  background: #555;
  transform: translateY(-1px);
}

#control-buttons button.active,
#camera-buttons button.active,
#model-delete-row button.active,
#camera-delete-row button.active {
  background: #666;
}

#delete-model-btn,
#delete-camera-btn {
  background: #dc3545 !important;
}

#delete-model-btn:hover,
#delete-camera-btn:hover {
  background: #c82333 !important;
}

#fullscreen-btn {
  background: #333 !important;
}

#fullscreen-btn:hover {
  background: #555 !important;
}

#fullscreen-btn.active {
  background: #fff !important;
  color: #000 !important;
}

#fullscreen-btn.active:hover {
  background: #ccc !important;
  color: #000 !important;
}

#capture-btn {
  background: #333 !important;
}

#capture-btn:hover {
  background: #555 !important;
}

#model-controls small {
  color: #aaa;
  font-size: 11px;
  line-height: 1.4;
}

#transform-space-toggle,
#camera-transform-space-toggle {
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #333;
}

#transform-space-toggle label,
#camera-transform-space-toggle label {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
  color: #ccc;
  font-weight: 500;
}

.space-btn {
  background: #333;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  margin-right: 10px;
  transition: all 0.2s ease;
}

.space-btn:hover {
  background: #444;
  transform: translateY(-1px);
}

.space-btn.active {
  background: #666;
  color: white;
}

.space-btn.active:hover {
  background: #777;
}

#camera-settings {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #333;
}

#camera-settings label {
  display: block;
  margin: 15px 0 8px 0;
  font-size: 14px;
  color: #ccc;
  font-weight: 500;
}

#camera-settings label:first-child {
  margin-top: 0;
}

#camera-settings input[type="range"] {
  width: 100%;
  margin-bottom: 8px;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: #333;
  border-radius: 3px;
  outline: none;
}

#camera-settings input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: -6px;
}

#camera-settings input[type="range"]::-webkit-slider-thumb:hover {
  background: #ccc;
  transform: scale(1.1);
}

#camera-settings input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

#camera-settings input[type="range"]::-moz-range-thumb:hover {
  background: #ccc;
  transform: scale(1.1);
}

#camera-settings input[type="range"]::-moz-range-track {
  height: 6px;
  background: #333;
  border-radius: 3px;
}

#camera-settings input[type="range"]::-moz-range-progress {
  height: 6px;
  background: #ccc;
  border-radius: 3px;
}

#camera-settings input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: #333;
  border-radius: 3px;
}

#camera-settings span {
  font-size: 12px;
  color: #aaa;
  text-align: center;
  display: block;
}


#camera-viewport {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.5);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #333;
  width: 360px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
}

.viewport-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

#camera-viewport h4 {
  margin: 0;
  font-size: 14px;
  color: #fff;
  font-weight: 400;
}

.pin-btn {
  background: none !important;
  color: #666 !important;
  border: none;
  padding: 2px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  min-width: 12px;
  height: 12px;
  font-size: 12px;
}

.pin-btn:hover {
  color: #aaa !important;
  background: rgba(255, 255, 255, 0.1) !important;
}

.pin-btn.pinned {
  color: #fff !important;
}

.pin-btn.pinned:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.1) !important;
}

#viewport-container {
  width: 100%;
  height: 180px;
  border: 1px solid #555;
  border-radius: 8px;
  background: #000;
  overflow: hidden;
}