/* Reusable Image Uploader styles */
.riu { margin-top: 4px; }

/* Dropzone */
.riu-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  background: #fafafa;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.riu-dropzone:hover {
  background: #f5f8ff;
  border-color: #93c5fd;
}
.riu-dropzone.is-dragover {
  background: #eef6ff;
  border-color: #60a5fa;
  box-shadow: inset 0 0 0 2px #bfdbfe;
}
.riu-dropzone .riu-instructions {
  color: #475569;
}
.riu-dropzone .riu-icon {
  font-size: 28px;
  color: #2563eb;
}

/* Previews grid */
.riu-previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  min-height: 20px; /* Ensure container is visible even when empty */
}
.riu-thumb {
  width: 100%;
  height: 120px;
  position: relative;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.riu-thumb-inner {
  width: 100%;
  height: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.riu-thumb-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Drag handle */
.riu-handle {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 12px;
  line-height: 1;
  cursor: grab;
  user-select: none;
}

/* Actions hover-reveal */
.riu-actions {
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.riu-thumb-inner:hover + .riu-actions,
.riu-thumb:hover .riu-actions {
  opacity: 1;
}

/* Cover badge */
.riu-badge-cover {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #2563eb;
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  padding: 3px 8px;
  line-height: 1;
  display: none;
}
.riu-thumb.is-cover .riu-badge-cover { display: inline-block; }
.riu-thumb.is-cover .riu-thumb-inner {
  outline: 2px solid #2563eb;
  box-shadow: 0 0 0 2px #bfdbfe inset;
}

/* Dragging state */
.riu-thumb.is-dragging { opacity: 0.6; }

/* Focus visibility for accessibility */
.riu-dropzone:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
