/*
 * form-image-upload component
 * Design reference: docs/design/figma-reference/screens/activity-creation/general-information-1-full.png
 * Figma dimensions: ~550 x 227 total
 *
 * All colors use CSS custom properties from the branding system
 * (site/snippets/app/branding-css.php). No hardcoded color values.
 *
 * Structure:
 *   .form-image-upload            — outer wrapper: single rounded dashed border, surface bg
 *     .form-image-upload-dropzone — top: dropzone with icon + text
 *     .form-image-list            — bottom: thumbnail row + "+ Eigenes Bild"
 *       (separated by solid 1px line using --ss-border)
 */

/* Outer wrapper — single rounded dashed border, surface (white) background */
.form-image-upload {
  border: 1.5px dashed var(--ss-border);
  border-radius: 12px;
  background: var(--ss-surface);
}

/* Dropzone area — centered icon + text */
.form-image-upload-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 16px;
  cursor: pointer;
}
.form-image-upload-dropzone.dragover {
  background: rgba(var(--bs-secondary-rgb), 0.05);
}

/* Thumbnail row — separated from dropzone by straight solid line */
.form-image-list {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--ss-border);
  border-radius: 0;
  padding: 8px 12px;
  background: transparent;
}
.form-image-list ul {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
  gap: 6px;
}
.form-image-list ul li {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 53px;
}
.form-image-list ul li img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
}

/* Selected / primary image highlight */
.form-image-list ul li img.selected {
  border-color: var(--bs-secondary);
}

/* Remove button */
.form-image-list ul li .img-remove {
  position: absolute;
  top: -4px;
  right: -4px;
  z-index: 2;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bs-danger);
  color: var(--ss-surface);
  border: none;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  padding: 0;
}

/* Drag-reorder feedback */
.form-image-list ul li.dragging { opacity: 0.4; }
.form-image-list ul li.drag-over img { border-color: var(--bs-secondary); }

/* File input / "+ Eigenes Bild" button */
.form-image-list .file-input {
  position: relative;
  flex: 0 0 auto;
  margin-left: 10px;
}
.form-image-list .file-input input {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  visibility: hidden;
  opacity: 0;
}
.form-image-list .file-input .btn-add {
  background: none;
  border: none;
  padding: 0 10px 0 0;
  appearance: none;
  display: flex;
  align-items: center;
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: nowrap;
  cursor: pointer;
}
.form-image-list .file-input .btn-add svg {
  display: block;
  margin: 0 9px 0 0;
}

/* Upload error message */
.form-image-upload .upload-error {
  padding: 4px 10px;
}
