/* ============================================================================
   DOWNLOAD PANEL STYLES
   Modern, beautiful download panel for 4 file types (STEP, OBJ, JSON, PDF)
   ============================================================================ */

/* Download Panel Container */
.download-panel {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
  position: relative;
  overflow: hidden;
  animation: slideInFromRight 0.5s ease-out;
  margin-bottom: 24px;
}

/* Glass morphism effect */
.download-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  z-index: 0;
}

/* Panel Header */
.download-panel-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  color: white;
}

.download-panel-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.download-panel-title i {
  font-size: 1.5rem;
  animation: pulse 2s infinite;
}

.download-panel-subtitle {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 4px;
}

/* Download Grid */
.download-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

/* Individual Download Button */
.download-btn {
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.download-btn:hover:not(.disabled) {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  background: white;
}

.download-btn:active:not(.disabled) {
  transform: translateY(-2px);
}

/* Disabled state */
.download-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.5);
}

/* File type specific colors */
.download-btn.step-btn {
  border-left: 4px solid #10b981;
}

.download-btn.step-btn .download-icon {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.download-btn.obj-btn {
  border-left: 4px solid #3b82f6;
}

.download-btn.obj-btn .download-icon {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.download-btn.json-btn {
  border-left: 4px solid #f59e0b;
}

.download-btn.json-btn .download-icon {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.download-btn.pdf-btn {
  border-left: 4px solid #ef4444;
}

.download-btn.pdf-btn .download-icon {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Download Icon */
.download-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* File Info */
.download-file-info {
  text-align: center;
  width: 100%;
}

.download-file-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: #1f2937;
  margin-bottom: 4px;
}

.download-file-size {
  font-size: 0.75rem;
  color: #6b7280;
}

/* Status Badge */
.download-status {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.download-status.ready {
  background: #dcfce7;
  color: #166534;
}

.download-status.unavailable {
  background: #fee2e2;
  color: #991b1b;
}

/* Download All Button */
.download-all-btn {
  position: relative;
  z-index: 1;
  width: 100%;
  background: white;
  color: #667eea;
  border: none;
  border-radius: 12px;
  padding: 16px;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.download-all-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
}

.download-all-btn:active:not(:disabled) {
  transform: translateY(0);
}

.download-all-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.download-all-btn i {
  font-size: 1.25rem;
}

/* Loading State */
.download-btn.loading .download-icon {
  animation: spin 1s linear infinite;
}

.download-all-btn.loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 3px solid #667eea;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}

/* Animations */
@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* File Count Badge */
.file-count-badge {
  background: rgba(255, 255, 255, 0.3);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.file-count-badge i {
  font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .download-grid {
    grid-template-columns: 1fr;
  }
  
  .download-panel {
    padding: 16px;
  }
  
  .download-panel-title {
    font-size: 1.125rem;
  }
}

/* Hidden state */
.download-panel.hidden {
  display: none;
}

/* Success animation when file is ready */
@keyframes successPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.download-btn.ready {
  animation: successPulse 2s infinite;
}

