/* Base reset + typography */
* {
  box-sizing: border-box;
}
html, body, #redwood-app {
  height: 100%;
}
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: #0f172a; /* slate-900 */
  background: #f8fafc; /* slate-50 */
}

/* Layout helpers */
.app-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 50%, #eef2ff 100%);
  position: relative;
}
.full-screen-center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.container {
  margin: 0 auto;
  padding: 2rem 1rem;
}
.navbar .container {
  padding: 0;
}

/* Flexbox utilities */
.row {
  display: flex;
  width: 100%;
  flex-direction: row;
}
.row-center {
  align-items: center;
}
.row-between {
  justify-content: space-between;
}
.row-around {
  justify-content: space-around;
}
.row-end {
  justify-content: flex-end;
}
.row-start {
  justify-content: flex-start;
}
.col {
  display: flex;
  flex-direction: column;
}
.col-center {
  align-items: center;
}
.col-between {
  justify-content: space-between;
}
.center {
  display: flex;
  align-items: center;
  justify-content: center;
}
.flex-wrap {
  flex-wrap: wrap;
}
.flex-nowrap {
  flex-wrap: nowrap;
}
.flex-1 {
  flex: 1;
}
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }

/* Spacing utilities */
.m-0 { margin: 0; }
.m-1 { margin: 0.25rem; }
.m-2 { margin: 0.5rem; }
.m-3 { margin: 0.75rem; }
.m-4 { margin: 1rem; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }

/* Card, glass, shadows */
.glass-effect {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.6);
}
.card {
  border-radius: 1rem;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.6);
}
.card-warning {
  background: rgba(254, 242, 242, 0.8);
  border-color: #fecaca; /* red-200 */
}
.shadow-glow {
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.25);
}
.shadow-glow-hover:hover {
  box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.35);
}

/* Decorative background circles */
.bg-circle {
  position: absolute;
  width: 24rem; /* 384px */
  height: 24rem;
  border-radius: 9999px;
  filter: blur(48px);
  z-index: -1;
  opacity: 0.6;
}
.bg-circle.top-right { top: 0; right: 0; }
.bg-circle.bottom-left { bottom: 0; left: 0; }
.bg-circle.cool {
  background: linear-gradient(135deg, rgba(199,210,254,0.6), rgba(221,214,254,0.6));
}
.bg-circle.warm {
  background: linear-gradient(135deg, rgba(254,226,226,0.6), rgba(254,240,138,0.6));
}

/* Gradients */
.gradient-bg { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.gradient-bg-success { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.gradient-bg-warning { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }

.title-gradient-indigo {
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.title-gradient-red {
  background: linear-gradient(90deg, #dc2626, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Typography */
h1, .heading-1 {
  font-size: 1.2rem;
  line-height: 1.25;
  font-weight: 800;
  margin: 0;
}
h2, .heading-2 {
  font-size: 1.25rem;
  line-height: 1.4;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
}
h3, .heading-3 {
  font-size: 1.125rem;
  line-height: 1.4;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}
.lead {
  font-size: 1.125rem;
  line-height: 1.5;
  color: #475569;
  margin: 0 0 1rem 0;
}
.text-muted {
  color: #64748b;
}
.text-danger {
  color: #b91c1c;
}
.text-sm {
  font-size: 0.875rem;
  line-height: 1.4;
}
.text-xs {
  font-size: 0.75rem;
  line-height: 1.4;
}
.text-center {
  text-align: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.4;
  color: #fff;
  transition: all 0.2s ease;
  text-decoration: none;
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.btn:active:not(:disabled) {
  transform: translateY(0);
}
.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.btn-success {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}
.btn-gray {
  background: #475569;
}
.btn-gray:hover:not(:disabled) {
  background: #334155;
}
.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
}
.badge-blue {
  background: #dbeafe;
  color: #1d4ed8;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}
.label {
  display: inline;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
  margin-right: 0.5rem;
  line-height: 1.4;
}
.input {
  display: inline-block;
  padding: .5rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  background: #fff;
  font-size: 1rem;
  line-height: 1.5;
  outline: none;
  transition: all 0.2s ease;
}
.input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.input.monospace {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Focus ring helper for non-input elements */
.focus-ring:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  border-radius: 0.75rem;
}


/* Card, glass, shadows */
.glass-effect {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.6);
}
.card {
  border-radius: 1rem;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.6);
  display: flex;
  flex-direction: column;
}
.card-warning {
  background: rgba(254, 242, 242, 0.8);
  border-color: #fecaca;
}
.shadow-glow {
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.25);
}
.shadow-glow-hover:hover {
  box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.35);
}

/* Icons */
.icon { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
.icon-sm { width: 1rem; height: 1rem; }
.icon-lg { width: 1.5rem; height: 1.5rem; }
.icon-xl { width: 2rem; height: 2rem; }

/* Animated helpers */
@keyframes spin { to { transform: rotate(360deg); } }
.animate-spin { animation: spin 1s linear infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.animate-float { animation: float 6s ease-in-out infinite; }
@keyframes pulseGlow { 0% { box-shadow: 0 0 20px rgba(102, 126, 234, 0.35);} 100% { box-shadow: 0 0 30px rgba(102, 126, 234, 0.6);} }
.animate-pulse-glow { animation: pulseGlow 2s ease-in-out infinite alternate; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
.animate-pulse { animation: pulse 1.5s ease-in-out infinite; }
@keyframes ping { 0% { transform: scale(1); opacity: 1;} 75%,100% { transform: scale(2); opacity: 0;} }
.animate-ping { animation: ping 1.5s cubic-bezier(0,0,0.2,1) infinite; }
.animate-fadeIn { animation: fadeIn 0.4s ease-out forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: translateY(0);} }
@keyframes scaleFadeIn { from { opacity: 0; transform: scale(0.8);} to { opacity: 1; transform: scale(1);} }

/* Components specific */
.navbar {
  position: sticky;
  top: 0;
  z-index: 10;
}
.navbar-inner {
  height: 5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
}
.logo-badge {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.panel-padding {
  padding: 0 1.5rem 1.5rem;
}
.panel-header {
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}



.product-color-scale {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
  overflow-y: auto;
  padding: 1rem;
  max-width: 100%;
  justify-content: flex-start;
  align-items: flex-start;
}

/* Brick layout - sorted by default color first, then by SKU count, then out of stock */

.style-tree-page .product-color-scale{
  height: initial;
  max-height: initial;
  overflow: initial;
}

/* Color leaf */
.color-leaf {
  grid-area: "instock";
  width: 100%;
  max-width: 240px;
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border: 1px solid rgba(203, 213, 225, 0.6);
  border-radius: 0.75rem;
  padding: 0.75rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.9));
  transition: all 0.2s ease;
}
.color-leaf.defaultColor {
  border: 2px solid #fbbf24;
  box-shadow: 0 0 10px rgba(255, 187, 17, 0.8);
}
.color-leaf:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.8);
}
.color-leaf.defaultColor:hover{
  border-width: 3px;
  box-shadow: 0 2px 10px rgba(255, 187, 17, 0.9);
}
.color-leaf .dot {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}
.color-leaf .code {
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: #334155;
  background: rgba(255, 255, 255, 0.8);
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-weight: 600;
  line-height: 1.4;
}
.color-leaf .name {
  font-size: 0.875rem;
  color: #475569;
  margin-top: 0.25rem;
  line-height: 1.4;
}
.color-leaf .overlay {
  position: absolute;
  inset: 0;
  border-radius: 0.75rem;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0));
  transition: opacity 0.3s ease;
}
.color-leaf:hover .overlay {
  opacity: 1;
}

/* Drag and drop styles */
.color-leaf.dragging {
  opacity: 0.5;
  transform: rotate(5deg);
  z-index: 1000;
}

.color-leaf .drag-handle {
  transition: opacity 0.2s ease;
  opacity: 0;
}

.color-leaf:hover .drag-handle {
  opacity: 1;
}

.drag-preview {
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #3b82f6;
  border-radius: 0.75rem;
  padding: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* Drop zone styles */
.color-leaf.drop-over {
  border: 2px dashed #10b981;
  background: rgba(16, 185, 129, 0.1);
  transform: scale(1.05);
  transition: all 0.2s ease;
}

/* Color scale drop zone */
.product-color-scale.scale-drop-over {
  background: rgba(16, 185, 129, 0.05);
  border: 2px dashed #10b981;
  border-radius: 0.75rem;
  padding: 0.5rem;
  transition: all 0.2s ease;
}

/* Style tree layer drop zone - only accepts ColorLeafs */
.styleTreeLayer.style-tree-drop-over {
  background: rgba(16, 185, 129, 0.08);
  border: 3px dashed #10b981;
  border-radius: 1rem;
  padding: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

/* Migrated color highlighting */
.color-leaf.migratedColor {
  border: 3px solid #f59e0b;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
  position: relative;
  animation: migratedPulse 2s ease-in-out;
}

.color-leaf.migratedColor::before {
  content: '＊ Migrated';
  position: absolute;
  top: -8px;
  left: 0px;
  background: #f59e0b;
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.4rem;
  border-radius: 0.3rem;
  z-index: 10;
  white-space: nowrap;
}

/* Ghosted child color styling */
.color-leaf.ghostedColor {
  opacity: 0.4;
  border: 2px dashed #9ca3af;
  background: rgba(156, 163, 175, 0.1);
  position: relative;
  filter: grayscale(60%);
  transition: all 0.3s ease;
  cursor: not-allowed; /* Show that these are not interactive */
  pointer-events: none; /* Disable all pointer interactions */
}

/* Re-enable pointer events for the unmigrate button if present */
.color-leaf.ghostedColor .unmigrate-button {
  pointer-events: auto;
}

.color-leaf.ghostedColor::after {
  content: '↑ Moved';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 0.3rem;
  z-index: 10;
  white-space: nowrap;
}

/* Disable hover effects for ghosted colors */
.color-leaf.ghostedColor:hover {
  transform: none;
  box-shadow: none;
  opacity: 0.4;
}

@keyframes migratedPulse {
  0% {
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
  }
  50% {
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.6), 0 0 40px rgba(245, 158, 11, 0.3);
  }
  100% {
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
  }
}

/* Unsaved migration highlighting */
.color-leaf.unsavedMigration {
  border: 3px solid #ef4444;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.05) 100%);
  position: relative;
  animation: unsavedPulse 1.5s ease-in-out infinite;
}

.color-leaf.unsavedMigration::before {
  content: '⚠ Unsaved';
  position: absolute;
  top: -8px;
  right: -5px;
  background: #ef4444;
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.4rem;
  border-radius: 0.3rem;
  z-index: 10;
  white-space: nowrap;
}

@keyframes unsavedPulse {
  0% {
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.7), 0 0 40px rgba(239, 68, 68, 0.4);
  }
  100% {
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
  }
}

/* Size variants for color leaves (for future size data integration) */
.color-leaf-small {
  grid-row-end: span 1;
}

.color-leaf-medium {
  grid-row-end: span 2;
}

.color-leaf-large {
  grid-row-end: span 3;
}

/* Size Leaf Component */
.size-leaf {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 0.5rem;
  padding: 0.75rem;
  margin: 0.25rem 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.size-leaf:hover {
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3), 0 2px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(255, 255, 255, 0.95);
  cursor: grab;
  position: relative;
}

.size-leaf:hover::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border: 2px solid rgba(59, 130, 246, 0.4);
  border-radius: 0.625rem;
  animation: pulse-border 2s infinite ease-in-out;
  pointer-events: none;
}

@keyframes pulse-border {
  0%, 100% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.02);
  }
}

.size-leaf-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.size-leaf-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.size-leaf-sku {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
  background: rgba(243, 244, 246, 0.8);
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 8rem;
}

.size-leaf-size {
  font-size: 0.875rem;
  font-weight: 800;
  color: #475569;
}
.sizeOutOfStock .size-leaf-size {
  font-weight: 300
}

.size-leaf-footer {
  display: flex;
  justify-content: flex-end;
}

.size-leaf-inventory {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
}
.sizeOutOfStock .size-leaf-inventory  {
  text-decoration: line-through;
  color: #ef4444;
}

/* Size Leaf Dragging States */
.size-leaf {
  position: relative;
}

.size-leaf.dragging {
  opacity: 0.5;
  z-index: 1000;
  cursor: grabbing !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transform: rotate(2deg);
}

/* Aspect ratio utilities for color leaves */
.aspect-square {
  aspect-ratio: 1 / 1;
}

.aspect-video {
  aspect-ratio: 16 / 9;
}

.aspect-portrait {
  aspect-ratio: 3 / 4;
}

/* Dialog */
dialog { border: none; border-radius: 1rem; padding: 0; }
dialog::backdrop { background: rgba(15, 23, 42, 0.3); backdrop-filter: blur(4px); }

/* CreateStyleTreeForm Components */
.create-style-tree-dialog {
  min-width: 500px;
  max-width: 600px;
}

.add-child-style-dialog {
  min-width: 500px;
  max-width: 600px;
}

/* Error Alert */
.error-alert {
  padding: 0;
}

.error-alert-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.error-alert-icon {
  color: #ef4444;
  max-width: 2rem;
  flex-shrink: 0;
}

.error-alert-text {
  color: #ef4444;
  font-weight: 600;
}

/* Lookup States */
.lookup-loading-state,
.lookup-error-state,
.lookup-success-state {
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: all 0.5s ease-in-out;
}

.lookup-loading-state {
  transform: translateY(0);
  opacity: 1;
  max-height: 5rem;
  margin-bottom: 1rem;
}

.lookup-error-state {
  transform: translateY(0);
  opacity: 1;
  max-height: 5rem;
  margin-bottom: 1rem;
}

.lookup-success-state {
  transform: translateY(0);
  opacity: 1;
  max-height: 28rem;
  margin-bottom: 1rem;
}

/* Lookup Panels */
.lookup-loading-content,
.lookup-error-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lookup-success-content {
  display: grid;
  row-gap: 0.5rem;
}

/* Loading State */
.lookup-loading-icon-container {
  position: relative;
  flex-shrink: 0;
}

.lookup-loading-icon {
  color: #3b82f6;
}

.lookup-loading-ping {
  position: absolute;
  inset: 0;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(147,197,253,0.5);
  border-radius: 9999px;
  animation: ping 1.5s cubic-bezier(0,0,0.2,1) infinite;
}

.lookup-loading-text {
  color: #1d4ed8;
  font-weight: 600;
}

.lookup-loading-dots {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}

.lookup-loading-dot {
  width: 0.5rem;
  height: 0.5rem;
  background: #60a5fa;
  border-radius: 9999px;
  animation: pulse 1.5s ease-in-out infinite;
}

/* Error State */
.lookup-error-icon-container {
  position: relative;
  flex-shrink: 0;
}

.lookup-error-icon {
  color: #ef4444;
}

.lookup-error-ping {
  position: absolute;
  inset: 0;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(252,165,165,0.5);
  border-radius: 9999px;
  animation: pulse 1.5s ease-in-out infinite;
}

.lookup-error-text {
  color: #ef4444;
  font-weight: 600;
}

/* Success State */
.product-info-grid {
  display: grid;
  row-gap: 0.5rem;
}

.product-info-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.5);
  border-radius: 0.5rem;
}

.product-info-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #475569;
}

.product-info-value {
  font-size: 0.875rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: #111827;
  background: rgba(243,244,246,0.8);
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-info-badge {
  font-size: 0.875rem;
  color: #1e40af;
  background: rgba(219,234,254,0.8);
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-weight: 600;
}


/* Color Scale Display */
.color-scale-container {
  position: relative;
  min-height: 12rem;
}

.color-scale-item {
  /*
  position: absolute;
  left: 50%;
  top: 50%;
  opacity: 1;
  */
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Styles for out-of-stock colors */
.colorOutOfStock, .sizeOutOfStock {
  grid-area: "outofstock";
  opacity: 0.6;
  position: relative;


  filter: grayscale(50%) brightness(0.9);
}

.colorOutOfStock::befor, .sizeOutOfStock::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 4px,
    rgba(0, 0, 0, 0.1) 4px,
    rgba(0, 0, 0, 0.1) 8px
  );
  pointer-events: none;
  border-radius: inherit;
}



.colorOutOfStock .code {
  text-decoration: line-through;
  color: #64748b;
}

/* Prevent hover effects on out-of-stock items */
.colorOutOfStock:hover .overlay {
  opacity: 0;
}

/* Alternative approach - more subtle */
.colorOutOfStock.subtle {
  opacity: 0.7;
  filter: grayscale(30%);
}

.colorOutOfStock.subtle .code::after {
  content: ' (Out of Stock)';
  font-size: 0.8em;
  color: #ef4444;
  font-weight: normal;
}






/* Spline Connector Base Styles */
.spline-connector {
  fill: none;
  stroke: rgba(255, 0, 179, 0.9);
  stroke-width: 10px;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: all 0.3s ease;
  opacity: 1;
}

.spline-connector:hover {
  stroke: rgba(99, 102, 241, 0.7);
  stroke-width: 10px;
  opacity: 1;
}

/* Specific spline connection styles */
.spline-connection {
  stroke: rgba(99, 102, 241, 0.4);
  stroke-width: 10;
}

.spline-connection:hover {
  stroke-opacity: 1;
}

/* Color connection specific styles */
.color-spline {
  stroke: rgba(139, 69, 19, 0.4);
  stroke-width: 10px;
  stroke-dasharray: 4,6;
}

.color-spline:hover {
  stroke: rgba(139, 69, 19, 0.7);
  stroke-width: 3;
  stroke-dasharray: 6,4;
}

/* Animated splines */
.spline-connector.animated {
  stroke-dasharray: 8,8;
  animation: spline-dash 2s linear infinite;
}

@keyframes spline-dash {
  0% {
    stroke-dashoffset: 16;
  }
  100% {
    stroke-dashoffset: 0;
  }
}
/* Style tree page specific splines */
.style-tree-page .spline-connector {
  stroke: rgba(34, 197, 94, 0.4);
  stroke-width: 5px;
}

.style-tree-page .spline-connector:hover {
  stroke: rgba(34, 197, 94, 0.8);
  stroke-width: 2.5;
}

/* Migration spline connection styles */
.migration-spline {
  stroke: rgba(147, 51, 234, 0.7);
  stroke-width: 3px;
  stroke-dasharray: 8,4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: all 0.3s ease;
  animation: migration-flow 3s ease-in-out infinite;
}

.migration-spline:hover {
  stroke: rgba(147, 51, 234, 0.9);
  stroke-width: 4px;
  stroke-dasharray: 12,6;
}

@keyframes migration-flow {
  0%, 100% {
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dashoffset: 12;
  }
}

/* Enhanced color leaf positioning for connections */
.style-tree-page .color-leaf {
  position: relative;
  transition: transform 0.2s ease;
}

.style-tree-page .color-leaf:hover {
  transform: translateY(-2px);
  z-index: 10;
}
.swapped-pill{
  position: absolute;
  top: -10px;
  left: -10px;
  font-size: 0.65rem;
  font-weight: 600;
  background: repeating-linear-gradient(
    45deg,
    #3b82f6 0px,
    #3b82f6 6px,
    #10b981 6px,
    #10b981 12px
  );
  color: white;
  padding: 0.125rem 0.375rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Database Status Indicator */
.dbStatus {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid;
  animation: fadeIn 0.2s ease-in;
}

.dbStatus.saving {
  background-color: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

.dbStatus.saved {
  background-color: #d1fae5;
  border-color: #10b981;
  color: #065f46;
}

.dbStatus.error {
  background-color: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
  box-shadow: inset 0 0 5px rgba(239, 68, 68, 0.5);
}

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

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e293b;
}

.modal-close-button {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
}

.modal-close-button:hover {
  background: #f1f5f9;
  color: #475569;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #374151;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input.error,
.form-group select.error {
  border-color: #dc2626;
}

.required {
  color: #dc2626;
}

.error-message {
  color: #dc2626;
  font-size: 0.75rem;
  margin-top: 0.25rem;
  display: block;
}

.loading-indicator {
  color: #64748b;
  font-style: italic;
  padding: 0.75rem;
  text-align: center;
}

.existing-colors-info {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 0.375rem;
  border: 1px solid #e2e8f0;
}

.existing-colors-info h4 {
  margin: 0 0 0.75rem 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
}

.color-codes-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.color-code-chip {
  background: #3b82f6;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: monospace;
}

.no-colors {
  color: #64748b;
  font-style: italic;
  font-size: 0.875rem;
}

