/* Color Picker Component Styles */

.color-picker-wrapper {
  margin-top: 15px;
}

.color-picker-input-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.color-name-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.color-name-input:focus {
  outline: none;
  border-color: #4CAF50;
}

.color-selector-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

.color-preview {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  border: 2px solid #ddd;
  cursor: pointer;
  transition: transform 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.color-preview:hover {
  transform: scale(1.05);
}

.color-picker-btn {
  flex: 1;
  padding: 12px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s;
}

.color-picker-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.eyedropper-btn {
  padding: 12px;
  background: #fff;
  border: 2px solid #667eea;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.eyedropper-btn:hover {
  background: #667eea;
  color: white;
}

.eyedropper-btn svg {
  width: 20px;
  height: 20px;
}

/* Color Picker Panel */
.color-picker-panel {
  margin-top: 15px;
  padding: 20px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.color-picker-canvas-wrapper {
  position: relative;
  width: 300px;
  height: 200px;
  margin-bottom: 15px;
  border-radius: 4px;
  overflow: hidden;
  cursor: crosshair;
}

#colorCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.color-picker-cursor {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid white;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 4px rgba(0,0,0,0.5);
}

.color-picker-hue-slider {
  margin-bottom: 15px;
}

#hueSlider {
  width: 100%;
  height: 20px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(to right, 
    #ff0000 0%, 
    #ffff00 17%, 
    #00ff00 33%, 
    #00ffff 50%, 
    #0000ff 67%, 
    #ff00ff 83%, 
    #ff0000 100%
  );
  border-radius: 10px;
  outline: none;
}

#hueSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: white;
  border: 2px solid #333;
  border-radius: 50%;
  cursor: pointer;
}

#hueSlider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: white;
  border: 2px solid #333;
  border-radius: 50%;
  cursor: pointer;
}

.color-picker-controls {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 15px;
}

.color-input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.color-input-group label {
  font-size: 12px;
  font-weight: 600;
  color: #666;
}

.color-input-group input {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.color-input-group input:focus {
  outline: none;
  border-color: #667eea;
}

.color-picker-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn-cancel,
.btn-confirm {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s;
}

.btn-cancel {
  background: #f5f5f5;
  color: #333;
}

.btn-cancel:hover {
  background: #e0e0e0;
}

.btn-confirm {
  background: #4CAF50;
  color: white;
}

.btn-confirm:hover {
  background: #45a049;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

/* Product Colors List */
.product-colors-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

.color-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f5f5f5;
  border-radius: 20px;
  transition: all 0.3s;
}

.color-item:hover {
  background: #e0e0e0;
  transform: translateY(-2px);
}

.color-item-preview {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #ddd;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.color-item-name {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.color-item-remove {
  background: none;
  border: none;
  color: #ff4444;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
  transition: all 0.3s;
}

.color-item-remove:hover {
  color: #cc0000;
  transform: scale(1.2);
}

/* Dark Mode Support */
.dark-mode .color-picker-panel {
  background: #2a2a2a;
  border-color: #444;
}

.dark-mode .color-name-input,
.dark-mode .color-input-group input {
  background: #333;
  border-color: #555;
  color: #fff;
}

.dark-mode .color-input-group label {
  color: #aaa;
}

.dark-mode .color-item {
  background: #333;
  color: #fff;
}

.dark-mode .color-item:hover {
  background: #444;
}

.dark-mode .btn-cancel {
  background: #444;
  color: #fff;
}

.dark-mode .btn-cancel:hover {
  background: #555;
}

/* Responsive */
@media (max-width: 768px) {
  .color-picker-canvas-wrapper {
    width: 100%;
    max-width: 300px;
  }
  
  .color-picker-controls {
    grid-template-columns: 1fr 1fr;
  }
  
  .color-input-group:first-child {
    grid-column: 1 / -1;
  }
}

/* Confirm Color Button (Check icon) */
.confirm-color-btn {
  padding: 12px;
  background: #4CAF50;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.confirm-color-btn:hover {
  background: #45a049;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.confirm-color-btn svg {
  width: 20px;
  height: 20px;
}

.dark-mode .confirm-color-btn {
  background: #4CAF50;
}

.dark-mode .confirm-color-btn:hover {
  background: #45a049;
}
