/* ============================================
   UPLOAD PROGRESS PANEL
   Bottom-right panel: expanded (file list) or minimized (header only)
   ============================================ */

.upload-progress-panel {
  position: fixed;
  bottom: 0;
  right: 5.5rem;
  width: 360px;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.1);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.upload-progress-panel.hidden {
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
}

/* ---- Header ---- */
.upload-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
  cursor: default;
}

.is-minimized .upload-progress-header {
  border-bottom: none;
  cursor: pointer;
}

.is-minimized {
  border-radius: 10px 10px 0 0;
}

.upload-progress-header .up-title {
  font-family: var(--font-family-medium, sans-serif);
  font-size: 0.875rem;
  color: #1a1a1a;
}

.upload-progress-header .header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.upload-progress-header .header-actions button {
  background: none;
  border: none;
  padding: 4px 6px;
  cursor: pointer;
  color: rgba(0, 0, 0, 0.4);
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

.upload-progress-header .header-actions button:hover {
  color: rgba(0, 0, 0, 0.8);
  background: rgba(0, 0, 0, 0.05);
}

.upload-progress-header .header-actions button svg {
  pointer-events: none;
}

/* ---- Body (collapsible) ---- */
.upload-progress-body {
  max-height: 350px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease;
  opacity: 1;
}

.is-minimized .upload-progress-body {
  max-height: 0;
  opacity: 0;
}

/* ---- Subtitle ---- */
.up-subtitle {
  font-family: var(--font-family-base, sans-serif);
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.45);
  padding: 8px 16px 4px;
}

/* ---- File list ---- */
.upload-progress-list {
  overflow-y: auto;
  height: 205px;
  padding: 4px 0;
}

.upload-progress-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.upload-progress-item:last-child {
  border-bottom: none;
}

.upload-progress-item .item-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* Pending — faint circle */
.upload-progress-item .item-icon.status-pending {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: 50%;
}

/* Uploading/processing — spinning */
.upload-progress-item .item-icon.status-uploading {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-top-color: var(--primary, #7ba82e);
  border-radius: 50%;
  animation: up-spin 0.8s linear infinite;
}

/* Done — green check */
.upload-progress-item .item-icon.status-done::after {
  content: '✓';
  color: #15803d;
  font-size: 13px;
  font-weight: 700;
  line-height: 20px;
}

/* Error — red x */
.upload-progress-item .item-icon.status-error::after {
  content: '✕';
  color: #b91c1c;
  font-size: 13px;
  font-weight: 700;
  line-height: 20px;
}

.upload-progress-item .item-name {
  font-family: var(--font-family-base, sans-serif);
  font-size: 0.8125rem;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.upload-progress-item.is-done .item-name {
  color: rgba(0, 0, 0, 0.45);
}

.upload-progress-item.is-clickable {
  cursor: pointer;
}

.upload-progress-item.is-clickable:hover {
  background: rgba(0, 0, 0, 0.04);
}

.upload-progress-item.is-clickable:hover .item-name {
  color: #1a1a1a;
}

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

/* ---- Mobile ---- */
@media (max-width: 480px) {
  .upload-progress-panel {
    right: 1rem;
    bottom: 1rem;
    width: calc(100vw - 2rem);
  }
}
