/* builder.css — BC Email Builder */

/* ── Zones drag & drop ─────────────────────────────────────────── */
.drop-zone {
  position: relative;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #f9fafb;
  transition: border-color 0.15s ease, background 0.15s ease;
  overflow: hidden;
}

.drop-zone:hover {
  border-color: #6b7280;
  background: #f3f4f6;
}

.drop-zone.drag-over {
  border-color: #111827;
  background: #f0f0f0;
}

.drop-zone.has-image {
  border-style: solid;
  border-color: #d1d5db;
  background: #000;
}

.drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}

.drop-icon {
  width: 28px;
  height: 28px;
  color: #9ca3af;
}

.drop-text {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
}

.drop-hint {
  font-size: 10px;
  color: #9ca3af;
}

.drop-zone.has-image .drop-content {
  display: none;
}

/* ── Preview image dans la zone ────────────────────────────────── */
.drop-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

/* ── Spinner d'upload ──────────────────────────────────────────── */
.upload-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid #e5e7eb;
  border-top-color: #111827;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── URL display ───────────────────────────────────────────────── */
.drop-url {
  cursor: pointer;
  user-select: all;
  line-height: 1.4;
  max-height: 48px;
  overflow: hidden;
}

.drop-url:hover {
  background: #e5e7eb;
}

/* ── Preview iframe ────────────────────────────────────────────── */
.preview-wrapper {
  width: 620px;
  border-radius: 4px;
  overflow: hidden;
}

.preview-iframe {
  width: 620px;
  height: calc(100vh - 140px);
  border: none;
  display: block;
  overflow-y: scroll;
  background: #e7e7e7;
}

/* ── Onglets formulaire ────────────────────────────────────────── */
.tab-btn.active {
  background: white;
  color: #111827;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.preview-tab-btn.active {
  background: white;
  color: #111827;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

/* ── Scrollbar panneau gauche ──────────────────────────────────── */
.overflow-y-auto::-webkit-scrollbar {
  width: 5px;
}
.overflow-y-auto::-webkit-scrollbar-track {
  background: transparent;
}
.overflow-y-auto::-webkit-scrollbar-thumb {
  background: #e5e7eb;
  border-radius: 10px;
}
.overflow-y-auto::-webkit-scrollbar-thumb:hover {
  background: #d1d5db;
}

/* ── Zone overlay upload ───────────────────────────────────────── */
.drop-zone.uploading .drop-content {
  display: none;
}

.drop-zone.uploading .upload-spinner {
  display: flex !important;
}
