html {
  overflow-x: hidden;
}

body {
  font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #1e1e2e 0%, #2d2d44 50%, #1a1a2e 100%);
  background-attachment: fixed;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  padding-left: 0 !important;
  margin-left: 0 !important;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

/* AGGRESSIVE FIX: Global select styling - solid colors to prevent white on white */
select {
  color: #ffffff !important;
  background-color: #1e1e2e !important;
}

/* AGGRESSIVE FIX: All options MUST have dark background - override everything */
select option {
  background-color: #1e1e2e !important;
  background: #1e1e2e !important;
  color: #ffffff !important;
  padding: 8px 12px !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
}

/* AGGRESSIVE FIX: Default state - dark background */
select option:not(:checked):not([selected]):not(:hover) {
  background-color: #1e1e2e !important;
  background: #1e1e2e !important;
  color: #ffffff !important;
}

/* AGGRESSIVE FIX: Hover MUST be dark blue - highest priority - comes before checked */
select option:hover {
  background-color: #0066cc !important;
  background: #0066cc !important;
  color: #ffffff !important;
}

/* AGGRESSIVE FIX: Unselected hover - MUST be visible */
select option:hover:not(:checked):not([selected]) {
  background-color: #0066cc !important;
  background: #0066cc !important;
  color: #ffffff !important;
}

/* AGGRESSIVE FIX: Selected state */
select option:checked,
select option[selected] {
  background: var(--primary-gradient, linear-gradient(135deg, #00d4ff 0%, #5b9fff 100%)) !important;
  background-color: #0066cc !important;
  color: #ffffff !important;
}

/* AGGRESSIVE FIX: Selected + hover - MUST override hover rule */
select option:checked:hover,
select option[selected]:hover {
  background: var(--primary-gradient-hover, linear-gradient(135deg, #00e5ff 0%, #6ba8ff 100%)) !important;
  background-color: #0088ff !important;
  color: #ffffff !important;
}

/* Additional rules to override any browser defaults that might cause white backgrounds */
select option[value=""],
select option:empty {
  background-color: rgba(30, 30, 46, 0.95) !important;
  background: rgba(30, 30, 46, 0.95) !important;
  color: #fff !important;
}

/* SIMPLIFIED: All specific selects inherit from global rules above - no need for duplicates */

/* Force dark background for all option states */
select option:not(:checked):not([selected]):not(:hover) {
  background-color: rgba(30, 30, 46, 0.95) !important;
  background: rgba(30, 30, 46, 0.95) !important;
  color: #fff !important;
}

.container {
  display: flex;
  flex: 1;
  padding: 20px;
}

.sidebar {
  width: 350px;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0 !important;
  margin-left: 0 !important;
  transform: none !important;
  background: rgba(30, 30, 46, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 20px;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3), inset -1px 0 0 rgba(255, 255, 255, 0.05);
  overflow-x: hidden;
  overflow-y: auto;
  z-index: 100;
}

/* Docker/Server mode: same layout fix + menu bar offset */
body.server-mode {
  overflow-x: hidden;
  padding-left: 0 !important;
  margin-left: 0 !important;
}
html.server-mode {
  overflow-x: hidden;
}
body.server-mode .sidebar {
  left: 0 !important;
  top: 30px !important;
  height: calc(100vh - 30px) !important;
  transform: none !important;
  margin-left: 0 !important;
}

#logo {
  width: 65%;
  height: auto;
  margin-bottom: -35px;
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 15px;
  width: 85%;
  padding: 0 20px;
}

.form-group label {
  margin-bottom: 8px;
  text-align: left;
  font-weight: 500;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.02em;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  color: #fff;
  transition: all 0.3s ease;
  font-size: 14px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 40px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-accent, #00d4ff);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), 0 4px 12px var(--primary-shadow, rgba(0, 212, 255, 0.2));
}

/* Model name field - text input without dropdown arrow, match filter section width */
#model-name {
  background-image: none !important;
  padding-right: 16px !important;
  max-width: 240px; /* Match filter section width */
  width: auto;
}

/* Notes input container */
.notes-input-container {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

.notes-input-container textarea {
  flex: 1;
  width: calc(100% - 48px);
  max-width: calc(100% - 48px);
  max-height: 150px;
  min-height: 80px;
  overflow-y: auto;
  resize: vertical;
  box-sizing: border-box;
  background-image: none !important;
  padding-right: 16px !important;
}

.notes-input-container .icon-button {
  flex-shrink: 0;
  margin-top: 0;
}

.form-group select {
  color: #fff !important;
}

/* SIMPLIFIED: .form-group select options inherit from global select option rules */

.input-with-icon {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 85%;
  position: relative;
  overflow: visible;
}

.input-with-icon input {
  padding: 12px 50px 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  color: #fff;
  transition: all 0.3s ease;
  flex: 1;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  position: relative;
}

.input-with-icon:has(.icon-button:nth-of-type(2):not(.hidden)) input {
  padding-right: 90px;
}

.input-with-icon:has(.icon-button:nth-of-type(2).hidden) input,
.input-with-icon:not(:has(.icon-button:nth-of-type(2):not(.hidden))) input {
  padding-right: 50px;
}

.input-with-icon input:focus {
  outline: none;
  border-color: #00d4ff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), 0 4px 12px rgba(0, 212, 255, 0.2);
}

.input-with-icon .icon-button {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  min-width: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  opacity: 0.8;
  transition: all 0.3s ease;
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  margin: 0;
}

.input-with-icon .icon-button:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(0, 150, 200, 0.5);
  transform: translateY(-50%) scale(1.05);
}

.input-with-icon .icon-button:first-of-type:not(:only-of-type) {
  right: 44px;
}

.input-with-icon .icon-button:only-of-type {
  right: 4px;
}

.input-with-icon .icon-button:nth-of-type(2) {
  right: 4px;
  z-index: 11;
}

/* When clear button is hidden, adjust search button position */
.input-with-icon:has(.icon-button:nth-of-type(2).hidden) .icon-button:first-of-type,
.input-with-icon:not(:has(.icon-button:nth-of-type(2):not(.hidden))) .icon-button:first-of-type {
  right: 4px !important;
}

.input-with-icon .icon-button.hidden {
  display: none !important;
}

.path-tree-container {
  width: 100%;
  max-width: 240px; /* Match filter section width */
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  color: #fff;
  font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 12px;
  line-height: 1.5;
  max-height: 200px;
  overflow-y: auto;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.path-tree-container:focus-within {
  border-color: #00d4ff;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.path-tree-item {
  display: flex;
  align-items: center;
  padding: 0;
  user-select: none;
  white-space: nowrap;
}

.path-tree-indent {
  display: inline-block;
  width: 16px;
  height: 20px;
  flex-shrink: 0;
  position: relative;
}

.path-tree-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 2px;
  flex-shrink: 0;
  vertical-align: middle;
}

.path-tree-folder-icon {
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23FFC107' d='M2 3h5l1 2h6v9H2V3z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  display: inline-block;
}

.path-tree-file-icon {
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23FFFFFF' d='M3 2h8l3 3v9H3V2zm1 1v10h10V6H9V3H4z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  display: inline-block;
}

.path-tree-folder {
  cursor: pointer;
  color: #fff;
  text-decoration: none;
  transition: background-color 0.15s;
  display: inline-flex;
  align-items: center;
  padding: 0;
  border-radius: 2px;
  flex: 1;
}

.path-tree-folder:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.path-tree-file {
  color: #fff;
  cursor: default;
  display: inline-flex;
  align-items: center;
  flex: 1;
}

button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 90%;
  padding: 12px 24px;
  margin-bottom: 10px;
  background: var(--primary-gradient, linear-gradient(135deg, #00d4ff 0%, #5b9fff 100%));
  color: white;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px var(--primary-shadow, rgba(91, 159, 255, 0.3));
  position: relative;
  overflow: hidden;
  text-align: center;
  line-height: 1.4;
}

button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

button:hover::before {
  left: 100%;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-shadow-hover, rgba(91, 159, 255, 0.4));
  background: var(--primary-gradient-hover, linear-gradient(135deg, #00e5ff 0%, #6ba8ff 100%));
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.model-details {
  margin-top: 20px;
  width: 100%;
  max-width: none; /* Allow full width expansion */
  background: color-mix(in srgb, var(--model-background-color) 25%, transparent);
  padding: 20px 0;
  border-top: 1px solid #444;
  border-bottom: 1px solid #444;
}

/* ============================================
   MODEL DETAILS DROPDOWN SIZING - REFACTORED
   ============================================ */

/* Container for model details dropdowns - match filter section width */
.model-details .designer-input-container {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  max-width: 240px !important; /* Match filter section width */
  gap: 6px !important;
  box-sizing: border-box !important;
}

/* Model details dropdowns - account for list button (28px) + gap (6px) + add button (28px) + gap (6px) = 68px */
.model-details .designer-input-container select,
.model-details #model-designer,
.model-details #model-parent,
.model-details #model-license {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: auto !important;
  max-width: calc(240px - 68px) !important; /* Container width minus both buttons and gaps */
  margin: 0 !important;
  box-sizing: border-box !important;
}

/* Override form-group select width for model details */
.model-details .form-group .designer-input-container select,
.model-details .form-group #model-designer,
.model-details .form-group #model-parent,
.model-details .form-group #model-license {
  width: auto !important; /* Override .form-group select { width: 100% } */
  max-width: calc(240px - 68px) !important; /* Match the container max-width minus button space */
}

/* ============================================
   MODEL DETAILS SOURCE FIELD SIZING - REFACTORED
   ============================================ */

/* Source field container in model details - match filter section width */
.model-details .input-with-icon {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  max-width: 240px !important; /* Match filter section width */
  gap: 8px !important;
  box-sizing: border-box !important;
  position: relative !important;
}

/* Source input field - account for open button (36px) + gap (8px) = 44px */
.model-details .input-with-icon input,
.model-details #model-source {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: auto !important;
  max-width: calc(240px - 44px) !important; /* Container width minus button and gap */
  box-sizing: border-box !important;
}

/* ============================================
   MODEL DETAILS TAGS DROPDOWN SIZING - REFACTORED
   ============================================ */

/* Tags container in model details - match filter section width */
.model-details .tags-container {
  width: 100% !important;
  max-width: 240px !important; /* Match filter section width */
}

/* Tags input container in model details - match filter section width */
.model-details .tags-input-container {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  max-width: 240px !important; /* Match filter section width */
  gap: 6px !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

/* Tags dropdown in model details - account for list button (28px) + gap (6px) + add button (28px) + gap (6px) = 68px */
.model-details .tags-input-container select,
.model-details #tag-select {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: auto !important;
  max-width: calc(240px - 68px) !important; /* Container width minus both buttons and gaps */
  margin: 0 !important;
  box-sizing: border-box !important;
}

.model-details h3 {
  padding: 0 20px;
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
}

.model-details div {
  margin-bottom: 10px;
}

.checkbox-container {
  display: flex;
  flex-direction: row !important;
  align-items: center;
  width: 100%;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 15px;
  margin-left: 0;
}

.checkbox-container label {
  margin: 0;
  cursor: default;
  flex: 1;
  pointer-events: none;
}

.checkbox-container input[type="checkbox"] {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  margin: 0;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  pointer-events: auto;
  -webkit-appearance: checkbox;
  -moz-appearance: checkbox;
  appearance: checkbox;
}

/* Override form-group column layout for checkbox containers */
.form-group.checkbox-container {
  flex-direction: row !important;
}

.form-group.checkbox-container label {
  margin-bottom: 0;
}

/* STL Home: checkbox row – only checkbox + label in one row; native checkbox look, themed size */
.stl-home-path-metadata-checkbox-row {
  margin-bottom: 0.5rem;
}
#stl-home-dialog #stl-home-path-metadata-enabled,
#stl-home-dialog #stl-home-use-designer,
#stl-home-dialog #stl-home-use-parent-model {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  -webkit-appearance: checkbox;
  -moz-appearance: checkbox;
  appearance: checkbox;
  accent-color: var(--primary-accent, #00d4ff);
  cursor: pointer;
  pointer-events: auto;
}
#stl-home-dialog .stl-home-path-metadata-checkbox-row label {
  cursor: pointer;
  pointer-events: auto;
}
/* Ensure main Enable row is always clickable (Docker/server mode) */
#stl-home-dialog #stl-home-path-metadata-group > .checkbox-container:first-of-type {
  pointer-events: auto;
}

/* STL Home: directory row – input + smaller Choose/Clear buttons side by side */
.stl-home-dir-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.stl-home-dir-row #stl-home-directory {
  flex: 1;
  min-width: 0;
}
.stl-home-dir-buttons {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
.stl-home-dir-buttons .primary-button,
.stl-home-dir-buttons .secondary-button {
  padding: 6px 14px;
  font-size: 13px;
  white-space: nowrap;
}

/* STL Home: Designer and Parent model in columns side by side */
.path-metadata-indices {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  flex-wrap: wrap;
}
.path-metadata-indices .path-metadata-col {
  flex: 1;
  min-width: 140px;
  margin-bottom: 0;
}
.path-metadata-indices .path-metadata-col input[type="number"] {
  width: 4rem;
}

/* STL Home: path metadata options block – consistent spacing under Enable checkbox */
#stl-home-dialog .stl-home-path-metadata-options {
  margin-top: 0.75rem;
  margin-left: 0;
  text-align: left;
}

/* STL Home: path direction row – label above select, same pattern as Folder level rows */
#stl-home-dialog .stl-home-path-direction-row {
  margin-bottom: 0.75rem;
  max-width: 14rem;
}
#stl-home-dialog .stl-home-path-direction-row label {
  display: block;
  margin-bottom: 6px;
  text-align: left;
}
#stl-home-dialog .stl-home-path-direction-row select {
  width: 100%;
  min-width: 0;
}

/* STL Home: path direction description paragraphs – align with direction row */
#stl-home-dialog .stl-home-path-metadata-options .stl-home-path-direction-desc {
  margin-top: 0;
}

/* STL Home: gray out options when "Enable" is unchecked */
.stl-home-path-metadata-options.grayed {
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
}

/* Example path in STL Home dialog */
#stl-home-dialog .path-example {
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: 0.95em;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}
.stl-home-path-metadata-options.grayed .path-example {
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.04);
}

/* STL Home dialog: ensure Cancel/Save buttons are clickable in Docker/server (browser) mode */
#stl-home-dialog .dialog-buttons {
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

/* File Type Settings dialog: ensure Save/Cancel buttons are clickable in Docker/server mode */
#file-type-settings-dialog .dialog-buttons {
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

/* Purge Models dialog: ensure Purge/Cancel buttons are clickable in Docker/server mode */
#purge-models-dialog .dialog-buttons {
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

/* Docker/Server mode: ensure ALL modal dialog buttons and fullscreen toggles are clickable */
.modal .dialog-buttons,
.modal .modal-fullscreen-toggle,
.modal .dialog-buttons button {
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

/* Additional file types grid in File Type Settings */
.scan-file-types-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 24px;
  width: 100%;
  max-width: 100%;
  margin-top: 8px;
  margin-bottom: 0;
  padding: 0;
}

.scan-file-type-option {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 6px 0;
  cursor: pointer;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  user-select: none;
}

.scan-file-type-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--primary-accent, #00d4ff);
}

.scan-file-type-option span {
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

main {
  position: relative;
}

/* Grid view selector background - full width element */
.grid-view-selector-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  min-height: calc(15px + 40px + 15px); /* padding-top + button height + padding-bottom */
  padding: 15px 0;
  background: rgba(30, 30, 46, 0.6);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 0;
  pointer-events: none;
  box-sizing: border-box;
}

/* Grid view selector */
.grid-view-selector {
  position: relative;
  display: flex;
  gap: 10px;
  padding: 15px 20px;
  margin-left: 370px;
  width: calc(100% - 390px);
  background: transparent;
  z-index: 1;
  box-sizing: border-box;
}

.view-button {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.view-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(0, 150, 200, 0.5);
  transform: translateY(-1px);
}

.view-button.active {
  background: var(--primary-gradient, linear-gradient(135deg, #00d4ff 0%, #5b9fff 100%));
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px var(--primary-shadow, rgba(91, 159, 255, 0.3));
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  row-gap: 32px;
  padding: 20px 24px;
  margin-left: 370px;
  width: calc(100% - 390px);
  max-width: calc(100vw - 390px);
  box-sizing: border-box;
  overflow: visible;
  animation: fadeIn 0.5s ease-out;
  /* Subtle hexagon pattern background matching theme - default cyan */
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='52' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l26 15v30l-26 15-26-15V15z' fill='none' stroke='rgba(0,212,255,0.04)' stroke-width='0.5'/%3E%3Cpath d='M0 26l30-15 30 15M0 26l30 15 30-15' fill='none' stroke='rgba(0,212,255,0.04)' stroke-width='0.5'/%3E%3C/svg%3E");
  background-size: 60px 52px;
  background-position: 0 0;
  position: relative;
}

/* Theme-aware hexagon pattern */
[data-theme="modern-purple"] .file-grid {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='52' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l26 15v30l-26 15-26-15V15z' fill='none' stroke='rgba(168,85,247,0.04)' stroke-width='0.5'/%3E%3Cpath d='M0 26l30-15 30 15M0 26l30 15 30-15' fill='none' stroke='rgba(168,85,247,0.04)' stroke-width='0.5'/%3E%3C/svg%3E");
}

[data-theme="modern-green"] .file-grid {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='52' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l26 15v30l-26 15-26-15V15z' fill='none' stroke='rgba(74,222,128,0.04)' stroke-width='0.5'/%3E%3Cpath d='M0 26l30-15 30 15M0 26l30 15 30-15' fill='none' stroke='rgba(74,222,128,0.04)' stroke-width='0.5'/%3E%3C/svg%3E");
}

[data-theme="modern-orange"] .file-grid {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='52' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l26 15v30l-26 15-26-15V15z' fill='none' stroke='rgba(251,146,60,0.04)' stroke-width='0.5'/%3E%3Cpath d='M0 26l30-15 30 15M0 26l30 15 30-15' fill='none' stroke='rgba(251,146,60,0.04)' stroke-width='0.5'/%3E%3C/svg%3E");
}

[data-theme="modern-pink"] .file-grid {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='52' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l26 15v30l-26 15-26-15V15z' fill='none' stroke='rgba(244,114,182,0.04)' stroke-width='0.5'/%3E%3Cpath d='M0 26l30-15 30 15M0 26l30 15 30-15' fill='none' stroke='rgba(244,114,182,0.04)' stroke-width='0.5'/%3E%3C/svg%3E");
}

[data-theme="dark-minimal"] .file-grid {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='52' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l26 15v30l-26 15-26-15V15z' fill='none' stroke='rgba(156,163,175,0.03)' stroke-width='0.5'/%3E%3Cpath d='M0 26l30-15 30 15M0 26l30 15 30-15' fill='none' stroke='rgba(156,163,175,0.03)' stroke-width='0.5'/%3E%3C/svg%3E");
}

/* List view styles - Windows File Explorer style - Optimized */
.file-item-list {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start;
  padding: 8px 16px !important;
  height: 56px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin: 0 0 6px 0;
  box-sizing: border-box;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(10px);
  border-radius: 12px;
}

.file-item-list:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 212, 255, 0.1);
}

.file-item-list .thumbnail-container {
  flex-shrink: 0 !important;
  width: 60px !important;
  height: 48px !important;
  margin-right: 12px !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  z-index: 0;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: var(--model-background-color, #070147);
  align-self: center !important;
}

.file-item-list .thumbnail-container img {
  max-width: 48px;
  max-height: 48px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0;
}

.file-item-list .print-status {
  position: static !important;
  display: inline-block;
  background: rgba(0, 0, 0, 0.5);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.file-item-list .print-status:hover {
  background: rgba(0, 0, 0, 0.75);
  transform: scale(1.05);
}

.file-item-list .print-status.printed {
  background: rgba(46, 204, 113, 0.6);
}

.file-item-list .print-status.printed:hover {
  background: rgba(46, 204, 113, 0.85);
}

.file-item-list .archive-status {
  position: static !important;
  display: inline-block;
  background: rgba(255, 152, 0, 0.6);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  color: #fff;
}

.file-item-list .file-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  overflow: visible;
}

.file-item-list .file-name {
  font-size: 13px;
  flex-shrink: 0;
  width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
  white-space: nowrap;
  margin: 0;
}

.file-item-list .file-name.zip-file {
  color: #4ade80 !important;
}

.file-item-list .file-size-column {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: monospace;
}

.file-item-list .directory-info-column,
.file-item-list .designer-info-column {
  display: flex;
  align-items: center;
  overflow: hidden;
}

.file-item-list .tags-info-column {
  display: flex;
  align-items: center;
  overflow: visible;
  flex-shrink: 1;
  min-width: 160px;
}

.file-item-list .directory-info-column svg,
.file-item-list .designer-info-column svg,
.file-item-list .print-status-column svg,
.file-item-list .archive-status-column svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.file-item-list .print-status-column,
.file-item-list .archive-status-column {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* List view header styles */
.list-view-header {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 12px;
  padding: 12px 16px !important;
  height: 44px !important;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  background: rgba(30, 30, 46, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  position: sticky;
  top: -10px !important;
  z-index: 10;
  margin-bottom: 6px;
  box-sizing: border-box;
  border-radius: 12px 12px 0 0;
}

.list-view-header svg {
  opacity: 0.6;
}

/* Sortable header styles */
.list-view-header .sortable-header {
  transition: color 0.2s ease, background-color 0.2s ease;
  padding: 2px 4px;
  border-radius: 4px;
}

.list-view-header .sortable-header:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.list-view-header .sortable-header.sort-active {
  color: #fff !important;
  background-color: rgba(255, 255, 255, 0.15);
}

.list-view-header .sort-indicator {
  font-size: 14px;
  font-weight: bold;
  color: #4a9eff;
  line-height: 1;
  margin-left: 4px;
}

.list-view-header .sortable-header.sort-active .sort-indicator {
  color: #6bb3ff;
}

/* Preview view (formerly Small thumbnail) - Optimized */
.file-item-preview {
  width: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  box-sizing: border-box;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.file-item-preview:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 32px rgba(0, 212, 255, 0.2), 0 4px 16px rgba(0, 0, 0, 0.3);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(0, 150, 200, 0.5);
}

.file-item-preview .thumbnail-container {
  width: 140px !important;
  height: 140px !important;
  border-radius: 6px;
  overflow: hidden;
}

.file-item-preview .file-info {
  width: 100%;
  text-align: center;
  margin-top: 10px;
}

.file-item-preview .file-name {
  font-size: 11px;
  line-height: 1.3;
  max-height: 32px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}


/* Detailed view - large thumbnail with full metadata - Optimized */
.file-item-detailed {
  width: 300px;
  height: 450px !important;
  min-height: 450px !important;
  max-height: 450px !important;
  display: flex;
  flex-direction: column;
  padding: 16px;
  box-sizing: border-box;
  border-radius: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.file-item-detailed:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 32px rgba(0, 212, 255, 0.2), 0 4px 16px rgba(0, 0, 0, 0.3);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(0, 150, 200, 0.5);
}

.file-item-detailed .thumbnail-container {
  width: 276px !important;
  height: 276px !important;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.file-item-detailed .file-name {
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  margin-top: 8px;
  margin-bottom: 6px;
  padding: 4px 8px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  box-sizing: border-box;
  min-height: 24px;
  line-height: 1.3;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  flex-shrink: 0;
}

.file-item-detailed .file-info {
  flex: 0 0 auto; /* Don't grow, don't shrink, auto size - prevents overflow */
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 2px;
  overflow: hidden;
  padding: 0 !important; /* Override all padding from other rules */
  margin: 0;
}

.file-item-detailed .file-details {
  margin: 0;
  padding: 0;
  border-top: none;
  flex: 0 0 auto; /* Don't grow, don't shrink, auto size */
}

.file-item-detailed .metadata-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
  padding: 0;
  width: 100%;
  background: transparent;
  backdrop-filter: none;
  border-radius: 0;
  border: none;
  overflow: visible;
  box-sizing: border-box;
}

.file-item-detailed .metadata-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 2px 0;
  transition: all 0.2s ease;
  min-height: 18px; /* Slightly increased for better readability */
  line-height: 1.3;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 0;
}

.file-item-detailed .metadata-item.tags-item {
  padding-bottom: 8px;
}

.file-item-detailed .metadata-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  word-break: keep-all;
  max-width: 100%;
}

.file-item-detailed .metadata-value.file-size {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: fit-content;
}

.file-item-detailed .metadata-item.directory-item {
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 4px;
  margin: 0;
}

.file-item-detailed .metadata-item.directory-item:hover {
  background: rgba(74, 158, 255, 0.1);
}

.file-item-detailed .metadata-icon {
  font-size: 12px;
  opacity: 0.8;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}

.file-item-detailed .metadata-item.designer-item .metadata-icon {
  filter: hue-rotate(240deg) saturate(1.5) brightness(1.2);
}

.file-item-detailed .metadata-value {
  color: #ccc;
  font-weight: 400;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: keep-all;
}

.file-item-detailed .metadata-value.file-size {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: fit-content;
  max-width: none;
}

.file-item-detailed .metadata-value.directory-link {
  color: #4a9eff;
  font-weight: 500;
  cursor: pointer;
}

/* Fix for dir-size-row: ensure directory can truncate and size is always visible */
.file-item-detailed .metadata-item.dir-size-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 0;
  width: 100%;
}

.file-item-detailed .metadata-item.dir-size-row .directory-part {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  max-width: calc(100% - 80px); /* Reserve space for size */
}

.file-item-detailed .metadata-item.dir-size-row .directory-part .metadata-value.directory-link {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.file-item-detailed .metadata-item.dir-size-row .size-part,
.file-item-detailed .metadata-item.dir-size-row .metadata-value.file-size {
  flex-shrink: 0 !important;
  min-width: fit-content !important;
  margin-left: auto;
  white-space: nowrap;
}

/* Same fix for grid view */
.file-grid .metadata-item.dir-size-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 0;
  width: 100%;
}

.file-grid .metadata-item.dir-size-row .directory-part {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  max-width: calc(100% - 80px); /* Reserve space for size */
}

.file-grid .metadata-item.dir-size-row .directory-part .metadata-value.directory-link {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.file-grid .metadata-item.dir-size-row .size-part,
.file-grid .metadata-item.dir-size-row .metadata-value.file-size {
  flex-shrink: 0 !important;
  min-width: fit-content !important;
  margin-left: auto;
  white-space: nowrap;
}

.file-item-detailed .metadata-item.directory-item:hover .metadata-value.directory-link {
  color: #6bb3ff;
}

.file-item-detailed .metadata-item.clickable-metadata {
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 4px;
  margin: 0;
  transition: background 0.2s ease;
}

.file-item-detailed .metadata-item.clickable-metadata:hover {
  background: rgba(74, 158, 255, 0.1);
}

.file-item-detailed .metadata-item.clickable-metadata:hover .metadata-value {
  color: #4a9eff;
}

.file-item {
  width: 100%;
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.file-item.selected {
  border: 2px solid var(--primary-accent, #00d4ff);
  box-shadow: 0 0 20px var(--primary-shadow-hover, rgba(0, 212, 255, 0.4)), 0 8px 24px rgba(0, 0, 0, 0.3);
  position: relative;
  background: rgba(0, 212, 255, 0.1);
}

.file-item.selected::before {
  display: none; /* Selection check bubble removed; selection still shown via border/outline */
}

.file-item.selected .model-preview {
  border-color: #4a9eff;
}

.model-container {
  width: 100%;
  aspect-ratio: 1; /* This maintains square proportions */
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 10px;
  overflow: hidden;
  background-color: #0a0a23; /* Update this line with the new color */
}

.model-container img {
  border-radius: 10px;
}

header {
  text-align: center;
  margin-bottom: 20px;
}

#save-model-button {
  background-color: #007bff; /* Blue button */
  color: white;
  padding: 10px 20px;
  border: none;
  cursor: pointer;
  margin-top: 10px; /* Space above the button */
  width: 100%; /* Button width */
  text-align: center;
}

#save-model-button:hover {
  background-color: #0056b3; /* Darker blue on hover */
}

#refresh-thumbnail-button {
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  margin-top: 10px;
  width: 100%;
  text-align: center;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

#refresh-thumbnail-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
  background: linear-gradient(135deg, #5ae890 0%, #2dd66f 100%);
}

.spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.loader {
  border: 16px solid rgba(255, 255, 255, 0.1);
  border-top: 16px solid #00d4ff;
  border-right: 16px solid #5b9fff;
  border-radius: 50%;
  width: 120px;
  height: 120px;
  animation: spin 1s linear infinite;
  box-shadow: 0 0 30px rgba(0, 150, 200, 0.5);
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.hidden {
  display: none;
}

#spinner {
  background-color: #000000; /* Set the spinner background color to black */
  color: #ffffff; /* Set spinner text color to white */
}

/* Custom scrollbar styles */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.5) 0%, rgba(91, 159, 255, 0.5) 100%);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.7) 0%, rgba(91, 159, 255, 0.7) 100%);
  background-clip: padding-box;
}

.designer-input-container {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 6px;
}

/* Ensure buttons align vertically with dropdowns */
.designer-input-container .list-button,
.designer-input-container .icon-button {
  vertical-align: middle;
}

/* Base styles for designer-input-container selects (not in model-details) */
.designer-input-container select {
  flex: 1;
  margin-right: 0;
  min-width: 0;
}

.designer-input-container .icon-button {
  flex-shrink: 0;
  background: linear-gradient(135deg, #00d4ff 0%, #5b9fff 100%);
  color: white;
  border: none;
  border-radius: 8px;
  width: 28px;
  height: 28px;
  padding: 0;
  margin-left: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(91, 159, 255, 0.3);
  align-self: center;
  margin-top: 0;
  margin-bottom: 0;
}

.designer-input-container .icon-button:hover {
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 4px 10px rgba(91, 159, 255, 0.4);
  background: linear-gradient(135deg, #00e5ff 0%, #6ba8ff 100%);
}

/* Base styles for model detail dropdowns - will be overridden by .model-details rules */
#model-designer {
  flex: 1;
  padding: 12px 16px;
  padding-right: 40px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  color: #fff;
  transition: all 0.3s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}

#model-designer:focus {
  outline: none;
  border-color: var(--primary-accent, #00d4ff);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), 0 4px 12px var(--primary-shadow, rgba(0, 212, 255, 0.2));
}

/* SIMPLIFIED: #model-designer options inherit from global select option rules */
#model-designer {
  color: #fff !important;
}


/* Model details specific - match filter section width constraints */
.model-details .designer-input-container:has(.list-button) select,
.model-details .designer-input-container:not(:has(.list-button)) select {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: auto !important;
  max-width: calc(240px - 68px) !important; /* Match filter section width minus buttons */
}

.designer-input-container select:focus {
  outline: none;
  border-color: #00d4ff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), 0 4px 12px rgba(0, 212, 255, 0.2);
}

/* SIMPLIFIED: .designer-input-container select options inherit from global select option rules */
.designer-input-container select {
  color: #fff !important;
}

/* Dropdown with List button container */
.dropdown-with-list {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

/* Ensure list button aligns vertically with dropdown */
.dropdown-with-list .list-button {
  vertical-align: middle;
}

.dropdown-with-list select {
  flex: 1;
  min-width: 0;
}

/* For filter section, make all dropdowns the same width - narrower to match model details */
.sidebar .dropdown-with-list {
  width: 100%;
  max-width: 240px; /* Reduced to match model details fields and prevent overflow */
}

.sidebar .dropdown-with-list select,
.sidebar .dropdown-with-list .tags-input-container select {
  flex: 1;
  min-width: 0;
  width: calc(100% - 34px); /* Account for list button (28px) + gap (6px) */
  max-width: calc(240px - 34px); /* Match the container max-width minus button space */
}

/* Make all filter dropdowns the same width - dropdowns without buttons match width */
.sidebar .form-group:not(:has(.dropdown-with-list)) select {
  width: calc(100% - 34px); /* Match the width of dropdowns with list buttons */
  max-width: calc(240px - 34px); /* Match the max-width of dropdowns with buttons */
  margin-right: 34px; /* Add right margin to account for button space */
  box-sizing: border-box;
}

/* Tag filter in sidebar - match other filter dropdowns */
.sidebar .dropdown-with-list:has(#tag-filter) {
  width: 100%;
  max-width: 240px; /* Match other filter dropdowns - reduced to prevent overflow */
}

.sidebar .dropdown-with-list:has(#tag-filter) .tags-input-container {
  flex: 1;
  min-width: 0;
  width: 100%;
}

/* Tag filter dropdown - match other filter dropdowns width */
.sidebar .dropdown-with-list:has(#tag-filter) .tags-input-container select {
  flex: 1;
  min-width: 0;
  width: calc(100% - 34px); /* Account for list button (28px) + gap (6px) */
  max-width: calc(240px - 34px); /* Match the container max-width minus button space */
}

/* List button styling - matches icon-button style, smaller size */
.list-button {
  background: linear-gradient(135deg, #00d4ff 0%, #5b9fff 100%);
  color: white;
  border: none;
  border-radius: 8px;
  width: 28px;
  height: 28px;
  padding: 0;
  margin-left: 6px;
  margin-right: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(91, 159, 255, 0.3);
  flex-shrink: 0;
  align-self: center;
  margin-top: 0;
  margin-bottom: 0;
}

.list-button:hover {
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 4px 10px rgba(91, 159, 255, 0.4);
  background: linear-gradient(135deg, #00e5ff 0%, #6ba8ff 100%);
}

.list-button:active {
  transform: translateY(0) scale(0.95);
}

/* Searchable list dialog styles */
.searchable-list-container {
  max-height: 400px;
  overflow-y: auto;
  margin: 16px 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
}

.searchable-list {
  list-style: none;
  padding: 8px;
  margin: 0;
}

.searchable-list li {
  padding: 12px 16px;
  margin: 4px 0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
}

.searchable-list li:hover {
  background: rgba(0, 212, 255, 0.15);
  border-color: rgba(0, 212, 255, 0.3);
  transform: translateX(4px);
}

.searchable-list li.selected {
  background: linear-gradient(135deg, #00d4ff 0%, #5b9fff 100%);
  border-color: rgba(0, 212, 255, 0.5);
  color: white;
  font-weight: 500;
}

.searchable-list li:empty {
  display: none;
}

#searchable-list-dialog {
  min-width: 400px;
  max-width: 600px;
}

#searchable-list-search {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 14px;
  margin-bottom: 16px;
}

#searchable-list-search:focus {
  outline: none;
  border-color: #00d4ff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), 0 4px 12px rgba(0, 212, 255, 0.2);
}

#add-new-designer-button,
#add-new-parent-button,
#add-new-license-button,
#bulk-add-designer-button,
#bulk-add-parent-button,
#add-tag-button {
  padding: 0;
  background: linear-gradient(135deg, #00d4ff 0%, #5b9fff 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(91, 159, 255, 0.3);
  flex-shrink: 0;
  align-self: center;
}

#add-new-designer-button:hover,
#add-new-parent-button:hover,
#add-new-license-button:hover,
#bulk-add-designer-button:hover,
#bulk-add-parent-button:hover,
#add-tag-button:hover {
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 4px 10px rgba(91, 159, 255, 0.4);
  background: linear-gradient(135deg, #00e5ff 0%, #6ba8ff 100%);
}

.modal {
  border: none;
  border-radius: 20px;
  padding: 32px;
  background: rgba(30, 30, 46, 0.95);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  color: white;
  max-width: 1000px;
  width: 80%;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Keyboard shortcuts dialog */
.keyboard-shortcuts-intro {
  margin: 0 0 1rem 0;
  font-size: 0.9rem;
  opacity: 0.9;
}
.keyboard-shortcuts-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.keyboard-shortcuts-list .shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.keyboard-shortcuts-list .shortcut-action {
  flex: 1;
}
.keyboard-shortcuts-list kbd {
  display: inline-block;
  padding: 0.2em 0.5em;
  font-size: 0.85em;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  white-space: nowrap;
}

.dialog-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.dialog-buttons button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.dialog-buttons button[type="submit"] {
  background: linear-gradient(135deg, #00d4ff 0%, #5b9fff 100%);
  color: white;
  border-radius: 12px;
  padding: 10px 20px;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(91, 159, 255, 0.3);
}

.dialog-buttons button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(91, 159, 255, 0.4);
}

/* STL Home Save button is type="button" for Docker/server save reliability; keep primary style */
#stl-home-dialog #save-stl-home-button {
  background: linear-gradient(135deg, #00d4ff 0%, #5b9fff 100%);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 10px 20px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(91, 159, 255, 0.3);
}
#stl-home-dialog #save-stl-home-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(91, 159, 255, 0.4);
}

.dialog-buttons button[type="button"] {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 10px 20px;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dialog-buttons button[type="button"]:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

/* Center cancel button in searchable list dialog */
#searchable-list-dialog .dialog-buttons {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

/* Center close button in backup-restore dialog */
#backup-restore-dialog .dialog-buttons {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

#new-designer-name {
  width: 100%;
  padding: 8px;
  border: 1px solid #555;
  border-radius: 4px;
  background-color: #444;
  color: #fff;
}

#clear-parent-button {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  min-width: 30px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#clear-parent-button:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

/* Base styles for model detail dropdowns - will be overridden by .model-details rules */
#model-parent,
#model-license {
  flex: 1;
  padding: 12px 16px;
  padding-right: 40px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  color: #fff;
  transition: all 0.3s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}

#model-parent:focus,
#model-license:focus {
  outline: none;
  border-color: var(--primary-accent, #00d4ff);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), 0 4px 12px var(--primary-shadow, rgba(0, 212, 255, 0.2));
}

/* SIMPLIFIED: #model-parent and #model-license options inherit from global select option rules */
#model-parent,
#model-license {
  color: #fff !important;
}

.search-container {
  position: relative;
  margin-bottom: 10px;
  padding: 0 20px;
}

#search-input {
  width: 85%;
  padding: 8px 30px 8px 8px;
  border: 1px solid #555;
  border-radius: 4px;
  background-color: #444;
  color: #fff;
}

#search-input::placeholder {
  color: #999;
}

#clear-search-button {
  position: absolute;
  right: 25px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 18px;
  padding: 0 8px;
  display: none;
}

#clear-search-button:hover {
  color: #fff;
}

/* Show clear button when search has input */
#search-input:not(:placeholder-shown) + #clear-search-button {
  display: block;
}

/* Update the styles for the tag select */
/* #model-tags is now a div container with class tags-list, not a select element */
/* Removed select-specific styles - using .tags-list styles instead */

/* Remove the old tag styles */
.tags-container,
.tags-input-container,
.tags-list,
.tag,
.tag-remove {
  display: none;
}

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

.tags-input-container {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

/* Ensure buttons in tags-input-container are perfectly aligned with dropdown */
.tags-input-container .list-button,
.tags-input-container .icon-button,
.tags-input-container .add-tag-button {
  align-self: center;
  margin-top: 0;
  margin-bottom: 0;
  vertical-align: middle;
  line-height: 1;
}

.tags-input-container select {
  flex: 1;
  padding: 12px 16px;
  padding-right: 40px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  color: #fff;
  min-width: 0;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  transition: all 0.3s ease;
}

/* In edit view, tag filter has 2 buttons (list, add) - allow full width */
.tags-input-container:has(.list-button) select {
  flex: 1;
  min-width: 0;
}

/* In filter view, tag filter only has list button - make dropdown wider */
.dropdown-with-list:has(#tag-filter) .tags-input-container select {
  max-width: calc(100% - 38px); /* Account for list button (32px) + gap (6px) */
}

.tags-input-container select:focus {
  outline: none;
  border-color: #00d4ff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), 0 4px 12px rgba(0, 212, 255, 0.2);
}

/* SIMPLIFIED: .tags-input-container select options inherit from global select option rules */
.tags-input-container select {
  color: #fff !important;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 32px;
  padding: 4px;
  border: 1px solid #555;
  border-radius: 4px;
  background-color: #444;
  width: 85%;
  overflow-x: hidden;
  overflow-y: visible;
  align-content: flex-start;
}

.tag {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background-color: #007bff;
  color: white;
  border-radius: 16px;
  font-size: 14px;
  max-width: 100%;
  overflow: hidden;
}

.tag-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.tag-remove {
  display: inline-flex;  /* Change from display: none */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: bold;
  padding: 0 4px;
  margin-left: 4px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  transition: background-color 0.2s;
}

.tag-remove:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

/* Filter section styling */
.filter-section {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 24px 0;
  margin: 20px 0;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  margin-left: 10px;
  margin-right: 10px;
}

.filter-section .form-group {
  width: 100%;
  margin-bottom: 15px;
  padding: 0 20px;
}

.filter-section select {
  width: 85%; 
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  color: #fff;
  padding: 12px 16px;
  padding-right: 40px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  transition: all 0.3s ease;
}

.filter-section select:focus {
  outline: none;
  border-color: var(--primary-accent, #00d4ff);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), 0 4px 12px var(--primary-shadow, rgba(0, 212, 255, 0.2));
}

.filter-section select {
  color: #fff !important;
}

/* SIMPLIFIED: .filter-section select options inherit from global select option rules */

.filter-section select option[value=""],
.filter-section select option:empty {
  background: rgba(30, 30, 46, 0.95) !important;
  background-color: rgba(30, 30, 46, 0.95) !important;
  color: #fff !important;
}

.filter-section label {
  text-align: left;
  width: 100%;
  margin-bottom: 5px;
}

.progress-container {
  margin: 15px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: rgba(0, 0, 0, 0.8);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: visible;
  position: relative;
}

.progress-container progress {
  width: 100%;
  height: 24px;
  border-radius: 8px;
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  position: relative;
  flex-shrink: 0;
}

.progress-container .progress-text {
  margin-top: 4px;
  margin-bottom: 0;
  padding: 0;
  min-height: 18px;
  line-height: 1.4;
}

.progress-container progress::-webkit-progress-bar {
  background-color: rgba(20, 20, 20, 0.9);
  border-radius: 0;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.stop-button {
  position: relative;
  width: 85%;
  margin: 10px auto;
  background: linear-gradient(135deg, #ff6b6b 0%, #ff3b30 100%);
  color: white;
  border: none;
  border-radius: 24px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(255, 59, 48, 0.3);
}

.stop-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 59, 48, 0.4);
  background: linear-gradient(135deg, #ff7b7b 0%, #ff4b40 100%);
}

.progress-bar {
  height: 100%;
  background-color: #4CAF50;
  width: 0%;
  transition: width 0.3s;
}

#progress-status {
  font-size: 14px;
  color: #666;
  margin-top: 10px;
}

.progress-container + .progress-container {
  margin-top: 10px;
}

#render-progress-container .progress-bar {
  background-color: #28a745; /* Different color for render progress */
}

.bulk-edit-button {
  display: none;
}

.selected-count {
  color: #999;
  margin-bottom: 20px;
  font-size: 14px;
}

#multi-edit-panel .selected-count {
  padding-left: 20px;
}

#multi-save-button {
  background-color: #28a745;
  margin-top: 20px;
}

#multi-save-button:hover {
  background-color: #218838;
}

/* Make multi-edit panel match model details styling */
#multi-edit-panel.model-details {
  margin-top: 20px;
  width: 100%;
  background: color-mix(in srgb, var(--model-background-color) 25%, transparent);
  padding: 20px 0;
  border-top: 1px solid #444;
  border-bottom: 1px solid #444;
}

#multi-edit-panel h3 {
  padding: 0 20px;
  margin-top: 0;
  margin-bottom: 15px;
}

#multi-edit-panel .form-group {
  margin-bottom: 15px;
  width: 100%;
  padding: 0 20px;
}

#multi-edit-panel .full-width-button {
  margin-left: 20px;
}

#multi-edit-panel .checkbox-container {
  display: flex;
  flex-direction: row !important;
  align-items: center;
  width: 100%;
  gap: 8px;
  padding: 8px 20px;
  margin-bottom: 15px;
  margin-left: 0;
}

#multi-edit-panel .checkbox-container label {
  margin: 0;
  flex: 1;
  cursor: pointer;
}

#multi-edit-panel .checkbox-container input[type="checkbox"] {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  margin: 0;
  padding: 0;
  cursor: pointer;
  accent-color: var(--primary-accent, #00d4ff);
  flex-shrink: 0;
}

#edit-mode-toggle {
  background: linear-gradient(135deg, #00d4ff 0%, #5b9fff 100%);
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  width: calc(100% - 40px);
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(91, 159, 255, 0.3);
}

#edit-mode-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(91, 159, 255, 0.4);
}

#edit-mode-toggle.active {
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

#edit-mode-toggle.active:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

#invert-filter-button {
  width: 265px;
  padding: 8px 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

/* Disable global before shimmer on this button so it stays centered/aligned */
#invert-filter-button::before {
  content: none !important;
  display: none !important;
}



#invert-filter-button.active {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

#invert-filter-button.active:hover {
  background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

/* Apply the same styles to multi-edit panel */
#multi-edit-panel .designer-input-container {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 85%;
}

#multi-edit-panel .designer-input-container select {
  flex: 1;
  color: #fff !important;
  background-color: rgba(255, 255, 255, 0.05) !important;
}

#multi-edit-panel .designer-input-container select option {
  background-color: rgba(30, 30, 46, 0.95) !important;
  background: rgba(30, 30, 46, 0.95) !important;
  color: #fff !important;
}

#multi-edit-panel .designer-input-container select option:not(:checked):not([selected]):not(:hover) {
  background-color: rgba(30, 30, 46, 0.95) !important;
  background: rgba(30, 30, 46, 0.95) !important;
  color: #fff !important;
}

#multi-edit-panel .designer-input-container select option:checked,
#multi-edit-panel .designer-input-container select option[selected] {
  background: var(--primary-gradient, linear-gradient(135deg, #00d4ff 0%, #5b9fff 100%)) !important;
  background-color: transparent !important;
  color: #fff !important;
}

#multi-edit-panel .designer-input-container select option:checked:hover,
#multi-edit-panel .designer-input-container select option[selected]:hover {
  background: var(--primary-gradient-hover, linear-gradient(135deg, #00e5ff 0%, #6ba8ff 100%)) !important;
  background-color: transparent !important;
  color: #fff !important;
}

#multi-edit-panel .designer-input-container select option:hover:not(:checked):not([selected]) {
  background-color: rgba(0, 150, 200, 0.5) !important;
  background: rgba(0, 150, 200, 0.5) !important;
  color: #fff !important;
}

#multi-edit-panel .designer-input-container .icon-button {
  background: none;
  border: none;
  padding: 0;
  margin-left: 5px;
  cursor: pointer;
  width: 20px;
  color: #fff;
  font-size: 20px;
}

#multi-edit-panel .designer-input-container .icon-button:hover {
  color: #007bff;
}

#multi-edit-panel .tags-input-container {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 85%;
}

#multi-edit-panel .tags-input-container .icon-button {
  background: none;
  border: none;
  padding: 0;
  margin-left: 5px;
  cursor: pointer;
  width: 20px;
  color: #fff;
  font-size: 20px;
}

#multi-edit-panel .tags-input-container .icon-button:hover {
  color: #007bff;
}

.welcome-dialog {
  border: none;
  border-radius: 8px;
  padding: 20px;
  background-color: #2a2a2a;
  color: white;
  max-width: 400px;
  opacity: 0; /* Start invisible */
  animation: fadeIn 5s forwards; /* Apply fade-in animation */
}

@keyframes fadeIn {
  from {
    opacity: 0; /* Start fully transparent */
  }
  to {
    opacity: 1; /* End fully opaque */
  }
}

.welcome-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.welcome-content h2 {
  color: #fff;
  margin: 0;
  font-size: 24px;
}

.welcome-content p {
  color: #ccc;
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
}

#dismiss-welcome {
  background: linear-gradient(135deg, #00d4ff 0%, #5b9fff 100%);
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  width: auto;
  margin-top: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(91, 159, 255, 0.3);
}

#dismiss-welcome:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(91, 159, 255, 0.4);
  background: linear-gradient(135deg, #00e5ff 0%, #6ba8ff 100%);
}

/* Remove the old welcome message styles */
.welcome-message {
  display: none;
}

/* Remove the old multi-edit panel button styles */
#multi-edit-panel .designer-input-container .icon-button,
#multi-edit-panel .tags-input-container .icon-button {
  background: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  width: 28px;
  height: 28px;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background-color 0.2s ease;
}

#multi-edit-panel .designer-input-container .icon-button:hover,
#multi-edit-panel .tags-input-container .icon-button:hover {
  background: #0056b3;
}

/* Make all input containers consistent */
#multi-edit-panel .designer-input-container,
#multi-edit-panel .tags-input-container {
  display: flex;
  align-items: center;
  width: 85%;
}

#multi-edit-panel .designer-input-container select,
#multi-edit-panel .tags-input-container select {
  flex: 1;
  margin-right: 0;
  color: #fff !important;
  background-color: rgba(255, 255, 255, 0.05) !important;
}

/* SIMPLIFIED: #multi-edit-panel select options inherit from global select option rules */

/* Make all buttons consistent - smaller size */
.icon-button {
  background: linear-gradient(135deg, #00d4ff 0%, #5b9fff 100%);
  color: white;
  border: none;
  border-radius: 8px;
  width: 28px;
  height: 28px;
  padding: 0;
  margin-left: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(91, 159, 255, 0.3);
  flex-shrink: 0;
  align-self: center;
}

.icon-button:hover {
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 4px 10px rgba(91, 159, 255, 0.4);
  background: linear-gradient(135deg, #00e5ff 0%, #6ba8ff 100%);
}

.dedup-dialog {
  min-width: 800px;
  max-width: 90vw;
  max-height: 80vh;
}

.dedup-dialog .duplicate-groups {
  max-height: calc(80vh - 120px);
  overflow-y: auto;
}

/* Fullscreen toggle button for DeDup and Tag Manager modals */
.modal-fullscreen-toggle {
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}
.modal-fullscreen-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Modal fullscreen state */
.modal.modal-fullscreen {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  border-radius: 0;
  padding: 24px;
  box-sizing: border-box;
}
.modal.modal-fullscreen form {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.dedup-dialog.modal-fullscreen .duplicate-groups {
  flex: 1;
  min-height: 0;
  max-height: none !important;
  margin-top: 0.5rem;
}
#tag-manager-dialog.modal-fullscreen form .form-group:nth-child(3) {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#tag-manager-dialog.modal-fullscreen #tag-manager-list {
  flex: 1;
  min-height: 0;
  max-height: none;
}

.duplicate-group {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid #333;
}

.duplicate-preview {
  flex: 0 0 150px;
  height: 150px;
  background: var(--model-background-color);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.duplicate-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.duplicate-files {
  flex: 1;
  overflow-y: auto;
  max-height: 150px;
}

.duplicate-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  background: #2a2a2a;
  margin-bottom: 3px;
  border-radius: 4px;
}

.duplicate-file input[type="checkbox"] {
  margin: 0;
}

.duplicate-file-path {
  margin-left: 10px;
  color: var(--text-color);
  max-width: 800px;
  text-overflow: ellipsis;
  display: inline-block;
  font-size: 10px;
  word-wrap: break-word;
  word-break: break-all;
  white-space: normal;
}

.duplicate-file-size {
  margin-left: auto;
  color: #777;
}

.duplicate-file.zip-entry {
  opacity: 0.7;
  background: #1f1f1f;
}

.duplicate-file.zip-entry input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.zip-entry-badge {
  display: inline-block;
  background: #4a90e2;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: bold;
  margin-right: 6px;
  vertical-align: middle;
}

.no-duplicates {
  text-align: center;
  padding: 20px;
  color: #999;
  font-size: 16px;
}

.error-message {
  color: #ff6b6b;
  text-align: center;
  padding: 20px;
  font-size: 16px;
}

.model-count {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  margin-bottom: 15px;
  letter-spacing: 0.02em;
}

.model-stats {
  margin-bottom: 15px;
  text-align: center;
}

.model-count {
  color: #999;
  font-size: 14px;
  margin: 2px 0;
}

.progress-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}

.progress-button {
  padding: 5px 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  background: #444;
  color: #fff;
  transition: background 0.2s;
  width: auto;
  margin: 0;
}

.progress-button:hover {
  background: #555;
}

#stop-scan, #stop-render {
  background: #dc3545;
}

#stop-scan:hover, #stop-render:hover {
  background: #c82333;
}

.progress-section {
  width: 85%;
  padding: 10px 20px;
  margin-bottom: 15px;
}

.progress-section .progress-container {
  margin-bottom: 10px;
}

/* Tag Manager Styles */
#tag-manager-dialog {
  min-width: 400px;
}

#tag-manager-search {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  color: #fff;
  margin-bottom: 8px;
  transition: all 0.3s ease;
}

#tag-manager-search:focus {
  outline: none;
  border-color: #00d4ff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), 0 4px 12px rgba(0, 212, 255, 0.2);
}

#tag-manager-search::placeholder {
  color: #999;
}

#clear-tag-search {
  opacity: 0.7;
  transition: opacity 0.2s;
}

#clear-tag-search:hover {
  opacity: 1;
}

#tag-manager-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 32px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  width: 100%;
  margin-top: 8px;
  max-height: 300px;
  overflow-y: auto;
}

#tag-manager-list .tag {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.2) 0%, rgba(91, 159, 255, 0.2) 100%);
  backdrop-filter: blur(10px);
  color: white;
  border: 1px solid rgba(0, 150, 200, 0.5);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s ease;
  max-width: 100%;
  overflow: hidden;
}

#tag-manager-list .tag .tag-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

#tag-manager-list .tag:hover {
  background: linear-gradient(135deg, rgba(0, 150, 200, 0.5) 0%, rgba(91, 159, 255, 0.3) 100%);
  border-color: rgba(0, 212, 255, 0.5);
  transform: translateY(-1px);
}

#tag-manager-list .tag .tag-count {
  background-color: rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  border-radius: 12px;
  font-size: 12px;
  margin-left: 4px;
}

#tag-manager-list .tag .tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: bold;
  padding: 0 4px;
  margin-left: 4px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  transition: background-color 0.2s;
}

#tag-manager-list .tag .tag-remove:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

#new-tag-manager-name {
  flex: 1;
  padding: 8px;
  border: 1px solid #555;
  border-radius: 4px;
  background-color: #444;
  color: #fff;
}

/* Metadata Editor Dialog */
#metadata-editor-dialog {
  min-width: 500px;
}

#metadata-editor-dialog .dialog-buttons {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

#server-mode-info-dialog .dialog-buttons {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.metadata-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid #555;
}

.metadata-tab {
  padding: 8px 16px;
  background-color: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.metadata-tab:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.05);
}

.metadata-tab.active {
  color: #fff;
  font-weight: bold;
  border-bottom-color: #007bff;
  background-color: rgba(0, 123, 255, 0.1);
}

#metadata-editor-search {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  color: #fff;
  margin-bottom: 8px;
  transition: all 0.3s ease;
}

#metadata-editor-search:focus {
  outline: none;
  border-color: #00d4ff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), 0 4px 12px rgba(0, 212, 255, 0.2);
}

#metadata-editor-search::placeholder {
  color: #999;
}

#clear-metadata-search {
  opacity: 0.7;
  transition: opacity 0.2s;
}

#clear-metadata-search:hover {
  opacity: 1;
}

#metadata-editor-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 32px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  width: 100%;
  margin-top: 8px;
  max-height: 400px;
  overflow-y: auto;
}

.metadata-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  background: transparent;
  backdrop-filter: none;
  border: none;
  border-radius: 0;
  font-size: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: auto;
}

.metadata-item:hover {
  background: transparent;
  border-color: transparent;
  transform: none;
}

.metadata-name {
  flex: 1;
  color: #fff;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  display: inline-block;
  padding-right: 8px;
  line-height: 1.4;
}

.metadata-count {
  background: linear-gradient(135deg, #00d4ff 0%, #5b9fff 100%);
  color: #fff;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  min-width: 24px;
  text-align: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(91, 159, 255, 0.3);
}

.metadata-rename,
.metadata-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  border: none;
  border-radius: 3px;
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 16px;
  transition: all 0.2s;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  line-height: 1;
}

.metadata-rename {
  font-size: 14px;
}

.metadata-rename:hover {
  background-color: rgba(0, 123, 255, 0.3);
  color: #007bff;
}

.metadata-delete:hover {
  background-color: rgba(220, 53, 69, 0.3);
  color: #dc3545;
}

#metadata-editor-list .no-metadata,
#metadata-editor-list .error-message {
  padding: 16px;
  text-align: center;
  color: #999;
  font-style: italic;
}

/* Thumbnail navigation overlay for multiple thumbnails in detailed view */
.thumbnail-wrapper {
  position: relative;
  display: inline-block;
}

.thumbnail-nav-left,
.thumbnail-nav-right {
  position: absolute;
  top: 0;
  height: 100%;
  background: transparent;
  transition: background-color 0.2s ease, opacity 0.2s ease;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
}

.thumbnail-wrapper:hover .thumbnail-nav-left,
.thumbnail-wrapper:hover .thumbnail-nav-right {
  opacity: 1;
}

.thumbnail-nav-left {
  left: 0;
  width: 50px;
  max-width: 50px;
  cursor: pointer;
}

.thumbnail-nav-right {
  right: 0;
  width: 50px;
  max-width: 50px;
  cursor: pointer;
}

.thumbnail-nav-left:hover {
  background: rgba(0, 0, 0, 0.3);
}

.thumbnail-nav-right:hover {
  background: rgba(0, 0, 0, 0.3);
}

.thumbnail-nav-left::before {
  content: '◀';
  color: rgba(255, 255, 255, 0.5);
  font-size: 32px;
  pointer-events: none;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
  transition: color 0.2s ease;
}

.thumbnail-nav-right::after {
  content: '▶';
  color: rgba(255, 255, 255, 0.5);
  font-size: 32px;
  pointer-events: none;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
  transition: color 0.2s ease;
}

.thumbnail-nav-left:hover::before {
  color: rgba(255, 255, 255, 0.9);
}

.thumbnail-nav-right:hover::after {
  color: rgba(255, 255, 255, 0.9);
}

.thumbnail-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: var(--model-background-color);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: context-menu;
  box-sizing: border-box;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.thumbnail-menu-button {
  position: absolute;
  bottom: 6px;
  left: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 0;
  margin: 0;
  line-height: 1;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid #666;
  color: #fff;
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  box-shadow: none;
  overflow: visible;
}

.thumbnail-menu-button:hover {
  transform: none;
}

.thumbnail-menu-button::before {
  display: none;
}

.thumbnail-container:hover .thumbnail-menu-button {
  opacity: 1;
  pointer-events: auto;
}

.thumbnail-container:hover {
  outline: 2px solid rgba(0, 150, 200, 0.5);
  box-shadow: 0 6px 20px rgba(0, 212, 255, 0.2);
  transform: scale(1.02);
}

.thumbnail-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  box-sizing: border-box;
}

.file-info {
  padding: 8px;
  width: 100%;
  box-sizing: border-box;
}

#select-all-button {
  margin-bottom: 15px;
  background-color: #2a2a2a;
  color: #fff;
  border: 1px solid #3a3a3a;
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
  width: 100%;
  max-width: 240px; /* Match filter section width */
  box-sizing: border-box;
}

#select-all-button:hover {
  background-color: #3a3a3a;
}

.tag-input-container {
  display: flex;
  gap: 8px;
  align-items: center;
}

.refresh-tags-button {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  transition: transform 0.2s ease;
}

.refresh-tags-button:hover {
  color: #4a9eff;
}

/* ============================================
   TERMS OF SERVICE DIALOG - MODERN STYLING
   ============================================ */

.tos-dialog {
  width: 90%;
  max-width: 1000px;
  max-height: 90vh;
  padding: 0;
  overflow: hidden;
}

.tos-dialog-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.tos-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 2rem 1rem 2rem;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.05) 0%, rgba(91, 159, 255, 0.05) 100%);
  flex-shrink: 0;
}

.tos-logo {
  width: 60px;
  height: auto;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 4px 12px rgba(0, 212, 255, 0.3));
  transition: transform 0.3s ease;
}

.tos-logo:hover {
  transform: scale(1.05);
}

.tos-header h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  background: linear-gradient(135deg, #00d4ff 0%, #5b9fff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tos-body {
  flex: 1;
  overflow: visible;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.tos-scroll-content {
  flex: 1;
  overflow: visible;
  padding: 1.5rem 2rem;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.5;
  letter-spacing: 0.01em;
}

/* Custom scrollbar for TOS content */
.tos-scroll-content::-webkit-scrollbar {
  width: 8px;
}

.tos-scroll-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.tos-scroll-content::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.5) 0%, rgba(91, 159, 255, 0.5) 100%);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.tos-scroll-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.7) 0%, rgba(91, 159, 255, 0.7) 100%);
  background-clip: padding-box;
}

.tos-scroll-content h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  color: #fff;
  letter-spacing: -0.01em;
}

.tos-copyright {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 1rem;
  font-weight: 500;
}

.tos-scroll-content p {
  margin: 0 0 0.75rem 0;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
  font-size: 13px;
}

.tos-warning {
  background: rgba(255, 152, 0, 0.1);
  border-left: 3px solid #ff9800;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin: 1rem 0 !important;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95) !important;
  font-size: 12px;
  line-height: 1.4;
}

.tos-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}

.tos-button {
  padding: 10px 24px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 120px;
  letter-spacing: 0.02em;
}

.tos-button-accept {
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.tos-button-accept:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
  background: linear-gradient(135deg, #5ae890 0%, #2dd66f 100%);
}

.tos-button-accept:active {
  transform: translateY(0);
}

.tos-button-decline {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tos-button-decline:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tos-button-decline:active {
  transform: translateY(0);
}

/* Legacy support for old class names */
.tos-content {
  margin: 20px 0;
  max-height: 60vh;
  overflow-y: auto;
  padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
}

.tos-text {
  padding: 20px;
  color: rgba(255, 255, 255, 0.95);
}

.tos-text h3 {
  margin-top: 0;
  color: #fff;
}

.tos-text h4 {
  color: #4a9eff;
  margin-top: 20px;
}

.tos-text p {
  line-height: 1.7;
  margin-bottom: 15px;
}

.tos-text ul {
  margin-left: 20px;
  margin-bottom: 15px;
}

.tos-text li {
  margin-bottom: 8px;
}

#decline-terms {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
}

#decline-terms:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

#accept-terms {
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

#accept-terms:hover {
  background: linear-gradient(135deg, #5ae890 0%, #2dd66f 100%);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

/* Legacy about-tos styles for server-mode-info-dialog */
.about-tos {
  margin-top: 20px;
  border-top: 1px solid rgba(74, 158, 255, 0.2);
  padding-top: 20px;
}

.about-tos h3 {
  color: #4a9eff;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}

.about-tos-content {
  max-height: 200px;
  overflow-y: auto;
  padding: 16px;
  border: 1px solid rgba(74, 158, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 14px;
  line-height: 1.6;
}

.about-tos-content h4 {
  color: #4a9eff;
  margin: 12px 0 8px 0;
  font-weight: 600;
}

.about-tos-content p {
  margin-bottom: 12px;
  color: #e0e0e0;
}

.about-tos-content ul {
  margin: 8px 0 12px 24px;
}

.about-tos-content li {
  margin-bottom: 8px;
  color: #d0d0d0;
}

/* Modern About Dialog */
#about-dialog {
  width: 95%;
  max-width: 1000px;
  max-height: 85vh;
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 1px solid rgba(74, 158, 255, 0.2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

#about-dialog form {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.about-header {
  text-align: center;
  padding: 32px 32px 24px;
  background: linear-gradient(135deg, rgba(74, 158, 255, 0.1) 0%, rgba(74, 158, 255, 0.05) 100%);
  border-bottom: 1px solid rgba(74, 158, 255, 0.2);
  position: relative;
}

.about-close-x {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
  z-index: 10;
}

.about-close-x:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.about-close-x:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.15);
}

.about-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  background: rgba(255, 255, 255, 0.05);
  padding: 8px;
}

.about-header h2 {
  margin: 0 0 8px 0;
  font-size: 28px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.about-version-text {
  margin: 0;
  font-size: 14px;
  color: #a0a0a0;
  font-weight: 500;
}

.about-content {
  padding: 24px 32px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: row;
  gap: 24px;
  align-items: flex-start;
}

.about-main-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.about-terms-column {
  flex: 0 0 380px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.about-terms-card {
  position: sticky;
  top: 0;
  max-height: calc(85vh - 250px);
  overflow-y: auto;
  height: fit-content;
  padding: 16px;
}

.about-terms-card .about-card-content {
  max-height: none;
  gap: 10px;
}

.about-terms-list {
  max-height: none;
  overflow: visible;
}

.about-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.about-primary-button {
  width: 100%;
  padding: 12px 24px;
  background: linear-gradient(135deg, #4a9eff 0%, #357abd 100%);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
}

.about-primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 158, 255, 0.4);
  background: linear-gradient(135deg, #5aaeff 0%, #458acd 100%);
}

.about-primary-button:active {
  transform: translateY(0);
}

.button-icon {
  font-size: 18px;
}

.about-options-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.about-option-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  transition: background 0.2s ease;
}

.about-option-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.about-option-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #4a9eff;
}

.about-option-item label {
  font-size: 14px;
  color: #e0e0e0;
  cursor: pointer;
  user-select: none;
}

.about-link-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  transition: all 0.2s ease;
}

.about-link-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(4px);
}

.link-icon {
  font-size: 20px;
}

.about-link {
  color: #4a9eff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.about-link:hover {
  color: #6abeff;
  text-decoration: underline;
}

.about-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(74, 158, 255, 0.15);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
}

.about-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(74, 158, 255, 0.25);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.about-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-icon {
  font-size: 24px;
}

.about-card-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}

.about-card-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.about-card-description {
  margin: 0;
  font-size: 12px;
  color: #b0b0b0;
  line-height: 1.5;
}

.about-terms-list {
  margin: 8px 0 0 0;
  padding-left: 24px;
  list-style: none;
  counter-reset: term-counter;
}

.about-terms-list li {
  position: relative;
  margin: 8px 0;
  padding-left: 8px;
  font-size: 12px;
  color: #c0c0c0;
  line-height: 1.5;
}

.about-terms-list li::before {
  content: "•";
  position: absolute;
  left: -20px;
  color: #4a9eff;
  font-weight: bold;
  font-size: 16px;
}

/* About dialog close button removed - using X in header */

/* Server Mode Info dialog - fill width */
#server-mode-info-dialog {
  width: 80%;
  max-width: 700px;
  max-height: 80vh;
  padding: 20px 0 20px 20px;
}

#server-mode-info-dialog .about-content {
  padding: 0;
  max-width: none;
}

/* Stats Dialog Styles */
#stats-dialog {
  width: 90%;
  max-width: 900px;
  max-height: 85vh;
  padding: 20px;
}

.stats-content {
  padding: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0;
}

.stats-section {
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(74, 158, 255, 0.15);
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.stats-section h3 {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 600;
  color: #4a9eff;
  border-bottom: 1px solid rgba(74, 158, 255, 0.2);
  padding-bottom: 4px;
}

.stats-summary {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
}

.stats-summary h3 {
  grid-column: 1;
  margin: 0;
}

.stats-summary .stats-value-large {
  grid-column: 2;
  text-align: right;
}

.stats-subsection {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.stats-chart-section {
  display: flex;
  flex-direction: column;
}

.stats-tags {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stats-row:last-child {
  border-bottom: none;
}

.stats-row-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 12px;
}

.stats-grid-compact {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  margin-top: 8px;
}

.stats-label {
  color: #e0e0e0;
  font-size: 14px;
  font-weight: 500;
}

.stats-label-small {
  color: #e0e0e0;
  font-size: 12px;
  font-weight: 500;
}

.stats-label-tiny {
  color: #e0e0e0;
  font-size: 11px;
  font-weight: 500;
}

.stats-value {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  text-align: right;
}

.stats-value-large {
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  text-align: right;
}

.stats-value-small {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

.stats-value-tiny {
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  text-align: right;
}

.stats-description {
  margin: 8px 0 0 0;
  font-size: 12px;
  color: #a0a0a0;
  font-style: italic;
}

.chart-container {
  margin: 16px 0;
  height: 200px;
  position: relative;
}

.chart-container-small {
  margin: 8px 0;
  height: 120px;
  position: relative;
}

.chart-container canvas {
  max-height: 200px;
}

.chart-container-small canvas {
  max-height: 120px;
}

/* Add these rules to hide the save buttons */
#save-model-button,
#save-multi-edit-button,
#multi-save-button {
  display: none !important;
}

/* Add styles for the multi-edit mode buttons - match filter section width */
#enter-multi-edit-button,
#exit-multi-edit-button {
  margin: 10px 0 20px 20px; /* Adjust top/bottom margins and add left margin */
  background-color: #2a2a2a;
  color: #fff;
  border: 1px solid #3a3a3a;
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
  width: 100%;
  max-width: 240px; /* Match filter section width */
  box-sizing: border-box;
}

#enter-multi-edit-button:hover,
#exit-multi-edit-button:hover {
  background-color: #3a3a3a;
}

/* Hide the old edit mode toggle button */
#edit-mode-toggle {
  display: none !important;
}

:root {
  --model-background-color: #070147;  /* Default color */
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  padding: 20px;
  overflow-y: auto;
  /* Preserve hexagon pattern background */
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='52' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l26 15v30l-26 15-26-15V15z' fill='none' stroke='rgba(0,212,255,0.04)' stroke-width='0.5'/%3E%3Cpath d='M0 26l30-15 30 15M0 26l30 15 30-15' fill='none' stroke='rgba(0,212,255,0.04)' stroke-width='0.5'/%3E%3C/svg%3E");
  background-size: 60px 52px;
  background-position: 0 0;
}

.file-item {
  position: relative;
  background: #2a2a2a;
  border-radius: 12px;
  padding: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.file-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.file-item.selected {
  outline: 3px solid #4a9eff;
  background: #333;
}

.thumbnail-container {
  position: relative;
  width: 100%;
  height: 250px;
  background: var(--model-background-color);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.thumbnail-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.error-message {
  color: #ff6b6b;
  font-size: 14px;
  text-align: center;
  padding: 20px;
}

.file-info {
  padding: 8px 0;
}

.file-name {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-details {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  justify-content: space-between;
  align-items: center;
  line-height: 1.5;
}

@keyframes loading {
  0% { background-position: -200px 0; }
  100% { background-position: 200px 0; }
}

.loading .thumbnail-container {
  background: linear-gradient(90deg, #1a1a1a 25%, #2a2a2a 50%, #1a1a1a 75%);
  background-size: 200px 100%;
  animation: loading 1.5s infinite;
}

.print-status {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  color: #fff;
  z-index: 2;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.print-status:hover {
  background: rgba(0, 0, 0, 0.75);
  transform: scale(1.05);
}

.print-status.printed {
  background: rgba(46, 204, 113, 0.6);
}

.print-status.printed:hover {
  background: rgba(46, 204, 113, 0.85);
}

.setting-description {
  color: #888;
  font-size: 0.9em;
  margin: 5px 0 10px 0;
}

#browser-extension-settings-dialog .setting-description a {
  color: #7eb8f7;
  text-decoration: underline;
}
#browser-extension-settings-dialog .setting-description a:hover {
  color: #a8d4ff;
}

.full-width-button {
  width: 100%;
  max-width: 240px; /* Match filter section width */
  padding: 8px;
  margin: 5px 0;
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
  box-sizing: border-box;
}

.full-width-button:hover {
  background: #3a3a3a;
}

.duplicate-group {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid #333;
}

.duplicate-preview {
  flex: 0 0 150px;
  height: 150px;
  background: var(--model-background-color);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.duplicate-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.duplicate-files {
  flex: 1;
  overflow-y: auto;
  max-height: 150px;
}

.duplicate-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  background: #2a2a2a;
  margin-bottom: 3px;
  border-radius: 4px;
}

.duplicate-file input[type="checkbox"] {
  margin: 0;
}

.duplicate-file-path {
  flex: 1;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  word-wrap: break-word;
  word-break: break-all;
}

.duplicate-file-size {
  flex: 0 0 80px;
  text-align: right;
  color: #888;
}

.duplicate-file.zip-entry {
  opacity: 0.7;
  background: #1f1f1f;
}

.duplicate-file.zip-entry input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.zip-entry-badge {
  display: inline-block;
  background: #4a90e2;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: bold;
  margin-right: 6px;
  vertical-align: middle;
}

.dedup-dialog {
  min-width: 800px;
  max-width: 90vw;
}

#view-library-button {
  width: 90%;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.4;
}

#view-library-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(0, 150, 200, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 212, 255, 0.2);
}

#scan-directory-button {
  width: 90%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.4;
}

.progress-section hidden {
  display: none;
}

.progress-container {
  margin-bottom: 10px;
}

.progress-bar {
  height: 20px;
  background-color: #444;
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background-color: #4a9eff;
  transition: width 0.5s ease;
}

.progress-text {
  text-align: center;
  color: #fff;
  font-weight: 500;
  font-size: 13px;
  margin-top: 4px;
  padding: 0;
  line-height: 1.4;
  min-height: 18px;
}

.performance-notice {
  color: #888;
  font-size: 0.8em;
  text-align: center;
  margin-top: 5px;
  font-style: italic;
}

.danger-button {
  background-color: #dc3545;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.danger-button:hover {
  background-color: #c82333;
}

.easy-button {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.easy-button:hover {
  background: linear-gradient(135deg, #218838 0%, #1aa179 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.warning-text {
  color: #ff6b6b;
  font-size: 0.9em;
  margin-bottom: 15px;
  padding: 10px;
  background: rgba(255, 107, 107, 0.1);
  border-radius: 4px;
}

#settings-dialog input[type="number"] {
  width: 80px;
}

@keyframes winner-pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(74, 158, 255, 0.7); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(74, 158, 255, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(74, 158, 255, 0); }
}

.roulette-winner {
  animation: winner-pulse 0.5s ease-in-out 3;
}

.file-item {
  transition: all 0.2s ease-in-out;
}

/* Old about dialog styles removed - using modern styles above */

.welcome-dialog {
  border: none;
  border-radius: 20px;
  padding: 32px;
  background: rgba(30, 30, 46, 0.95);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  color: white;
  max-width: 400px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.welcome-content {
  text-align: center;
}

.welcome-content h2 {
  margin-bottom: 15px;
}

.welcome-content p {
  margin-bottom: 20px;
  line-height: 1.5;
}

.welcome-content button {
  padding: 8px 20px;
  margin: 5px;
  border: none;
  border-radius: 4px;
  background: #4a9eff;
  color: white;
  cursor: pointer;
  transition: background 0.2s;
}

.welcome-content button:hover {
  background: #3a8eef;
}

/* Add specific styles for update dialog buttons */
#update-now-button {
  background: #4a9eff;
}

#update-later-button {
  background: #666;
}

#update-later-button:hover {
  background: #777;
}

.parent-directory {
  font-size: 12px;
  color: #4a9eff; /* Make it look like a link */
  margin: 4px 0;
  cursor: pointer; /* Indicate it's clickable */
}

.parent-directory:hover {
  text-decoration: underline; /* Add underline on hover */
}

.directory-label {
  color: #666;
}

.directory-link {
  color: #4a9eff;
  text-decoration: none;
  cursor: pointer;
}

.directory-link:hover {
  text-decoration: underline;
}

/* Designer info styling to match parent directory */
.designer-info {
  font-size: 12px;
  color: #4a9eff;
  margin: 4px 0;
  cursor: pointer;
}

.designer-info:hover {
  text-decoration: underline;
}

#current-filter {
  padding: 8px;
  width: 100%;
  margin: 8px 8px;
  background: rgba(74, 158, 255, 0.1);
  border-radius: 4px;
  font-size: 14px;
  color: #fff;
  display: none;
}

#current-filter.visible {
  display: block;
}

.clear-filter-button {
  margin-left: 10px;
  margin-top: 5px;
  padding: 2px 8px;
  background: #4a9eff;
  border: none;
  border-radius: 3px;
  color: white;
  cursor: pointer;
  font-size: 12px;
}

.clear-filter-button:hover {
  background: #3a8eef;
}

/* New styles for the icon buttons container and buttons */
.icon-buttons-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.icon-buttons-container .icon-button {
  width: 56px;
  height: 56px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-buttons-container .icon-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(1.1);
}

.icon-buttons-container .icon-button:hover {
  transform: translateY(-2px) scale(1.05);
  background: rgba(0, 212, 255, 0.15);
  border-color: rgba(0, 150, 200, 0.5);
  box-shadow: 0 6px 20px rgba(0, 212, 255, 0.2);
}

.icon-buttons-container .icon-button:active {
  transform: translateY(0) scale(0.95);
}

/* Spinner overlay styles */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#loading-overlay .spinner p {
  margin-top: 20px;
  font-size: 20px;
  color: #fff;
}

/* Added custom style for the #continue-anyways button */
#continue-anyways {
    font-size: 10px;
    padding: 4px 8px;
    background-color: rgba(68, 68, 68, 0.3);
    color: #fff;
    border: 2px solid rgba(68, 68, 68, 0.3);
    border-radius: 4px;
    width: 15%;
}

/* Tag filter dropdown styling - removed old conflicting width rule */
/* Now uses the same styling as other filter dropdowns via .sidebar .dropdown-with-list select */

/* Ensure the container for the tag filter stays neat */
.tags-input-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Make sure the refresh button is sized and aligned properly */
.tags-input-container .refresh-tags-button {
  width: 32px;
  height: 32px;
  padding: 4px;
  flex-shrink: 0;
}

/* Highlight the "View Entire Library" button */
#view-library-button.highlight {
  border: 2px solid #FFD700;   /* Gold border for emphasis */
  background-color: #444;       /* Slightly darker background (adjust as needed) */
  box-shadow: 0 0 10px #FFD700;   /* Glow effect */
}

/* Styles for the indicator badge */
.library-badge {
  display: inline-block;
  background-color: #FFD700;    /* Gold background */
  color: #000;                  /* Black text for contrast */
  font-size: 10px;
  padding: 2px 4px;
  border-radius: 10px;
  margin-left: 5px;
}

/* ============================================
   QUICK START GUIDE - MODERN STYLING
   ============================================ */

#quickstart-guide {
  opacity: 0;
  animation: guideFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes guideFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.guide-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 2rem;
  min-height: 400px;
}

.guide-header {
  text-align: center;
  margin-bottom: 0.5rem;
}

.guide-header h2 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 1rem 0;
  background: linear-gradient(135deg, #00d4ff 0%, #5b9fff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.guide-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.guide-progress-bar {
  width: 100%;
  max-width: 400px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.guide-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #00d4ff 0%, #5b9fff 100%);
  border-radius: 10px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.guide-progress-text {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.02em;
}

.guide-scroll-container {
  max-height: 450px;
  overflow-y: auto;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  width: 100%;
  box-sizing: border-box;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Custom scrollbar for guide */
.guide-scroll-container::-webkit-scrollbar {
  width: 8px;
}

.guide-scroll-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.guide-scroll-container::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.5) 0%, rgba(91, 159, 255, 0.5) 100%);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.guide-scroll-container::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.7) 0%, rgba(91, 159, 255, 0.7) 100%);
  background-clip: padding-box;
}

.guide-text {
  text-align: left;
  font-size: 16px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: 0.01em;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.guide-text h3 {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 1rem 0;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.guide-text p {
  margin: 0 0 1.25rem 0;
  color: rgba(255, 255, 255, 0.9);
}

.guide-text ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
  list-style: none;
}

.guide-text ul li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
}

.guide-text ul li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: #00d4ff;
  font-weight: bold;
  font-size: 14px;
}

.guide-text strong {
  color: #fff;
  font-weight: 600;
}

.guide-text p strong[style*="color: Green"] {
  color: #4ade80 !important;
  font-weight: 600;
}

.guide-text p span[style*="color: Green"] {
  color: #4ade80 !important;
}

/* Pro Tip styling */
.guide-text p:has(strong[style*="color: Green"]) {
  background: rgba(74, 222, 128, 0.1);
  border-left: 3px solid #4ade80;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin: 1.5rem 0;
}

.guide-image {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  margin-bottom: 1.5rem;
  display: block;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease;
}

.guide-image:hover {
  transform: scale(1.02);
}

/* Two-column layout for pages 2-3 */
.guide-text .guide-two-column {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 2rem;
  margin: 0;
}

.guide-text .guide-two-column img {
  width: 240px;
  height: auto;
  flex-shrink: 0;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease;
}

.guide-text .guide-two-column img:hover {
  transform: scale(1.03);
}

.guide-text .guide-two-column .guide-text-content {
  flex: 1;
  min-width: 0;
}

.guide-text .guide-two-column .guide-text-content h3 {
  margin-top: 0;
}

/* Navigation buttons */
.guide-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.guide-nav-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 12px 24px;
  background: linear-gradient(135deg, #00d4ff 0%, #5b9fff 100%);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(91, 159, 255, 0.3);
  min-width: 100px;
}

.guide-nav-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(91, 159, 255, 0.4);
  background: linear-gradient(135deg, #00e5ff 0%, #6ba8ff 100%);
}

.guide-nav-button:active:not(:disabled) {
  transform: translateY(0);
}

.guide-nav-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.guide-nav-button-secondary {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.guide-nav-button-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.guide-nav-icon {
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .guide-text .guide-two-column {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .guide-text .guide-two-column img {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }
  
  .guide-navigation {
    flex-wrap: wrap;
  }
  
  .guide-nav-button {
    flex: 1;
    min-width: 80px;
  }
}

.result-message {
  margin-top: 10px;
  font-size: 14px;
  color: #fff;
}

.slicer-entry {
  margin-bottom: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.slicer-entry .form-group {
  margin-bottom: 0.5rem;
}

.slicer-entry input {
  width: 100%;
  padding: 8px;
  margin-bottom: 0.5rem;
  border: 1px solid #555;
  border-radius: 4px;
  background-color: #444;
  color: #fff;
}

.slicer-entry .input-with-icon {
  position: relative;
  width: 100%;
}

.slicer-entry .input-with-icon input {
  padding: 12px 90px 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  color: #fff;
  transition: all 0.3s ease;
  box-sizing: border-box;
  margin-bottom: 0;
}

.slicer-entry .input-with-icon input:focus {
  outline: none;
  border-color: #00d4ff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), 0 4px 12px rgba(0, 212, 255, 0.2);
}

.slicer-entry .icon-button {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  min-width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  margin: 0;
}

.slicer-entry .browse-slicer-button {
  right: 44px;
  z-index: 10;
}

.slicer-entry .remove-slicer-button {
  right: 4px;
  z-index: 11;
}

.remove-slicer-button {
  color: #ff4444;
  font-size: 1.2em;
}

.remove-slicer-button:hover {
  background-color: #ff4444;
  color: white;
}

#add-slicer-button {
  margin: 1rem 0;
  width: 100%;
}

#slicer-list {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 1rem;
}

/* Ensure consistent styling for virtual grid */
.file-grid {
  padding: 10px 20px; /* Small top padding to prevent menu overlap, keep horizontal */
  /* Preserve hexagon pattern background - explicitly set to ensure it works on all platforms */
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='52' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l26 15v30l-26 15-26-15V15z' fill='none' stroke='rgba(0,212,255,0.04)' stroke-width='0.5'/%3E%3Cpath d='M0 26l30-15 30 15M0 26l30 15 30-15' fill='none' stroke='rgba(0,212,255,0.04)' stroke-width='0.5'/%3E%3C/svg%3E");
  background-size: 60px 52px;
  background-position: 0 0;
}

.file-grid .file-item {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  width: 100%;
  box-sizing: border-box;
}

.file-grid .file-item:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 32px rgba(0, 212, 255, 0.2), 0 4px 16px rgba(0, 0, 0, 0.3);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(0, 150, 200, 0.5);
}

.file-grid .file-item.selected {
  outline: 3px solid #00d4ff;
  background: rgba(0, 212, 255, 0.1);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
}

.file-grid .thumbnail-container {
  position: relative;
  width: 100%;
  height: 250px;
  background: var(--model-background-color, #070147);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: context-menu;
  box-sizing: border-box;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.file-grid .thumbnail-container:hover {
  box-shadow: 0 6px 20px rgba(0, 212, 255, 0.2);
}

.file-grid .thumbnail-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  box-sizing: border-box;
}

.file-grid .file-info {
  padding: 8px 0;
  width: 100%;
  box-sizing: border-box;
}

.file-grid .file-name {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-grid .file-details {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.file-grid .metadata-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  border-radius: 0;
  border: none;
  margin-top: 8px;
}

.file-grid .metadata-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 2px 0;
  transition: all 0.2s ease;
  overflow: visible;
  width: 100%;
  min-width: 0;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 0;
}

.file-grid .metadata-item.directory-item {
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 4px;
  margin: 0;
}

.file-grid .metadata-item.directory-item:hover {
  background: rgba(74, 158, 255, 0.1);
}

.file-grid .metadata-icon {
  font-size: 14px;
  opacity: 0.7;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

.file-grid .metadata-item.designer-item .metadata-icon {
  filter: hue-rotate(240deg) saturate(1.5) brightness(1.2);
}

.file-grid .metadata-value {
  color: #ccc;
  font-weight: 400;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  max-width: 100%;
}

.file-grid .metadata-value.file-size {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: fit-content;
}

.file-grid .metadata-value.directory-link {
  color: #4a9eff;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.file-grid .metadata-item.directory-item:hover .metadata-value.directory-link {
  color: #6bb3ff;
}

.file-grid .metadata-value.file-size {
  color: #aaa;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  letter-spacing: 0.3px;
}

.file-grid .metadata-value.designer-info {
  color: #bbb;
  font-weight: 500;
}

.file-grid .print-status {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  color: #fff;
  z-index: 2;
}

.file-grid .print-status.printed {
  background: rgba(46, 204, 113, 0.6);
}

.file-grid .archive-status {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 152, 0, 0.6);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  color: #fff;
  z-index: 2;
}

.duplicate-group-header {
  font-size: 13px;
  color: #ccc;
  margin-bottom: 5px;
  padding: 3px 0;
}

.duplicate-count {
  font-size: 12px;
  color: #aaa;
}

.modal-footer {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

#accept-terms, #decline-terms {
  width: 120px;
  padding: 8px;
  font-size: 14px;
}

/* Styles for filter pills */
.filter-pills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  margin-bottom: 8px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 212, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 150, 200, 0.5);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  transition: all 0.3s ease;
}

.filter-pill.inverted {
  background: rgba(239, 68, 68, 0.20);
  border-color: rgba(239, 68, 68, 0.6);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.35);
}

.pill-invert {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  margin-left: 6px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.35);
  color: #ffeaea;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.3px;
}

.filter-pill:hover {
  background: rgba(0, 212, 255, 0.25);
  border-color: rgba(0, 212, 255, 0.5);
  transform: translateY(-1px);
}

.filter-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.filter-remove:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

/* Add styles for disabled controls during loading/filtering */
.disabled-during-loading {
  opacity: 0.6;
  cursor: not-allowed !important;
  pointer-events: none;
}

/* Add overlay effect for the entire filter section during loading */
.filter-section.loading {
  position: relative;
}

.filter-section.loading::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.5);
  z-index: 10;
  border-radius: 8px;
}

/* Add loading message overlay */
.filter-section.loading::before {
  content: "Loading Models...";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: bold;
  z-index: 11;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}

/* Enhance the spinner visibility */
#spinner:not(.hidden) {
  z-index: 1000;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  padding: 25px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}

/* Add styles for the progress dialog */
.progress-dialog {
  background: #242424;
  color: #fff;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 20px;
  min-width: 500px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.progress-dialog h3 {
  margin-top: 0;
  margin-bottom: 20px;
  color: #fff;
  text-align: center;
  font-size: 18px;
  font-weight: 500;
}

.progress-container {
  margin: 15px 0;
  padding: 15px;
  background-color: #1a1a1a;
  border-radius: 12px;
  border: 1px solid #333;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.progress-container .progress-text {
  margin-top: 4px;
  margin-bottom: 0;
  padding: 0;
  min-height: 18px;
  line-height: 1.4;
  flex-shrink: 0;
}

.progress-container progress {
  width: 100%;
  height: 24px;
  border-radius: 4px;
  -webkit-appearance: none;
  appearance: none;
  margin-bottom: 12px;
}

.progress-container progress::-webkit-progress-bar {
  background-color: #111;
  border-radius: 4px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.progress-container progress::-webkit-progress-value {
  background-color: #3498db;
  border-radius: 4px;
  background-image: linear-gradient(45deg, 
                    rgba(255, 255, 255, .15) 25%, 
                    transparent 25%, 
                    transparent 50%, 
                    rgba(255, 255, 255, .15) 50%, 
                    rgba(255, 255, 255, .15) 75%, 
                    transparent 75%, 
                    transparent);
  background-size: 20px 20px;
  animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
  from { background-position: 0 0; }
  to { background-position: 20px 0; }
}

#hash-progress-text {
  text-align: center;
  font-size: 14px;
  color: #ccc;
  background-color: #2a2a2a;
  padding: 8px;
  border-radius: 4px;
  margin-top: 0;
}

/* Make the hash-generation-warning stand out */
.hash-generation-warning {
  margin-bottom: 15px;
}

@keyframes rotate360 {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.rotating {
  animation: rotate360 0.5s linear;
}

.refresh-button {
  font-size: 20px;
  font-weight: bold;
  color: #4a9eff;
  padding: 2px 5px;
  transition: color 0.2s, transform 0.3s;
}

.refresh-button:hover {
  color: #7bb8ff;
}

/* ===========================
   Preview Modal Styles
   =========================== */

.preview-modal {
  max-width: 90vw;
  max-height: 90vh;
  width: 1200px;
  height: 800px;
  padding: 0;
  border: 1px solid rgba(74, 158, 255, 0.3);
  border-radius: 16px;
  background: rgba(30, 30, 46, 0.95);
  backdrop-filter: blur(20px);
  overflow: hidden;
}

.preview-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 1001;
}

.preview-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  padding-right: 20px;
}

.preview-close-button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 28px;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
  line-height: 1;
  z-index: 1000;
  position: relative;
}

.preview-close-button:hover {
  background: rgba(255, 107, 107, 0.2);
  border-color: rgba(255, 107, 107, 0.4);
  transform: scale(1.05);
}

.preview-close-button:active {
  transform: scale(0.95);
}

.preview-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.preview-canvas-container {
  flex: 1;
  position: relative;
  background: #1a1a2e;
  overflow: hidden;
  min-height: 0;
}

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

.preview-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(26, 26, 46, 0.95);
  z-index: 5;
  gap: 20px;
  pointer-events: none;
}

.preview-loading > * {
  pointer-events: auto;
}

.preview-loading p {
  color: #fff;
  font-size: 16px;
  margin: 0;
  white-space: pre-line;
  text-align: center;
}

.preview-controls {
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: nowrap;
  position: relative;
}

.preview-control-group {
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
}

.preview-control-button {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  min-width: auto;
}

.preview-control-button:hover {
  background: rgba(74, 158, 255, 0.2);
  border-color: rgba(74, 158, 255, 0.4);
  transform: translateY(-2px);
}

.preview-control-button:active {
  transform: translateY(0);
}

.preview-control-button span {
  font-size: 16px;
}

.preview-info {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  margin-top: 4px;
  justify-content: center;
}

.preview-instructions {
  padding: 12px 24px;
  background: rgba(74, 158, 255, 0.1);
  border-top: 1px solid rgba(74, 158, 255, 0.2);
  text-align: center;
}

.preview-instructions p {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
}

.preview-instructions strong {
  color: #4a9eff;
  font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .preview-modal {
    width: 95vw;
    height: 85vh;
  }
}

@media (max-width: 768px) {
  .preview-control-group {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .preview-info {
    position: static;
    transform: none;
    width: 100%;
    justify-content: center;
  }
  
  .preview-instructions {
    font-size: 12px;
  }
  
  .preview-controls {
    flex-wrap: wrap;
  }
  
  .preview-control-button {
    font-size: 13px;
    padding: 8px 16px;
  }
}

/* Manage Thumbnails Modal Styles */
.thumbnails-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  max-height: 500px;
  overflow-y: auto;
  padding: 8px;
  margin-top: 16px;
}

.thumbnail-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
  background: var(--model-background-color);
}

.thumbnail-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.thumbnail-item.active {
  border-color: #00d4ff;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.3);
}

.thumbnail-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumbnail-item-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.thumbnail-item:hover .thumbnail-item-overlay {
  opacity: 1;
}

.thumbnail-item-label {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  z-index: 2;
}

.thumbnail-item.active .thumbnail-item-label {
  background: rgba(0, 212, 255, 0.9);
  color: #000;
}

.thumbnail-item-button {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  margin: 4px;
}

.thumbnail-item-button.set-active {
  background: linear-gradient(135deg, #00d4ff 0%, #5b9fff 100%);
  color: white;
}

.thumbnail-item-button.set-active:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(91, 159, 255, 0.4);
}

.thumbnail-item-button.delete {
  background: rgba(255, 59, 48, 0.9);
  color: white;
}

.thumbnail-item-button.delete:hover {
  background: rgba(255, 59, 48, 1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 59, 48, 0.4);
}

.thumbnail-item-button.delete:disabled {
  background: rgba(128, 128, 128, 0.5);
  color: rgba(255, 255, 255, 0.5);
  cursor: not-allowed;
  transform: none;
}

.thumbnail-item-button.delete:disabled:hover {
  transform: none;
  box-shadow: none;
}