/* Color Picker Component - Matches Icon Picker Style */

.color-picker-wrapper {
  position: relative;
  display: block; /* Full width to match form inputs */
  width: 100%;
}

/* Ensure picker is above other content when open */
.color-picker-wrapper.picker-open {
  z-index: 1000;
}

.color-picker-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  background: var(--glass-bg, rgba(255, 255, 255, 0.65));
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.5));
  border-radius: var(--radius-sm, 12px);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit; /* Inherit font from form */
}

.color-picker-trigger:hover {
  border-color: rgba(2, 94, 115, 0.3);
}

.color-picker-trigger.active {
  border-color: var(--primary, #025e73);
  box-shadow: 0 0 0 3px rgba(2, 94, 115, 0.1);
}

.color-picker-swatch {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.color-picker-value {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-main, #1f2937);
  font-family: monospace;
  text-align: left;
}

.color-picker-arrow {
  font-size: 0.5rem;
  color: var(--text-muted, #6b7280);
  transition: transform 0.15s;
}

.color-picker-trigger.active .color-picker-arrow {
  transform: rotate(180deg);
}

/* Dropdown - Absolute positioning (like Icon Picker) */
.color-picker-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.5rem; /* Same spacing as Icon Picker */
  width: 240px; /* Slightly wider than before */
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s, visibility 0.15s, transform 0.15s;
  pointer-events: none;
}

.color-picker-dropdown.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* Color swatches grid - 6 columns */
.color-picker-swatches {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px; /* Slightly increased gap */
  margin-bottom: 0.75rem;
}

.color-picker-option {
  width: 30px; /* Slightly larger */
  height: 30px;
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.1s;
  font-size: 0.75rem;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.color-picker-option:hover {
  transform: scale(1.15);
  z-index: 1;
}

.color-picker-option.selected {
  border-color: var(--text-main, #1f2937);
  box-shadow: 0 0 0 2px white, 0 0 0 3px rgba(0, 0, 0, 0.15);
}

/* Custom color input */
.color-picker-custom {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.color-picker-custom label {
  font-size: 0.75rem;
  color: var(--text-muted, #6b7280);
  white-space: nowrap;
}

.color-picker-custom-input {
  flex: 1;
  height: 28px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
}

.color-picker-custom-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-picker-custom-input::-webkit-color-swatch {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}