body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background-color: var(--vscode-editor-background);
  color: var(--vscode-editor-foreground);
  overflow: hidden;
  height: 100vh;
}

#viewer-container {
  position: relative;
  width: 100%;
  height: 100vh;
}

/* Sequence overlay */
.sequence-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 110;
  background: var(--vscode-editorWidget-background);
  border: 1px solid var(--vscode-editorWidget-border);
  border-radius: 6px;
  padding: 8px;
}
.seq-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.seq-wildcard {
  flex: 2;
  padding: 6px;
  border: 1px solid var(--vscode-input-border);
  background: var(--vscode-input-background);
  color: var(--vscode-input-foreground);
}
.seq-btn {
  padding: 4px 8px;
  border: 1px solid var(--vscode-button-border);
  background: var(--vscode-button-background);
  color: var(--vscode-button-foreground);
  border-radius: 3px;
  cursor: pointer;
}
.seq-btn:disabled {
  opacity: 0.6;
  cursor: default;
}
.seq-slider {
  flex: 4;
}
.seq-label {
  min-width: 70px;
  text-align: right;
  font-size: 11px;
}

#three-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.loading {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 1000;
}

.spinner {
  border: 4px solid var(--vscode-progressBar-background);
  border-top: 4px solid var(--vscode-progressBar-foreground);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 2s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.error {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: var(--vscode-inputValidation-errorBackground);
  border: 1px solid var(--vscode-inputValidation-errorBorder);
  border-radius: 4px;
  padding: 20px;
  max-width: 400px;
  text-align: center;
  z-index: 1000;
}

.error h3 {
  margin-top: 0;
  color: var(--vscode-errorForeground);
}

.error-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 12px;
}

.error-header h3 {
  margin: 0;
  flex: 1;
  line-height: 1.4;
}

.error-close-btn {
  background: var(--vscode-button-secondaryBackground);
  border: 1px solid var(--vscode-button-border);
  color: var(--vscode-button-secondaryForeground);
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  padding: 4px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.error-close-btn:hover {
  background-color: var(--vscode-button-secondaryHoverBackground);
  transform: scale(1.1);
}

.error-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.error-copy-btn {
  background: var(--vscode-button-secondaryBackground);
  border: 1px solid var(--vscode-button-border);
  color: var(--vscode-button-secondaryForeground);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.error-copy-btn:hover {
  background-color: var(--vscode-button-secondaryHoverBackground);
  transform: scale(1.1);
}

.hidden {
  display: none !important;
}

/* Main UI Panel */
.main-ui-panel {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: var(--vscode-sideBar-background);
  border: 1px solid var(--vscode-sideBar-border);
  border-radius: 6px;
  width: 300px;
  z-index: 100;
  font-size: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

/* Tab Navigation */
.tab-navigation {
  display: flex;
  background-color: var(--vscode-tab-inactiveBackground);
  border-bottom: 1px solid var(--vscode-sideBar-border);
}

.tab-button {
  flex: 1;
  background: none;
  border: none;
  padding: 8px 12px;
  font-size: 11px;
  color: var(--vscode-tab-inactiveForeground);
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}

.tab-button:hover {
  background-color: var(--vscode-tab-hoverBackground);
  color: var(--vscode-tab-hoverForeground);
}

.tab-button.active {
  background-color: var(--vscode-tab-activeBackground);
  color: var(--vscode-tab-activeForeground);
  border-bottom-color: var(--vscode-tab-activeBorder);
}

/* Tab Content */
.tab-content {
  max-height: 70vh;
  overflow-y: auto;
}

.tab-panel {
  display: none;
  padding: 16px;
}

.tab-panel.active {
  display: block;
}

/* Panel Sections */
.panel-section {
  margin-bottom: 20px;
  border-bottom: 1px solid var(--vscode-sideBar-border);
  padding-bottom: 16px;
}

.panel-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.panel-section h4 {
  margin: 0 0 12px 0;
  font-size: 13px;
  color: var(--vscode-sideBarTitle-foreground);
  font-weight: 600;
}

/* Control Buttons */
.control-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-button {
  background-color: var(--vscode-button-secondaryBackground);
  color: var(--vscode-button-secondaryForeground);
  border: 1px solid var(--vscode-button-border);
  border-radius: 3px;
  padding: 6px 10px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.control-button:hover {
  background-color: var(--vscode-button-secondaryHoverBackground);
  border-color: var(--vscode-button-hoverBorder);
}

.control-button.active {
  background-color: var(--vscode-button-background);
  color: var(--vscode-button-foreground);
  border-color: var(--vscode-button-border);
}

.setting-description {
  font-size: 10px;
  color: var(--vscode-descriptionForeground);
  margin: 8px 0 0 0;
  line-height: 1.3;
  font-style: italic;
}

.button-shortcut {
  background-color: var(--vscode-badge-background);
  color: var(--vscode-badge-foreground);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: monospace;
  font-size: 9px;
  font-weight: 500;
  margin-left: 8px;
  flex-shrink: 0;
}

/* File Management */
.file-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.primary-button {
  background-color: var(--vscode-button-background);
  color: var(--vscode-button-foreground);
  border: none;
  border-radius: 3px;
  padding: 8px 12px;
  font-size: 11px;
  cursor: pointer;
  transition: background-color 0.2s;
  flex: 1;
}

.primary-button:hover {
  background-color: var(--vscode-button-hoverBackground);
}

/* File List */
#file-list {
  margin-bottom: 16px;
  max-height: 300px;
  overflow-y: auto;
}

.file-item {
  background-color: var(--vscode-list-hoverBackground);
  border: 1px solid var(--vscode-sideBar-border);
  border-radius: 4px;
  margin-bottom: 8px;
  padding: 8px;
  font-size: 11px;
}

.file-item-main {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.file-item input[type='checkbox'] {
  margin: 0;
  cursor: pointer;
}

.color-indicator {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}

.file-name {
  cursor: pointer;
  flex-grow: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.file-info {
  color: var(--vscode-descriptionForeground);
  font-size: 10px;
  margin-bottom: 6px;
}

.remove-file {
  background-color: var(--vscode-button-secondaryBackground);
  color: var(--vscode-button-secondaryForeground);
  border: 1px solid var(--vscode-button-border);
  border-radius: 2px;
  padding: 2px 6px;
  font-size: 10px;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-left: 4px;
}

.remove-file:hover {
  background-color: var(--vscode-button-secondaryHoverBackground);
}

/* Transform Section */
.transform-section {
  margin: 8px 0;
}

.transform-toggle {
  background-color: var(--vscode-button-secondaryBackground);
  color: var(--vscode-button-secondaryForeground);
  border: 1px solid var(--vscode-button-border);
  border-radius: 3px;
  padding: 6px 10px;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 6px;
}

.transform-toggle:hover {
  background-color: var(--vscode-button-secondaryHoverBackground);
}

.toggle-icon {
  font-size: 8px;
  transition: transform 0.2s ease;
}

.transform-panel {
  background-color: var(--vscode-editor-background);
  border: 1px solid var(--vscode-sideBar-border);
  border-radius: 3px;
  padding: 8px;
  margin-top: 4px;
  font-size: 10px;
}

.transform-group {
  margin-bottom: 8px;
}

.transform-group:last-child {
  margin-bottom: 0;
}

.transform-group label {
  display: block;
  margin-bottom: 4px;
  color: var(--vscode-sideBarTitle-foreground);
}

.transform-buttons {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.transform-buttons button {
  background-color: var(--vscode-button-secondaryBackground);
  color: var(--vscode-button-secondaryForeground);
  border: 1px solid var(--vscode-button-border);
  border-radius: 2px;
  padding: 3px 6px;
  font-size: 9px;
  cursor: pointer;
  margin: 0;
  transition: background-color 0.2s;
  flex: 1;
  min-width: 0;
}

.transform-buttons button:hover {
  background-color: var(--vscode-button-secondaryHoverBackground);
}

.transform-panel textarea {
  width: 100%;
  font-size: 9px;
  font-family: monospace;
  background-color: var(--vscode-input-background);
  color: var(--vscode-input-foreground);
  border: 1px solid var(--vscode-input-border);
  border-radius: 2px;
  padding: 4px;
  margin: 4px 0;
  resize: vertical;
  min-height: 60px;
}

.transform-panel textarea:focus {
  outline: 1px solid var(--vscode-focusBorder);
  border-color: var(--vscode-focusBorder);
}

/* Point Size Control */
.point-size-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  font-size: 10px;
}

.point-size-control label {
  min-width: 60px;
  color: var(--vscode-descriptionForeground);
}

.size-slider {
  flex: 1;
  height: 6px;
  background: var(--vscode-progressBar-background);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--vscode-progressBar-foreground);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--vscode-progressBar-background);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.size-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--vscode-progressBar-foreground);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--vscode-progressBar-background);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.size-slider::-webkit-slider-track {
  background: var(--vscode-progressBar-background);
  border-radius: 3px;
  height: 6px;
}

.size-slider::-moz-range-track {
  background: var(--vscode-progressBar-background);
  border-radius: 3px;
  height: 6px;
  border: none;
}

.size-value {
  min-width: 40px;
  text-align: right;
  font-family: monospace;
  font-size: 9px;
  color: var(--vscode-descriptionForeground);
}

/* Color Control */
.color-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  font-size: 10px;
}

.color-control label {
  min-width: 40px;
  color: var(--vscode-descriptionForeground);
}

.color-selector {
  flex: 1;
  background-color: var(--vscode-input-background);
  color: var(--vscode-input-foreground);
  border: 1px solid var(--vscode-input-border);
  border-radius: 2px;
  padding: 3px 6px;
  font-size: 10px;
}

.color-selector:focus {
  outline: 1px solid var(--vscode-focusBorder);
  border-color: var(--vscode-focusBorder);
}

/* Shortcuts List */
.shortcuts-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shortcut-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
}

.shortcut-key {
  background-color: var(--vscode-badge-background);
  color: var(--vscode-badge-foreground);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: monospace;
  font-size: 9px;
  font-weight: 500;
}

.shortcut-desc {
  color: var(--vscode-descriptionForeground);
  text-align: right;
}

/* Statistics */
#file-stats {
  margin-bottom: 16px;
  line-height: 1.4;
  font-size: 11px;
}

/* Responsive design */
@media (max-width: 768px) {
  .main-ui-panel {
    position: fixed;
    top: auto;
    bottom: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
    max-height: 50vh;
  }

  .tab-content {
    max-height: 40vh;
  }

  .control-buttons {
    flex-direction: row;
    flex-wrap: wrap;
  }

  /* Keep camera conventions on their own row */
  .control-buttons.camera-conventions {
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
  }

  .control-buttons.camera-conventions .control-button {
    flex: 1;
    margin: 0 2px;
    min-width: 0;
  }

  .control-button {
    flex: 1;
    min-width: 80px;
  }

  #file-list {
    max-height: 200px;
  }
}

/* Legacy support for old info-panel class */
.info-panel {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: var(--vscode-sideBar-background);
  border: 1px solid var(--vscode-sideBar-border);
  border-radius: 4px;
  padding: 16px;
  max-width: 250px;
  z-index: 100;
  font-size: 12px;
}

.info-panel h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: var(--vscode-sideBarTitle-foreground);
}

.info-panel #file-stats {
  margin-bottom: 16px;
  line-height: 1.4;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.controls button {
  background-color: var(--vscode-button-background);
  color: var(--vscode-button-foreground);
  border: none;
  border-radius: 2px;
  padding: 6px 12px;
  font-size: 11px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.controls button:hover {
  background-color: var(--vscode-button-hoverBackground);
}

.controls button:active {
  background-color: var(--vscode-button-secondaryBackground);
}

#toggle-colors {
  background-color: var(--vscode-button-secondaryBackground);
  color: var(--vscode-button-secondaryForeground);
  border: 1px solid var(--vscode-button-border);
  border-radius: 2px;
  cursor: pointer;
  transition: background-color 0.2s;
  width: 100%;
}

#toggle-colors:hover {
  background-color: var(--vscode-button-secondaryHoverBackground);
}

.no-files {
  text-align: center;
  color: var(--vscode-descriptionForeground);
  font-style: italic;
  padding: 20px;
}

.loading .loading-detail {
  font-size: 12px;
  color: var(--vscode-descriptionForeground);
  margin-top: 8px;
}

/* Camera Controls Sections */
.camera-controls-section {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--vscode-sideBar-border);
}

.camera-controls-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Camera control buttons spacing */
.camera-controls-section .control-button {
  margin-bottom: 4px;
}

.camera-controls-section .control-button:last-child {
  margin-bottom: 0;
}

/* Depth Control Groups */
.depth-control-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.depth-control-group label {
  font-size: 11px;
  font-weight: bold;
  color: var(--vscode-sideBarTitle-foreground);
}

.depth-control-group select,
.depth-control-group input[type='number'] {
  background-color: var(--vscode-input-background);
  color: var(--vscode-input-foreground);
  border: 1px solid var(--vscode-input-border);
  border-radius: 3px;
  padding: 4px 6px;
  font-size: 11px;
  font-family: inherit;
}

.depth-control-group select:focus,
.depth-control-group input[type='number']:focus {
  outline: none;
  border-color: var(--vscode-focusBorder);
  box-shadow: 0 0 0 1px var(--vscode-focusBorder);
}

.depth-control-group select:hover,
.depth-control-group input[type='number']:hover {
  border-color: var(--vscode-input-activeBorder);
}

.matrix-display {
  background-color: var(--vscode-editor-background);
  border: 1px solid var(--vscode-input-border);
  border-radius: 3px;
  padding: 6px;
  margin: 4px 0;
}

/* Modal Dialog */
.matrix-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.matrix-modal {
  background-color: var(--vscode-sideBar-background);
  border: 1px solid var(--vscode-sideBar-border);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
}

.matrix-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--vscode-sideBar-border);
  background-color: var(--vscode-tab-activeBackground);
}

.matrix-modal-header h4 {
  margin: 0;
  font-size: 14px;
  color: var(--vscode-tab-activeForeground);
}

.close-modal {
  background: none;
  border: none;
  color: var(--vscode-tab-activeForeground);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  transition: background-color 0.2s;
}

.close-modal:hover {
  background-color: var(--vscode-tab-hoverBackground);
}

.matrix-modal-content {
  padding: 16px;
}

.matrix-modal-content textarea {
  width: 100%;
  font-size: 10px;
  font-family: monospace;
  background-color: var(--vscode-input-background);
  color: var(--vscode-input-foreground);
  border: 1px solid var(--vscode-input-border);
  border-radius: 3px;
  padding: 8px;
  resize: vertical;
  min-height: 120px;
}

.matrix-modal-content textarea:focus {
  outline: 1px solid var(--vscode-focusBorder);
  border-color: var(--vscode-focusBorder);
}

.matrix-modal-footer {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--vscode-sideBar-border);
  background-color: var(--vscode-editor-background);
}

.matrix-modal-footer .primary-button,
.matrix-modal-footer .secondary-button {
  flex: 1;
  padding: 8px 16px;
  font-size: 12px;
}

/* Shortcuts Hints */
.shortcuts-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  font-size: 10px;
  color: var(--vscode-descriptionForeground);
  align-items: center;
}

.shortcut-hint {
  background-color: var(--vscode-badge-background);
  color: var(--vscode-badge-foreground);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: monospace;
  font-size: 9px;
  font-weight: 500;
  margin-right: 4px;
}

/* TIF Controls Styles */
.input-group {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  gap: 8px;
}

.input-group label {
  min-width: 120px;
  font-size: 11px;
  color: var(--vscode-foreground);
}

.input-group input[type='number'],
.input-group select {
  background-color: var(--vscode-input-background);
  color: var(--vscode-input-foreground);
  border: 1px solid var(--vscode-input-border);
  border-radius: 3px;
  padding: 4px 8px;
  font-size: 11px;
  min-width: 80px;
  flex: 1;
}

.input-group input[type='number']:focus,
.input-group select:focus {
  outline: 1px solid var(--vscode-focusBorder);
  border-color: var(--vscode-focusBorder);
}

.input-group input[type='file'] {
  font-size: 11px;
  color: var(--vscode-foreground);
  flex: 1;
}

.camera-params-controls,
.color-mapping-controls {
  background-color: var(--vscode-editor-inactiveSelectionBackground);
  border-radius: 4px;
  padding: 8px;
  margin-bottom: 8px;
}

.status-text {
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 3px;
  margin-top: 4px;
}

.status-text.success {
  background-color: var(--vscode-terminal-ansiGreen);
  color: var(--vscode-terminal-background);
}

.status-text.error {
  background-color: var(--vscode-errorForeground);
  color: var(--vscode-terminal-background);
}

.status-text.warning {
  background-color: var(--vscode-warningForeground);
  color: var(--vscode-terminal-background);
}

/* Theme Selector */
.control-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.control-group label {
  font-size: 11px;
  font-weight: bold;
  color: var(--vscode-foreground);
}

.control-input {
  background-color: var(--vscode-input-background);
  color: var(--vscode-input-foreground);
  border: 1px solid var(--vscode-input-border);
  border-radius: 3px;
  padding: 4px 8px;
  font-size: 11px;
  min-width: 0;
  flex: 1;
}

.control-input:focus {
  outline: 1px solid var(--vscode-focusBorder);
  border-color: var(--vscode-focusBorder);
}

.control-input:hover {
  border-color: var(--vscode-input-activeBorder);
}

.switch-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  cursor: pointer;
}

.control-label {
  color: var(--vscode-foreground);
}

/* Bottom right navigation buttons */
.bottom-right-nav {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 8px;
  z-index: 100;
}

.nav-button {
  background-color: transparent;
  color: var(--vscode-descriptionForeground);
  border: none;
  padding: 2px 4px;
  border-radius: 2px;
  text-decoration: none;
  font-size: 10px;
  font-weight: 400;
  transition: all 0.2s ease;
  cursor: pointer;
  opacity: 0.7;
}

.nav-button:hover {
  background-color: var(--vscode-button-secondaryHoverBackground);
  color: var(--vscode-button-secondaryForeground);
  text-decoration: none;
  opacity: 1;
}

.nav-button:active {
  background-color: var(--vscode-button-background);
  color: var(--vscode-button-foreground);
}
