/* Image Editor – sections, Bevel & Emboss, text, stickers */
.image-editor-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}
.image-editor-modal.open { display: flex; }
.image-editor-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}
.image-editor-content {
  position: relative;
  max-width: 92vw;
  max-height: 90vh;
  width: 780px;
  padding: 20px;
  border-radius: 16px;
  border: 3px solid #c0c4c8;
  background: linear-gradient(145deg, #f5f6f8, #e8eaed);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  overflow: auto;
}
.image-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.image-editor-header h3 {
  margin: 0;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.image-editor-header .material-icons { font-size: 1.25rem; }
.image-editor-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #64748b;
  line-height: 1;
  padding: 0 4px;
}
.image-editor-close:hover { color: #1f2937; }
.image-editor-body { margin-bottom: 16px; }
.image-editor-canvas-wrap {
  text-align: center;
  margin-bottom: 16px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 12px;
  border: 2px solid #e5e7eb;
}
.image-editor-canvas-wrap canvas {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Panels (Filters, Bevel & Emboss, Text, etc.) */
.ie-panels {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ie-panel {
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}
.ie-panel-title {
  margin: 0;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #374151;
  background: linear-gradient(180deg, #f3f4f6 0%, #e5e7eb 100%);
  border-bottom: 1px solid #d1d5db;
}
.ie-panel-inner {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ie-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ie-row-multi { gap: 12px; }
.ie-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: #4b5563;
  min-width: 52px;
}
.ie-select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 2px solid #d1d5db;
  font-size: 0.9rem;
  background: #fff;
}
.ie-font-select { min-width: 160px; }
.ie-input {
  padding: 6px 10px;
  border-radius: 8px;
  border: 2px solid #d1d5db;
  font-size: 0.9rem;
  flex: 1;
  min-width: 120px;
}
.ie-text-input { min-width: 180px; }
.ie-num {
  width: 56px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 2px solid #d1d5db;
  font-size: 0.9rem;
}
.ie-num-sm { width: 44px; }
.ie-color {
  width: 36px;
  height: 28px;
  padding: 2px;
  border: 2px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
}
.ie-check { font-weight: normal; font-size: 0.9rem; }
.ie-check input { margin-right: 4px; }

/* Bevel & Emboss: sliders */
.ie-slider-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.ie-slider {
  flex: 1;
  min-width: 80px;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: #e5e7eb;
  border-radius: 4px;
}
.ie-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #4f46e5;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.ie-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #4f46e5;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.ie-unit {
  font-size: 0.85rem;
  color: #6b7280;
  min-width: 24px;
}

.ie-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 2px solid #c0c4c8;
  background: linear-gradient(145deg, #f0f2f5, #e8eaed);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
}
.ie-btn:hover { filter: brightness(1.05); }

.ie-sticker-picker {
  position: relative;
  margin-top: 8px;
  padding: 10px;
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  max-height: 180px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 8px;
}
.ie-sticker-picker.hidden { display: none !important; }
.ie-sticker-item {
  width: 56px;
  height: 56px;
  padding: 4px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ie-sticker-item:hover:not(:disabled) { border-color: #4f46e5; background: #eef2ff; }
.ie-sticker-item:disabled { opacity: 0.5; cursor: not-allowed; }
.ie-sticker-item img { max-width: 100%; max-height: 100%; object-fit: contain; }

.image-editor-footer { margin-top: 16px; }
.image-editor-hint { font-size: 0.85rem; color: #64748b; margin-bottom: 12px; }
.image-editor-actions { display: flex; gap: 10px; justify-content: flex-end; }
