/* ================================
   COLOR PICKER STYLES
   ================================ */

/* Fix Webflow dropdown overflow */
.ms-input-dropdown-wrap.w-dropdown {
  overflow: visible !important;
}

.ms-colorpicker-dropdown.w-dropdown-list {
  overflow: visible !important;
  max-height: none !important;
  padding: 1.25rem !important;
  border-radius: 16px !important;
  border: 1px solid #e8e8e8 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
  background: #fafafa !important;
}

.ms-colorpicker-dropdown .ms-margin-auto {
  overflow: visible !important;
}

/* Header */
.picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.picker-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #333;
}

.clear-all-btn {
  font-size: 0.75rem;
  color: #e74c3c;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.clear-all-btn:hover {
  background: #fdf2f2;
}

/* Color Wheel */
.color-wheel-wrapper {
  background: linear-gradient(145deg, #f5f5f5 0%, #ebebeb 100%);
  border-radius: 50%;
  padding: 16px;
  margin: 0 auto 1.25rem;
  width: 272px;
  height: 272px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.06),
    0 2px 8px rgba(255, 255, 255, 0.9);
}

.color-wheel-container {
  position: relative;
  width: 240px;
  height: 240px;
}

.color-wheel {
  position: relative;
  width: 100%;
  height: 100%;
}

.color-slice {
  position: absolute;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid white;
  background-size: cover;
  background-position: center;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.06);
}

.color-slice:hover {
  transform: scale(1.2);
  z-index: 10;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15), 0 8px 16px rgba(0, 0, 0, 0.1);
}

.color-slice.is-selected {
  border-color: #2ecc71;
  transform: scale(1.1);
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.3), 0 4px 8px rgba(0, 0, 0, 0.15);
  z-index: 5;
}

.color-slice.is-selected:hover {
  transform: scale(1.2);
}

.color-slice.is-selected::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: bold;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* Center Display */
.center-display {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.06);
  pointer-events: none;
}

.center-count {
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
  line-height: 1;
}

.center-label {
  font-size: 0.5625rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.125rem;
}

/* Selected Color Label */
.ms-input-label {
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  color: #888 !important;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.5rem !important;
}

/* Selected Pills */
#values {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 32px;
}

.selected-color-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.5rem 0.375rem 0.375rem;
  background: white;
  border: 1px solid #e5e5e5;
  border-radius: 20px;
  font-size: 0.75rem;
  color: #555;
  font-weight: 500;
  transition: all 0.15s ease;
}

.selected-color-pill:hover {
  background: #f8f8f8;
  border-color: #ddd;
}

.selected-color-pill .pill-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.selected-color-pill .pill-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: #bbb;
  font-size: 16px;
  padding: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  margin-left: 0.125rem;
}

.selected-color-pill .pill-remove:hover {
  background: #f0f0f0;
  color: #666;
}

.empty-values {
  color: #bbb;
  font-size: 0.8125rem;
  font-style: italic;
}

/* Trigger Swatches */
#colorSwatch {
  display: flex;
  align-items: center;
}

.swatch-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid white;
  background-size: cover;
  background-position: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  margin-left: -8px;
  flex-shrink: 0;
}

.swatch-dot:first-child {
  margin-left: 0;
}

.swatch-dot.more {
  background: #333;
  color: white;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hide source collection */
.colors-source-collection {
  display: none !important;
}

/* Hide extra space */
.ms-colorpicker-dropdown .ms-space {
  display: none;
}

.ms-colorpicker-dropdown .ms-hide {
  display: none;
}

#hexInput.has-left-icon {
  padding-left: 110px !important;
}

/* When empty, less padding */
.ms-color-swatch:empty ~ #hexInput.has-left-icon {
  padding-left: 40px !important;
}

/* Selected Colors Section */
.selected-colors-section {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #f0f0f0;
}

.selected-colors-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.875rem;
}

.selected-colors-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.selected-count {
  font-size: 0.75rem;
  color: #bbb;
}

.selected-colors-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.selected-color-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.5rem 0.375rem 0.375rem;
  background: white;
  border: 1px solid #e5e5e5;
  border-radius: 20px;
  font-size: 0.8125rem;
  color: #555;
  font-weight: 500;
  text-transform: capitalize;
  transition: all 0.15s ease;
}

.selected-color-pill:hover {
  background: #f8f8f8;
  border-color: #ddd;
}

.selected-color-pill .color-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.selected-color-pill .color-name {
  color: #333;
}

.selected-color-pill .remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #bbb;
  font-size: 16px;
  padding: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  margin-left: 0.125rem;
}

.selected-color-pill .remove-btn:hover {
  background: #f0f0f0;
  color: #666;
}

.empty-state {
  color: #bbb;
  font-size: 0.875rem;
  font-style: italic;
}
