/* Product Configurator Styles */

/* Override editor container for full-screen configurator */
.editor-section.configurator {
  max-width: 100%;
  margin: 0;
  padding: 0;
  background: #f0f0f0;
  height: calc(100vh - 56px);
  min-height: 600px;
}

.configurator .editor-header {
  background: #1a1a2e;
  color: #fff;
  padding: 12px 20px;
  margin: 0;
  text-align: left;
  border-bottom: 1px solid #333;
}

.configurator .editor-header h2 {
  font-size: 18px;
  margin: 0;
  color: #4fc3f7;
}

.configurator .editor-header p {
  font-size: 13px;
  color: #aaa;
  margin: 4px 0 0;
}

.configurator .editor-container {
  display: flex;
  max-width: none;
  margin: 0;
  height: calc(100vh - 56px - 48px); /* header + toolbar */
  border-radius: 0;
  box-shadow: none;
  background: #fff;
}

.configurator .editor-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.configurator .editor-canvas {
  flex: 1;
  background: #f5f5f5;
  position: relative;
  overflow: hidden;
}

.configurator .editor-canvas #paper-container {
  width: 100%;
  height: 100%;
}

/* Sidebar with categories */
.configurator .editor-sidebar {
  width: 280px;
  background: #fff;
  border-right: 1px solid #e0e0e0;
  padding: 12px;
  overflow-y: auto;
  height: 100%;
}

.configurator .editor-sidebar h4 {
  color: #1a1a2e;
  font-size: 12px;
  text-transform: uppercase;
  margin-bottom: 12px;
  letter-spacing: 1px;
  font-weight: 600;
}

/* Palette categories */
.palette-category {
  margin-bottom: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
  background: #fafafa;
}

.palette-category-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f0f0f0;
  border-bottom: 1px solid #e0e0e0;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  font-weight: 600;
  color: #333;
}

.palette-category-header:hover {
  background: #e8e8e8;
}

.palette-category-header .category-icon {
  font-size: 10px;
  color: #666;
  transition: transform 0.2s;
}

.palette-category-header .category-name {
  flex: 1;
}

.palette-category-header .category-count {
  background: #4fc3f7;
  color: #1a1a2e;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
}

.palette-category-content {
  padding: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.palette-category-content.collapsed {
  display: none;
}

/* Shape buttons */
.configurator .shape-btn {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px 8px;
  cursor: pointer;
  color: #333;
  font-size: 11px;
  text-align: center;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.configurator .shape-btn:hover {
  background: #e3f2fd;
  border-color: #4fc3f7;
  color: #1976d2;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(79, 195, 247, 0.2);
}

.configurator .shape-btn.active {
  background: #e3f2fd;
  border-color: #4fc3f7;
  color: #1976d2;
  box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.2);
}

.configurator .shape-btn.dragging {
  opacity: 0.5;
  transform: scale(0.98);
}

.configurator .shape-btn .shape-icon {
  font-size: 20px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Link buttons */
.configurator .shape-btn.link-btn .shape-icon {
  font-size: 16px;
}

/* Toolbar */
.configurator .editor-toolbar {
  background: #1a1a2e;
  padding: 8px 16px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  border-bottom: 1px solid #333;
}

.configurator .editor-toolbar button {
  background: #333;
  border: none;
  color: #ccc;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.configurator .editor-toolbar button:hover {
  background: #4fc3f7;
  color: #1a1a2e;
}

.configurator .editor-toolbar button.active {
  background: #4fc3f7;
  color: #1a1a2e;
}

.configurator .editor-toolbar .sep {
  width: 1px;
  height: 24px;
  background: #444;
  margin: 0 4px;
}

/* Inspector panel */
.configurator .editor-inspector {
  width: 320px;
  background: #fff;
  border-left: 1px solid #e0e0e0;
  padding: 12px;
  overflow-y: auto;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.configurator .editor-inspector h4 {
  color: #1a1a2e;
  font-size: 12px;
  text-transform: uppercase;
  margin-bottom: 12px;
  letter-spacing: 1px;
  font-weight: 600;
  padding-bottom: 8px;
  border-bottom: 1px solid #e0e0e0;
}

.inspector-content {
  flex: 1;
  overflow-y: auto;
}

.inspector-empty {
  text-align: center;
  color: #999;
  padding: 40px 20px;
}

.inspector-empty svg {
  margin-bottom: 12px;
  opacity: 0.5;
}

.inspector-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f5f5f5;
  border-radius: 6px;
  margin-bottom: 16px;
}

.inspector-type-badge {
  background: #4fc3f7;
  color: #1a1a2e;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.inspector-id {
  font-family: monospace;
  font-size: 11px;
  color: #999;
}

.inspector-section {
  margin-bottom: 20px;
}

.inspector-section h5 {
  font-size: 11px;
  text-transform: uppercase;
  color: #666;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  font-weight: 600;
}

.inspector-field {
  margin-bottom: 12px;
}

.inspector-field label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: #555;
  margin-bottom: 4px;
}

.inspector-field input,
.inspector-field select,
.inspector-field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.inspector-field input:focus,
.inspector-field select:focus,
.inspector-field textarea:focus {
  outline: none;
  border-color: #4fc3f7;
  box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.2);
}

.inspector-field input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
}

.inspector-coords {
  display: flex;
  gap: 8px;
}

.inspector-coords input {
  flex: 1;
}

/* Multi-select inspector */
.inspector-multi {
  padding: 20px;
  text-align: center;
  color: #666;
}

.inspector-multi h4 {
  margin-bottom: 8px;
  color: #333;
}

.inspector-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

.inspector-actions button {
  background: #f0f0f0;
  border: 1px solid #ddd;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.inspector-actions button:hover {
  background: #e3f2fd;
  border-color: #4fc3f7;
  color: #1976d2;
}

/* Toast notifications */
.configurator .editor-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.configurator .editor-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* JointJS specific styles */
.configurator .joint-paper {
  width: 100%;
  height: 100%;
}

.configurator .joint-theme-default {
  /* JointJS default theme overrides */
}

/* Selection styling */
.configurator .joint-element.selected > .body {
  stroke: #4fc3f7 !important;
  stroke-width: 3 !important;
}

.configurator .joint-link.selected > .line {
  stroke: #4fc3f7 !important;
  stroke-width: 3 !important;
}

/* Connection points / magnets */
.configurator .joint-element .magnet {
  cursor: crosshair;
}

.configurator .joint-element .magnet:hover {
  fill: #4fc3f7 !important;
}

/* Resize handles */
.configurator .joint-tool-remove,
.configurator .joint-tool-resize {
  fill: #4fc3f7 !important;
}

/* Link tools */
.configurator .joint-tool-connect {
  fill: #4fc3f7 !important;
}

/* Snaplines */
.configurator .joint-snapline {
  stroke: #4fc3f7 !important;
  stroke-dasharray: 5,5 !important;
}

/* Grid */
.configurator .joint-grid {
  stroke: #e0e0e0 !important;
}

/* Fullscreen */
.configurator .editor-container:fullscreen,
.configurator .editor-container:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  border-radius: 0;
}

/* Responsive */
@media (max-width: 1200px) {
  .configurator .editor-sidebar {
    width: 260px;
  }
  .configurator .editor-inspector {
    width: 300px;
  }
}

@media (max-width: 900px) {
  .configurator .editor-container {
    flex-direction: column;
  }
  .configurator .editor-sidebar {
    width: 100%;
    height: auto;
    max-height: 300px;
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
  }
  .configurator .editor-inspector {
    width: 100%;
    height: auto;
    max-height: 300px;
    border-left: none;
    border-top: 1px solid #e0e0e0;
  }
  .configurator .editor-canvas {
    min-height: 400px;
  }
}

/* Zoom display */
.zoom-display {
  background: #333;
  color: #4fc3f7;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-family: monospace;
  font-weight: 600;
  margin-left: auto;
}