/* ─── Image Drag-and-Drop Zone ───────────────────────────────────────────────── */

.img-drop { display: flex; flex-direction: column; gap: 8px; }

/* ── Zone principale ── */
.img-drop-zone {
  position: relative;
  border: 2px dashed var(--border-hover, rgba(255,255,255,.13));
  border-radius: var(--radius, 10px);
  background: var(--surface-2, #141414);
  transition: border-color .2s, background .2s;
  cursor: pointer;
  overflow: hidden;
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
}
.img-drop-zone:hover,
.img-drop-zone.drag-over {
  border-color: var(--accent, #5865f2);
  border-style: solid;
  background: var(--accent-dim, rgba(88,101,242,.08));
}
.img-drop-zone.uploading { pointer-events: none; opacity: .7; }

/* ── Placeholder ── */
.img-drop-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 16px;
  text-align: center;
  width: 100%;
  pointer-events: none;
}
.img-drop-placeholder svg {
  color: var(--text-3, rgba(255,255,255,.28));
  flex-shrink: 0;
}
.img-drop-hint {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2, rgba(255,255,255,.55));
  margin: 0;
}
.img-drop-browse-btn {
  pointer-events: all;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 12px;
  color: var(--accent, #5865f2);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.img-drop-browse-btn:hover { text-decoration: none; }
.img-drop-formats {
  font-size: 11px;
  color: var(--text-3, rgba(255,255,255,.28));
  margin: 0;
}

/* ── Aperçu image ── */
.img-drop-preview {
  position: relative;
  width: 100%;
  min-height: 110px;
  max-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  box-sizing: border-box;
}
.img-drop-preview img {
  max-width: 100%;
  max-height: 184px;
  object-fit: contain;
  border-radius: var(--radius-sm, 7px);
  display: block;
}
.img-drop-clear {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,.65);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.img-drop-clear:hover { background: rgba(237,66,69,.75); }

/* ── Barre de progression ── */
.img-drop-progress {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--border, rgba(255,255,255,.07));
  overflow: hidden;
}
.img-drop-progress-bar {
  height: 100%;
  background: var(--accent, #5865f2);
  animation: imgDropSlide 1.2s ease-in-out infinite;
  width: 40%;
}
@keyframes imgDropSlide {
  0%   { transform: translateX(-150%); }
  100% { transform: translateX(400%); }
}

/* ── Message d'erreur ── */
.img-drop-error {
  font-size: 12px;
  color: #ED4245;
  margin: 2px 0 0;
  padding: 0 2px;
}

/* ── Ligne URL de secours ── */
.img-drop-url-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.img-drop-url-label {
  font-size: 11px;
  color: var(--text-3, rgba(255,255,255,.28));
  white-space: nowrap;
  flex-shrink: 0;
}
.img-drop-url-input {
  flex: 1;
  min-width: 0;
  background: var(--surface-3, #1a1a1a);
  border: 1px solid var(--border, rgba(255,255,255,.07));
  border-radius: var(--radius-sm, 7px);
  padding: 6px 10px;
  color: var(--text, #f0f0f0);
  font-size: 12px;
  outline: none;
  font-family: inherit;
  transition: border-color .15s;
}
.img-drop-url-input:focus  { border-color: var(--accent, #5865f2); }
.img-drop-url-input::placeholder { color: var(--text-3, rgba(255,255,255,.28)); }

/* ── Label générique ── */
.img-drop > .form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2, rgba(255,255,255,.55));
  display: block;
  margin-bottom: 2px;
}

/* ── Overrides light mode ── */
html[data-theme="light"] .img-drop-zone {
  border-color: rgba(15,23,42,.2);
  background: #f4f6fb;
}
html[data-theme="light"] .img-drop-zone:hover,
html[data-theme="light"] .img-drop-zone.drag-over {
  border-color: var(--accent, #5865f2);
  background: var(--accent-dim, rgba(88,101,242,.08));
}
html[data-theme="light"] .img-drop-url-input {
  background: #ffffff;
  border-color: rgba(15,23,42,.15);
}
html[data-theme="light"] .img-drop-progress { background: rgba(15,23,42,.08); }
