:root {
  --accent-primary: #ff5e00;
  --accent-secondary: #e65500;
  --accent-light: #ff7a33;
  --accent-dark: #cc5200;
  --accent-muted: rgba(255, 94, 0, 0.1);
  --accent-border: rgba(255, 94, 0, 0.2);
  --accent-shadow: rgba(255, 94, 0, 0.3);
}

body {
  height: 100vh;
  overflow: hidden;
}

.container {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

h1 {
  color: #333;
  margin-bottom: 0;
  font-size: 1.5em;
  font-weight: 300;
  text-align: center;
}

.main-content {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Left Panel - Controls */
.left-panel {
  width: 400px;
  background: rgba(255, 255, 255, 0.95);
  border-right: 1px solid #ddd;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Add custom scrollbar styling */
.left-panel::-webkit-scrollbar {
  width: 8px;
}

.left-panel::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

.left-panel::-webkit-scrollbar-thumb {
  background: var(--accent-primary);
  border-radius: 4px;
}

.left-panel::-webkit-scrollbar-thumb:hover {
  background: var(--accent-light);
}

/* Adjust spacing of elements */
.control-group {
  margin-bottom: 0;
  padding: 15px 20px;
}

label {
  display: block;
  margin-bottom: 0px;
  color: #333;
  font-weight: 500;
}

select {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 10px;
  font-size: 16px;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.process-btn {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 10px;
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 15px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  color: white;
}

.process-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px var(--accent-shadow);
}

.process-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.status {
  padding: 15px 20px;
  border-radius: 0;
  text-align: center;
  font-size: 0.9em;
  display: none;
}

.status.success {
  background: rgba(40, 167, 69, 0.1);
  color: #28a745;
  border: 1px solid rgba(40, 167, 69, 0.2);
}

.status.error {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
  border: 1px solid rgba(220, 53, 69, 0.2);
}

.status.processing {
  background: var(--accent-muted);
  color: var(--accent-primary);
  border: 1px solid var(--accent-border);
}

.loading-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid rgba(102, 126, 234, 0.3);
  border-radius: 50%;
  border-top-color: #667eea;
  animation: spin 1s ease-in-out infinite;
  margin-right: 8px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Image tabs in left panel */
.image-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 8px 12px;
  border: 2px solid #ddd;
  background: white;
  border-radius: 0;
  /* Remove border radius */
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.85em;
  font-weight: 500;
  flex: 1;
  text-align: center;
}

.tab-btn.active {
  border-color: var(--accent-primary);
  background: var(--accent-primary);
  color: white;
}

.tab-btn:hover:not(.active) {
  border-color: var(--accent-primary);
}

/* Right Panel - Image Display with external rulers */
.right-panel {
  flex: 1;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.image-display {
  position: absolute;
  top: 30px;
  left: 30px;
  right: 0;
  bottom: 0;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  background: #f8f9fa;
  overflow: hidden;
}

.image-display.has-grid {
  background-image:
    linear-gradient(to right, rgba(200, 200, 200, 0.3) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(200, 200, 200, 0.3) 1px, transparent 1px);
  background-repeat: repeat;
}

.image-display.has-image {
  border-color: var(--accent-primary);
  background-color: white;
}

.upload-download-section {
  display: flex;
  gap: 0;
  margin-bottom: 0;
}

.file-upload {
  flex: 3;
  /* 75% of the width */
  position: relative;
  display: inline-block;
}

.file-upload-input {
  position: absolute;
  left: -9999px;
}

.file-upload-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100px;
  border: 3px dashed var(--accent-primary);
  border-radius: 0;
  /* Remove border radius */
  background: var(--accent-muted);
  cursor: pointer;
  transition: all 0.3s ease;
  flex-direction: column;
  gap: 0px;
  border-right: none;
  /* Remove right border to connect with download button */
}

.file-upload-label:hover {
  border-color: var(--accent-secondary);
  background: var(--accent-muted);
  transform: translateY(-2px);
}

.upload-icon {
  font-size: 2em;
  color: var(--accent-primary);
}

.upload-text {
  color: #666;
  font-size: 1em;
  text-align: center;
}

.download-btn {
  flex: 1;
  /* 25% of the width */
  height: 100px;
  border: 3px solid var(--accent-primary);
  border-left: none;
  /* Remove left border to connect with upload */
  border-radius: 0;
  /* Remove border radius */
  font-size: 2em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.download-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(40, 167, 69, 0.3);
}

.download-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

.file-info {
  background: var(--accent-muted);
  padding: 15px;
  border-radius: 10px;
  margin: 15px 0;
  display: none;
}

.file-info h3 {
  color: #333;
  margin-bottom: 10px;
  font-size: 1.1em;
}

.file-details {
  color: #666;
  font-size: 0.9em;
}

.placeholder-text {
  color: #999;
  font-size: 1.2em;
  text-align: center;
}

.image-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 0;
  /* Ensure images stay below rulers */
}

.image-preview {
  max-width: calc(100% - 20px);
  max-height: calc(100% - 20px);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  object-fit: contain;
}

/* Canvas specific styling to fill entire display */
canvas.image-preview {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  border-radius: 0;
  box-shadow: none;
  object-fit: fill;
}

/* Canvas container for handling overflow */
.canvas-container {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}

/* Canvas with overflow capability */
canvas.image-preview {
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  border-radius: 0;
  box-shadow: none;
  object-fit: none;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.image-view {
  display: none;
  width: 100%;
  height: 100%;
}

.image-view.active {
  display: block;
  width: 100%;
  height: 100%;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
  .main-content {
    flex-direction: column;
    position: relative;
  }

  .left-panel {
    width: 100%;
    height: 60vh;
    max-height: 60vh;
    border-right: none;
    border-bottom: none;
    order: 2;
    position: relative;
  }

  .right-panel {
    height: 40vh;
    min-height: 40vh;
    order: 1;
    position: relative;
  }

  /* Horizontal separator line between panels */
  .left-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    box-shadow: 0 2px 4px var(--accent-shadow);
  }
}

@media (max-width: 600px) {
  h1 {
    font-size: 1.4em;
    margin-bottom: 0px;
  }

  .left-panel {
    padding: 0px;
  }

  /* Mobile footer fixes */
  .footer {
    padding: 20px 20px 40px 20px;
    /* Increased bottom padding for mobile */
    margin-bottom: env(safe-area-inset-bottom, 20px);
    /* Support for safe areas on modern mobile browsers */
  }

  /* Ensure the left panel has enough bottom space on mobile */
  .left-panel {
    padding-bottom: env(safe-area-inset-bottom, 20px);
  }
}

/* Additional mobile-specific rules for very small screens */
@media (max-width: 480px) {
  .footer {
    padding: 20px 15px 50px 15px;
    /* Even more bottom padding for very small screens */
    margin-bottom: env(safe-area-inset-bottom, 30px);
  }

  .left-panel {
    padding-bottom: env(safe-area-inset-bottom, 30px);
  }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
  .footer {
    padding-bottom: calc(40px + env(safe-area-inset-bottom, 20px));
  }

  .left-panel {
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 20px));
  }
}

/* Additional mobile layout improvements */
@media (max-width: 1024px) {
  .left-panel {
    /* Ensure the panel can scroll properly on mobile */
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }

  /* Make sure footer is always at the bottom of the scrollable area */
  .footer {
    position: relative;
    z-index: 10;
  }
}

/* Ensure footer is visible on all mobile devices */
@media (max-width: 768px) {
  .footer {
    /* Force footer to be visible */
    position: relative;
    z-index: 10;
    background: #f8f9fa;
    /* Add a subtle shadow to make it stand out */
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  }

  /* Ensure the left panel has proper spacing */
  .left-panel {
    /* Add bottom margin to account for browser UI */
    margin-bottom: env(safe-area-inset-bottom, 0px);
  }
}

.number-input {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 10px;
  font-size: 16px;
  background: white;
  transition: all 0.3s ease;
}

.number-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.pattern-info {
  background: transparent;
  padding: 0;
  border-radius: 0;
  margin-top: 15px;
}

.pattern-info h3 {
  color: #333;
  margin-bottom: 15px;
  font-size: 1.1em;
}

.info-box {
  background: transparent;
  padding: 0;
  border-radius: 0;
  margin-bottom: 0;
  box-shadow: none;
  border: none;
}

.info-box:last-child {
  margin-bottom: 0;
}

.info-box h3 {
  color: #333;
  margin-bottom: 12px;
  font-size: 1.0em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-count-display {
  background: var(--accent-muted);
  color: var(--accent-primary);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.9em;
  font-weight: 600;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 15px;
}

.info-item {
  background: white;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.info-item.full-width {
  grid-column: 1 / -1;
  /* Span all columns */
}

.info-label {
  display: block;
  font-size: 0.8em;
  color: #666;
  margin-bottom: 4px;
}

.info-value {
  display: block;
  font-size: 1.1em;
  color: #333;
  font-weight: 600;
}

.info-note {
  display: block;
  font-size: 0.8em;
  color: #666;
  font-style: italic;
  margin-top: 2px;
}

.color-list {
  margin-top: 10px;
}

.color-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 8px;
  margin-bottom: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.color-item:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.color-item:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.color-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.9);
  padding: 4px 8px;
  border-radius: 6px;
  margin: 2px;
}

.color-number {
  font-weight: 600;
  color: #333;
}

.color-rgb {
  font-size: 0.8em;
  color: #666;
}

.color-count {
  font-size: 0.85em;
  color: #666;
  margin-top: 2px;
}

.color-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.9);
  padding: 4px;
  border-radius: 4px;
}

.color-action-btn {
  background: none;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #666;
}

.color-action-btn:hover {
  background: #f0f0f0;
  border-color: #999;
  color: #333;
}

.color-action-btn:active {
  transform: scale(0.95);
}

.select-all-btn:hover {
  background: #e3f2fd;
  border-color: #2196f3;
  color: #1976d2;
}

.replace-btn:hover {
  background: #fff3e0;
  border-color: #ff9800;
  color: #f57c00;
}

.delete-btn:hover {
  background: #ffebee;
  border-color: #f44336;
  color: #d32f2f;
}

/* Pinned Colors Section */
.pinned-colors-section {
  margin-top: 20px;
  border-top: 1px solid #eee;
  padding-top: 15px;
  position: relative;
}

.pinned-colors-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.pinned-colors-header h4 {
  margin: 0;
  color: #333;
  font-size: 14px;
  font-weight: 600;
}

.add-pinned-color-btn {
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.add-pinned-color-btn:hover {
  background: var(--accent-dark);
  transform: scale(1.1);
}

/* Dynamic dropdown positioning */
#dynamic-dmc-dropdown {
  position: fixed;
  z-index: 1000;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 400px;
  overflow-y: auto;
  width: 380px;
  max-width: calc(100vw - 20px);
}

.dmc-colors-expandable {
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin: 10px 0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 1000;
  max-height: 400px;
}

.dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: #f8f9fa;
  border-bottom: 1px solid #eee;
  font-weight: 600;
  color: #333;
}

.expandable-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: #f8f9fa;
  border-bottom: 1px solid #eee;
  font-weight: 600;
  color: #333;
}

.close-dropdown-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-expandable-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-dropdown-btn:hover {
  color: #333;
}

.close-expandable-btn:hover {
  color: #333;
}

.dmc-search-input {
  width: 100%;
  padding: 10px 15px;
  border: none;
  border-bottom: 1px solid #eee;
  font-size: 14px;
  outline: none;
}

.dmc-search-input:focus {
  border-bottom-color: var(--accent-primary);
}

.dmc-color-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px 15px;
  background: #f8f9fa;
  border-bottom: 1px solid #eee;
}

.category-btn {
  background: white;
  border: 1px solid #ddd;
  border-radius: 16px;
  padding: 4px 12px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #666;
  white-space: nowrap;
}

.category-btn:hover {
  background: #f0f0f0;
  border-color: #999;
  color: #333;
}

.category-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.dmc-colors-list {
  max-height: 250px;
  overflow-y: auto;
  background: white;
}

.dmc-color-item {
  display: flex;
  align-items: center;
  padding: 8px 15px;
  cursor: pointer;
  transition: background-color 0.2s;
  border-bottom: 1px solid #f0f0f0;
}

.dmc-color-item:hover {
  background-color: #f8f9fa;
}

.dmc-color-item:last-child {
  border-bottom: none;
}

.dmc-color-item .color-details {
  display: flex;
  flex-direction: column;
}

.dmc-color-item .color-name {
  font-weight: 600;
  color: #333;
  font-size: 13px;
}

.dmc-color-item .color-code {
  font-size: 11px;
  color: #666;
  margin-top: 1px;
}

.pinned-colors-list {
  max-height: 200px;
  overflow-y: auto;
}

.pinned-color-item {
  display: flex;
  align-items: center;
  padding: 6px;
  border-radius: 6px;
  margin-bottom: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.pinned-color-item:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.pinned-color-item .color-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.9);
  padding: 4px 6px;
  border-radius: 4px;
  margin: 2px;
}

.pinned-color-item .color-name {
  font-weight: 600;
  color: #333;
  font-size: 12px;
}

.pinned-color-item .color-code {
  font-size: 10px;
  color: #666;
  margin-top: 1px;
}

.remove-pinned-color-btn {
  background: #ff4444;
  color: white;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-left: 8px;
}

.remove-pinned-color-btn:hover {
  background: #ff0000;
  transform: scale(1.1);
}

.no-pinned-colors {
  text-align: center;
  color: #999;
  font-size: 12px;
  font-style: italic;
  padding: 10px;
}

/* Ruler corner square */
.ruler-corner {
  position: absolute;
  top: 0;
  left: 0;
  width: 30px;
  height: 30px;
  background: var(--accent-primary);
  z-index: 1;
}

/* Ruler styles - positioned to align with display window edges */
.ruler {
  position: absolute;
  z-index: 1;
  box-shadow: none;
}

.horizontal-ruler {
  top: 0;
  left: 30px;
  right: 0;
  height: 30px;
  background: linear-gradient(45deg,
      var(--accent-primary) 0%,
      var(--accent-secondary) 100%);
  border-bottom: 1px solid var(--accent-secondary);
}

.vertical-ruler {
  top: 30px;
  left: 0;
  bottom: 0;
  width: 30px;
  background: linear-gradient(45deg,
      var(--accent-secondary) 0%,
      var(--accent-primary) 100%);
  border-right: 1px solid var(--accent-secondary);
}

.ruler-mark {
  position: absolute;
  color: #fff;
  font-size: 24px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-weight: 500;
  z-index: 2;
}

.horizontal-mark {
  top: 2px;
  transform: translateX(4px);
  padding-top: 2px;
}

.vertical-mark {
  right: 4px;
  transform: translateY(2px);
  /* Push numbers down */
  color: #fff;
  font-size: 24px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-weight: 500;
}

/* Major tick marks (whole inches) */
.tick-major {
  position: absolute;
  background-color: #fff;
  z-index: 2;
}

.horizontal-tick-major {
  width: 2px;
  height: 20px;
  bottom: 0;
}

.vertical-tick-major {
  height: 2px;
  width: 20px;
  right: 0;
}

/* Half-inch tick marks */
.tick-half {
  position: absolute;
  background-color: rgba(255, 255, 255, 0.8);
  z-index: 2;
}

.horizontal-tick-half {
  width: 1px;
  height: 15px;
  bottom: 0;
}

.vertical-tick-half {
  height: 1px;
  width: 15px;
  right: 0;
}

/* Quarter-inch tick marks */
.tick-quarter {
  position: absolute;
  background-color: rgba(255, 255, 255, 0.6);
  z-index: 2;
}

.horizontal-tick-quarter {
  width: 1px;
  height: 10px;
  bottom: 0;
}

.vertical-tick-quarter {
  height: 1px;
  width: 10px;
  right: 0;
}

/* Unit label styles */
.unit-label {
  font-size: 10px;
  color: #000;
  opacity: 0.7;
  margin-left: 2px;
}

/* Slider input styles */
.slider-input {
  width: 100%;
  height: 8px;
  border-radius: 5px;
  background: #ddd;
  outline: none;
  opacity: 0.7;
  transition: opacity 0.2s, background 0.2s;
  -webkit-appearance: none;
  appearance: none;
  margin: 10px 0;
}

.slider-input:hover {
  opacity: 1;
}

.slider-input:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Webkit browsers (Chrome, Safari, Edge) */
.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.slider-input::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.slider-input:disabled::-webkit-slider-thumb {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Firefox */
.slider-input::-moz-range-thumb {
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.slider-input::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.slider-input:disabled::-moz-range-thumb {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.slider-input::-moz-range-track {
  height: 8px;
  border-radius: 5px;
  background: #ddd;
  border: none;
}

.slider-input:disabled::-moz-range-track {
  background: #f0f0f0;
}

/* Slider value display */
.slider-value {
  display: inline-block;
  min-width: 30px;
  font-weight: 600;
  color: var(--accent-primary);
  background: var(--accent-muted);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.9em;
}

/* Toggle switch styles */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-weight: 500;
  color: #333;
}

.toggle-input {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 50px;
  height: 24px;
  background-color: #ddd;
  border-radius: 24px;
  transition: background-color 0.3s ease;
}

.toggle-slider:before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-input:checked+.toggle-slider {
  background-color: var(--accent-primary);
}

.toggle-input:checked+.toggle-slider:before {
  transform: translateX(26px);
}

.toggle-slider:hover {
  box-shadow: 0 0 0 3px var(--accent-muted);
}

/* Dimensions display styles */
.dimensions-display {
  background: var(--accent-muted);
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 15px;
  border: 1px solid var(--accent-border);
}

.dimension-line {
  font-size: 0.95em;
  color: #333;
  margin-bottom: 6px;
  line-height: 1.4;
}

.dimension-line:last-child {
  margin-bottom: 0;
}

.fabric-count-input {
  width: 50px;
  padding: 4px 6px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 0.9em;
  text-align: center;
  background: white;
  transition: all 0.3s ease;
  margin: 0 4px;
}

.fabric-count-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-muted);
}

.fabric-count-input:hover {
  border-color: var(--accent-primary);
}

/* DMC Information Styles */
.dmc-info {
  margin-top: 4px;
  font-size: 0.85em;
}

.dmc-code {
  font-weight: bold;
  color: var(--accent-primary);
  display: block;
}

.dmc-name {
  color: #666;
  font-style: italic;
  display: block;
  margin-top: 2px;
}

.color-picker-section {
  margin-top: 20px;
  border-top: 1px solid #ccc;
  padding-top: 15px;
}

.color-picker-section h3 {
  margin: 0 0 10px 0;
  font-size: 1.1em;
  color: #333;
}

.color-picker-container {
  background: white;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 10px;
  max-height: 400px;
  overflow-y: auto;
}

.color-picker-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.color-option {
  display: flex;
  align-items: center;
  padding: 5px;
  cursor: pointer;
  border-radius: 3px;
  transition: background-color 0.2s;
}

.color-option:hover {
  background-color: #f0f0f0;
}

.color-info {
  flex: 1;
  font-size: 0.9em;
}

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

.search-input {
  width: 100%;
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 0.9em;
}

.section-title {
  padding: 5px;
  background-color: #f0f0f0;
  font-weight: bold;
  border-bottom: 1px solid #ccc;
  margin: 10px 0 5px 0;
}

.section-separator {
  height: 1px;
  background-color: #ccc;
  margin: 10px 0;
}

.delete-button {
  width: 100%;
  padding: 8px;
  margin-top: 10px;
  background-color: #ff4444;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.9em;
  transition: background-color 0.2s;
}

.delete-button:hover {
  background-color: #ff0000;
}

/* Accordion Styles */
.accordion {
  border: 1px solid #ddd;
  border-radius: 0;
  margin-bottom: 0;
  overflow: hidden;
  background: white;
  position: relative;
  flex-shrink: 0;
}

.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: #f8f9fa;
  cursor: pointer;
  transition: background-color 0.3s ease;
  border-bottom: 1px solid #ddd;
  position: relative;
  z-index: 1;
}

.accordion-header:hover {
  background: #e9ecef;
}

.accordion-title {
  font-weight: 600;
  color: #333;
  font-size: 16px;
}

.accordion-icon {
  font-size: 12px;
  color: #666;
  transition: transform 0.3s ease;
}

.accordion.collapsed .accordion-icon {
  transform: rotate(-90deg);
}

.accordion-content {
  padding: 20px;
  background: white;
  transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
  max-height: none;
  opacity: 1;
  overflow: visible;
  position: relative;
  flex-shrink: 0;
}

.accordion.collapsed .accordion-content {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
}

/* Ensure proper spacing within accordion content */
.accordion-content .control-group:last-child {
  margin-bottom: 0;
}

/* Footer Section Styles */
.footer {
  margin-top: auto;
  padding: 20px;
  background: #f8f9fa;
  border-top: 1px solid #ddd;
  text-align: center;
  flex-shrink: 0;
}

.dmc-colors-link {
  display: inline-block;
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 16px;
  border: 2px solid var(--accent-primary);
  border-radius: 20px;
  transition: all 0.3s ease;
  margin-bottom: 12px;
  background: white;
}

.dmc-colors-link:hover {
  background: var(--accent-primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--accent-shadow);
}

.footer-text {
  color: #666;
  font-size: 12px;
  margin: 0;
  font-style: italic;
  line-height: 1.4;
}

.accordion-content .control-group {
  flex-shrink: 0;
}

.accordion-content .dimensions-display {
  margin-top: 15px;
  flex-shrink: 0;
}

.accordion-content .pattern-info {
  margin-top: 15px;
  flex-shrink: 0;
}

.selection-status {
  background: var(--accent-muted);
  color: var(--accent-primary);
  padding: 10px;
  border-radius: 8px;
  margin: 15px 0;
  font-size: 0.9em;
  border: 1px solid var(--accent-border);
  text-align: center;
}

.selection-status #selectionCount {
  font-weight: bold;
  color: #333;
}

.color-selection-subtitle {
  font-size: 0.9em;
  color: #666;
  margin-bottom: 15px;
  line-height: 1.4;
}

/* Flood Selection Control Styles */
.flood-selection-control {
  background: var(--accent-muted);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 15px;
  border: 1px solid var(--accent-border);
}

.flood-selection-help {
  font-size: 0.85em;
  color: #666;
  margin-top: 8px;
  line-height: 1.3;
}

.color-picker-container {
  margin-top: 15px;
  border-top: 1px solid #ccc;
  padding-top: 15px;
}

.color-picker-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.color-option {
  display: flex;
  align-items: center;
  padding: 5px;
  cursor: pointer;
  border-radius: 3px;
  transition: background-color 0.2s;
}

.color-option:hover {
  background-color: #f0f0f0;
}

.color-info {
  flex: 1;
  font-size: 0.9em;
}

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

.search-input {
  width: 100%;
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 0.9em;
}

.section-title {
  padding: 5px;
  background-color: #f0f0f0;
  font-weight: bold;
  border-bottom: 1px solid #ccc;
  margin: 10px 0 5px 0;
}

.section-separator {
  height: 1px;
  background-color: #ccc;
  margin: 10px 0;
}

.delete-button {
  width: 100%;
  padding: 8px;
  margin-top: 10px;
  background-color: #ff4444;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.9em;
  transition: background-color 0.2s;
}

.delete-button:hover {
  background-color: #ff0000;
}
