/**
 * SEOFlood File Upload - Dropzone Styles
 */

.seoflood-dropzone-container {
  margin: 8px 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Info bar ─────────────────────────────────────────────────────── */

.dropzone-info-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  padding: 5px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  font-size: 1.2rem;
  color: #64748b;
  line-height: 1.4;
}

.info-sep {
  color: #cbd5e1;
}

.info-count {
  font-weight: 600;
  color: #374151;
}

.info-count.info-count-full {
  color: #ef4444;
}

/* ── Drop area ────────────────────────────────────────────────────── */

.dropzone-area {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 0 0 8px 8px;
  min-height: 80px;
  background: #fff;
  transition: background 0.2s, border-color 0.2s;
  align-content: flex-start;
  /* override any Dropzone default .dropzone styles */
  min-height: 80px !important;
  border-style: solid !important;
}

.dropzone-area.dz-drag-hover {
  background: #eff6ff;
  border-color: #3b82f6 !important;
}

/* ── Add card (+) ─────────────────────────────────────────────────── */

.file-add-card {
  width: 125px;
  height: 125px;
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  flex-shrink: 0;
  background: #fafafa;
  box-sizing: border-box;
}

.file-add-card:hover {
  border-color: #3b82f6;
  background: #eff6ff;
}

.add-icon {
  font-size: 2.4rem;
  line-height: 1;
  color: #94a3b8;
  font-weight: 300;
  transition: color 0.2s;
  user-select: none;
}

.file-add-card:hover .add-icon {
  color: #3b82f6;
}

/* ── File cards ───────────────────────────────────────────────────── */

.file-card {
  width: 125px;
  height: 125px;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  animation: cardIn 0.2s ease;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.file-card-preview {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #e8edf2;
}

.file-card-icon {
  font-size: 2.2rem;
}

.file-card-name {
  padding: 0 5px;
  font-size: 1.1rem;
  font-weight: 500;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 20px;
  line-height: 20px;
  background: #fff;
  flex-shrink: 0;
}

/* Progress bar sits just above the name strip */
.file-card-progress {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(0, 0, 0, 0.08);
}

.file-card-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #1d4ed8);
  transition: width 0.3s ease;
}

/* Success state */
.file-card.upload-success::after {
  content: "✓";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 16px;
  height: 16px;
  background: #10b981;
  color: #fff;
  border-radius: 50%;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
}

/* Error state */
.file-card.upload-error {
  border-color: #fca5a5;
}

.file-card.upload-error .file-card-preview {
  background: #fee2e2;
}

.file-card.upload-error::after {
  content: "✕";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 16px;
  height: 16px;
  background: #ef4444;
  color: #fff;
  border-radius: 50%;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
}

/* Remove button — visible on hover */
.file-card-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  padding: 0;
}

.file-card:hover .file-card-remove {
  opacity: 1;
}

.file-card-remove:hover {
  background: #ef4444;
}

/* ── Error message ────────────────────────────────────────────────── */

.seoflood-dropzone-container .error-message {
  margin-top: 6px;
  padding: 8px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  color: #dc2626;
  font-size: 0.9rem;
  font-weight: 500;
}

/* ── Animations ───────────────────────────────────────────────────── */

@keyframes cardIn {
  from {
    opacity: 0;
    transform: scale(0.82);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.file-card.removing {
  animation: cardOut 0.22s ease forwards;
}

@keyframes cardOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.78);
  }
}

/* ── Form integration ─────────────────────────────────────────────── */

.form-row .seoflood-dropzone-container {
  margin: 5px 0 12px 0;
}

/* ── Responsive ───────────────────────────────────────────────────── */

@media (max-width: 480px) {
  .file-add-card,
  .file-card {
    width: 86px;
    height: 86px;
  }
  .dropzone-info-bar {
    font-size: 1rem;
  }
}

/* ── Print ────────────────────────────────────────────────────────── */

@media print {
  .file-card-remove {
    display: none !important;
  }
}
