/**
 * Modern Drag & Drop Image Uploader for Erin's Seed Catalog
 */

.esc-image-uploader {
  margin-bottom: 20px;
  width: 100%;
}

/* Drop Zone */
.esc-dropzone {
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  transition: all 0.3s ease;
  background-color: #f9f9f9;
  position: relative;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.esc-dropzone:hover,
.esc-dropzone.esc-drag-over {
  border-color: #3a7bd5;
  background-color: #f0f7ff;
}

.esc-dropzone-icon {
  font-size: 36px;
  color: #999;
  margin-bottom: 10px;
}

.esc-dropzone-text {
  color: #666;
  margin-bottom: 10px;
}

.esc-dropzone-subtext {
  color: #999;
  font-size: 12px;
}

/* Image Preview */
.esc-image-preview {
  position: relative;
  margin-top: 15px;
  display: none; /* Hidden by default, shown when image is selected */
}

.esc-preview-image {
  max-width: 100%;
  max-height: 200px;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.esc-preview-actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
}

.esc-remove-image {
  color: #e74c3c;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
}

.esc-remove-image .dashicons {
  margin-right: 5px;
}

/* Upload Progress */
.esc-upload-progress {
  width: 100%;
  height: 4px;
  background-color: #eee;
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
  display: none;
}

.esc-progress-bar {
  height: 100%;
  background-color: #3a7bd5;
  width: 0%;
  transition: width 0.3s ease;
}

/* Error and Success Messages */
.esc-upload-error {
  margin-top: 10px;
  font-size: 13px;
  display: none;
  padding: 8px 12px;
  border-radius: 4px;
}

.esc-error {
  color: #e74c3c;
  background-color: #fdecea;
  border: 1px solid #f8d7da;
}

.esc-success {
  color: #2a9d8f;
  background-color: #e8f8f5;
  border: 1px solid #d1f2eb;
}

/* Button Styles */
.esc-button-group {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

.esc-button {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
  border: 1px solid #ccc;
}

.esc-button-secondary {
  background-color: #f8f8f8;
  color: #555;
}

.esc-button-secondary:hover {
  background-color: #eee;
}

.esc-button .dashicons {
  margin-right: 5px;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .esc-dropzone {
    padding: 20px;
    min-height: 120px;
  }

  .esc-dropzone-icon {
    font-size: 28px;
  }

  .esc-button-group {
    flex-direction: column;
    width: 100%;
  }
}

/* Animation for drag over */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.esc-dropzone.esc-drag-over {
  animation: pulse 1s infinite;
}
