/* Background Customizer Panel */
.bg-customizer-panel {
  margin-top: 16px;
  padding: 10px 16px;
  background: var(--bg-secondary);
  border: var(--border-theme);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-glass);
  animation: slideInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.bg-customizer-panel.hidden {
  display: none !important;
}

/* Filter Customizer Panel */
.filter-customizer-panel {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: var(--border-theme);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-glass);
  animation: slideInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.filter-customizer-panel.hidden {
  display: none !important;
}

.filter-slider-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.filter-intensity-val {
  color: var(--accent-pink);
  font-family: monospace;
  font-size: 14px;
}

.intensity-slider-input {
  background: linear-gradient(to right, #e2e8f0 0%, var(--accent-pink) 100%);
  -webkit-appearance: none;
  width: 100%;
  height: 10px;
  border-radius: 5px;
  outline: none;
  border: 1px solid rgba(255, 42, 116, 0.15);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
}

.intensity-slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-pink);
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.intensity-slider-input::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.intensity-slider-input::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-pink);
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 0.1s ease;
  border: none;
}

.intensity-slider-input::-moz-range-thumb:hover {
  transform: scale(1.2);
}

.bg-customizer-view {
  display: flex;
  align-items: center;
  width: 100%;
  height: 64px;
}

.bg-customizer-view.hidden {
  display: none !important;
}

/* Presets view left side */
.presets-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-gap: 8px 6px;
  flex: 1;
}

.presets-grid .color-preset {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid white;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.12);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
  padding: 0;
}

.presets-grid .color-preset:hover {
  transform: scale(1.15);
}

.presets-grid .color-preset.active {
  transform: scale(1.15);
  border-color: white;
  box-shadow: 0 0 0 2px var(--accent-pink), 0 2px 6px rgba(0,0,0,0.3);
}

/* Divider line */
.customizer-divider {
  width: 1px;
  height: 48px;
  background-color: var(--text-secondary);
  opacity: 0.2;
  margin: 0 8px;
  flex-shrink: 0;
}

/* Right side wrapper */
.color-wheel-wrapper {
  width: 48px;
  height: 48px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.is-tablet .color-wheel-wrapper,
.is-tablet .customizer-divider {
  display: none !important;
}

.btn-color-wheel {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #7ce833;
  background: conic-gradient(
    #ff3b30 0%, #ff9500 12.5%, #ffcc00 25%, #4cd964 37.5%, 
    #5ac8fa 50%, #007aff 62.5%, #5856d6 75%, #ff2d55 87.5%, #ff3b30 100%
  );
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
}

.btn-color-wheel:hover {
  transform: scale(1.1);
}

.btn-color-wheel::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  z-index: 1;
}

.btn-color-wheel svg.dropper-icon {
  position: relative;
  z-index: 2;
  color: var(--accent-pink);
  width: 13px;
  height: 13px;
}

.wheel-check-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #4cd964;
  border: 1.5px solid white;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.wheel-check-badge svg {
  fill: white;
  width: 8px;
  height: 8px;
}

/* Keep the color wheel inside the narrower desktop sidebar. */
@media (max-width: 1024px) {
  .is-desktop .bg-presets-view {
    height: auto;
    min-height: 88px;
  }

  .is-desktop .bg-presets-view .presets-grid {
    grid-template-columns: repeat(4, 24px);
    justify-content: space-between;
  }
}

/* Sliders view left side */
.sliders-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
}

.custom-slider-wrapper {
  position: relative;
  width: 100%;
  height: 18px;
  display: flex;
  align-items: center;
}

.custom-color-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 10px;
  border-radius: 5px;
  outline: none;
  border: 1px solid rgba(255, 42, 116, 0.15);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
}

.hue-slider-input {
  background: linear-gradient(to right, 
    #ff0000 0%, #ffff00 17%, #00ff00 33%, 
    #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%
  );
}

.lightness-slider-input {
  background: linear-gradient(to right, #000 0%, #ff2a74 50%, #fff 100%);
}

.custom-color-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--accent-pink);
  background: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.custom-color-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--accent-pink);
  background: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

/* Right side: large preview circle */
.preview-circle-wrapper {
  width: 48px;
  height: 48px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.preview-circle-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.2s ease;
}

.preview-circle-btn:hover {
  transform: scale(1.08);
}

.preview-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2), inset 0 1px 3px rgba(0,0,0,0.15);
  box-sizing: border-box;
  transition: background-color 0.2s ease;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Crop Overlay for Background editing */
.bg-crop-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  display: flex;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.bg-crop-overlay.hidden {
  display: none !important;
}

.bg-crop-overlay::before,
.bg-crop-overlay::after {
  content: '';
  flex: 1;
  background: rgba(10, 10, 14, 0.75);
  backdrop-filter: blur(2px);
  transition: background 0.3s ease;
}

.bg-crop-overlay-content {
  width: 31.412%;
  flex-shrink: 0;
  box-sizing: border-box;
  border-left: 2px dashed rgba(255, 255, 255, 0.3);
  border-right: 2px dashed rgba(255, 255, 255, 0.3);
  position: relative;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
}

.bg-crop-overlay-content::after {
  content: 'Final Post Crop';
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: rgba(255, 255, 255, 0.7);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

