/**
 * Professional Artwork Upload Enhancement Styles
 * Beautiful, modern upload interface with progress, errors, and notifications
 */

/* Upload Progress Overlay */
.upload-progress-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 8px;
  animation: fadeIn 0.3s ease;
}

.progress-content {
  text-align: center;
  padding: 20px;
  width: 80%;
}

/* Spinning loader */
.progress-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #2196F3;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Slide-in animation for notifications */
@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  margin: 10px 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2196F3, #21CBF3);
  transition: width 0.3s ease;
  border-radius: 4px;
}

.progress-text {
  font-size: 16px;
  font-weight: 600;
  color: #2196F3;
  margin-top: 8px;
}

.file-size {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
}

/* Upload Error Overlay */
.upload-error-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(244, 67, 54, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 8px;
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.error-content {
  text-align: center;
  padding: 20px;
  color: white;
}

.error-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 10px;
}

.error-message {
  font-size: 14px;
  margin: 10px 0;
  line-height: 1.4;
}

.error-actions {
  margin-top: 15px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.error-actions button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-retry {
  background: white;
  color: #f44336;
}

.btn-retry:hover {
  background: #f5f5f5;
  transform: scale(1.05);
}

.btn-cancel {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid white;
}

.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Success Notification */
.upload-success-notification {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #4CAF50;
  color: white;
  padding: 12px 24px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  z-index: 11;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
  animation: successPop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes successPop {
  0% { transform: translate(-50%, -50%) scale(0); }
  50% { transform: translate(-50%, -50%) scale(1.1); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

.success-icon {
  font-size: 18px;
  width: 24px;
  height: 24px;
  background: white;
  color: #4CAF50;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* Quality Warning Tooltip */
.quality-warning-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #FF9800;
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 10px;
  z-index: 12;
  min-width: 250px;
  max-width: 350px;
  box-shadow: 0 4px 16px rgba(255, 152, 0, 0.3);
  animation: slideDown 0.3s ease;
  cursor: pointer;
}

.quality-warning-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: #FF9800;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.warning-icon {
  font-size: 20px;
  margin-bottom: 8px;
  display: block;
}

.quality-warning-tooltip strong {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
}

.quality-warning-tooltip ul {
  margin: 0;
  padding-left: 20px;
  font-size: 12px;
  line-height: 1.6;
}

.quality-warning-tooltip li {
  margin-bottom: 4px;
}

/* Drag and Drop Support */
.mini-card.drag-over {
  border: 3px dashed #2196F3 !important;
  background: rgba(33, 150, 243, 0.05);
  transform: scale(1.02);
}

.mini-card.drag-over::before {
  content: '📁 Drop file here';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #2196F3;
  font-weight: 600;
  font-size: 14px;
  background: white;
  padding: 8px 16px;
  border-radius: 4px;
  z-index: 5;
  pointer-events: none;
}

/* Enhanced Mini-Card States */
.mini-card.uploading {
  position: relative;
  pointer-events: none;
}

.mini-card.has-artwork {
  border-color: #4CAF50;
  border-width: 2px;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
}

.mini-card.has-artwork .artwork-image {
  opacity: 1;
}

.mini-card.error,
.mini-card.upload-error {
  border-color: #f44336;
  border-width: 3px;
  box-shadow: 0 2px 12px rgba(244, 67, 54, 0.4);
  animation: errorPulse 1.5s ease-in-out;
}

@keyframes errorPulse {
  0%, 100% { box-shadow: 0 2px 12px rgba(244, 67, 54, 0.4); }
  50% { box-shadow: 0 4px 20px rgba(244, 67, 54, 0.7); }
}

.mini-card.upload-error::before {
  content: '⚠️ Upload Failed';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: #f44336;
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  z-index: 15;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(244, 67, 54, 0.4);
  animation: slideDown 0.3s ease;
}

.mini-card.click-active {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
  transition: all 0.1s ease;
}

/* Mini-card as upload button indicator */
.mini-card:not(.has-artwork):not(.uploading):hover {
  cursor: pointer;
  border-color: #2196F3;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2);
  transition: all 0.2s ease;
}

.mini-card:not(.has-artwork):not(.uploading)::after {
  content: '📁 Click to Upload';
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(33, 150, 243, 0.9);
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  white-space: nowrap;
}

.mini-card:not(.has-artwork):not(.uploading):hover::after {
  opacity: 1;
}

/* File Info Badge */
.file-info-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  z-index: 5;
  pointer-events: none;
}

/* Animation for fade in */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .quality-warning-tooltip {
    min-width: 200px;
    max-width: 280px;
    font-size: 11px;
  }

  .progress-content {
    width: 90%;
    padding: 15px;
  }

  .progress-spinner {
    width: 32px;
    height: 32px;
  }

  .error-icon {
    font-size: 36px;
  }
}

/* Print Quality Indicators */
.print-quality-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  z-index: 5;
  cursor: help;
}

.print-quality-indicator.good {
  background: #4CAF50;
  color: white;
}

.print-quality-indicator.warning {
  background: #FF9800;
  color: white;
}

.print-quality-indicator.poor {
  background: #f44336;
  color: white;
}

/* File type icons */
.file-type-icon {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  z-index: 5;
}

.file-type-icon.pdf { color: #FF5252; }
.file-type-icon.jpg,
.file-type-icon.jpeg,
.file-type-icon.png { color: #4CAF50; }
.file-type-icon.eps,
.file-type-icon.ai { color: #FF9800; }
.file-type-icon.psd { color: #2196F3; }
