/* Progress Indicator Styles */
.progress-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.progress-overlay.hidden {
  display: none;
}

.progress-container {
  background: white;
  border-radius: 16px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  animation: slideIn 0.3s ease-out;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.progress-header {
  text-align: center;
  padding: 32px 32px 16px 32px;
  border-bottom: 1px solid #e0e0e0;
  flex-shrink: 0;
}

.progress-header h3 {
  margin: 0 0 12px 0;
  color: var(--color-text-primary);
  font-family: "Libre Baskerville", serif;
  font-size: 1.4rem;
}

.overall-progress {
  color: #666;
  font-size: 0.95rem;
}

.files-progress {
  flex: 1;
  overflow-y: auto;
  padding: 20px 32px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
}

.files-progress:has(.file-progress-item:nth-child(4)) {
  justify-content: flex-start;
}

.files-progress::-webkit-scrollbar {
  width: 8px;
}

.files-progress::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.files-progress::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.files-progress::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

.file-progress-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  margin: 6px 0;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #e9ecef;
  transition: all 0.3s ease;
}

.file-progress-item:hover {
  background: #f0f2f5;
  border-color: var(--color-recommended-normal);
}

.file-info {
  flex: 1;
  margin-right: 16px;
}

.file-name {
  font-weight: 600;
  color: #333;
  font-size: 0.9rem;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-status {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 2px;
}

.file-phase {
  font-size: 0.8rem;
  color: #666;
  font-style: italic;
}

.progress-circle-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-circle {
  transform: rotate(-90deg);
  transition: all 0.3s ease;
}

.progress-circle-bg {
  fill: none;
  stroke: #e9ecef;
  stroke-width: 3;
}

.progress-circle-fill {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease, stroke 0.3s ease;
  stroke-dasharray: 94.25; /* 2π * 15 */
  stroke-dashoffset: 94.25;
}

/* Status-based colors */
.status-waiting {
  stroke: #6c757d;
}

.status-uploading {
  stroke: #17a2b8;
}

.status-textract {
  stroke: #ffc107;
}

.status-bedrock {
  stroke: var(--color-recommended-normal);
}

.status-completed {
  stroke: #28a745;
}

.status-error {
  stroke: #dc3545;
}

.progress-percentage {
  position: absolute;
  font-size: 0.7rem;
  font-weight: 600;
  color: #333;
  pointer-events: none;
}

.progress-actions {
  display: flex;
  justify-content: center;
  padding: 16px 32px 32px 32px;
  border-top: 1px solid #e0e0e0;
  flex-shrink: 0;
  background: white;
}

.btn-cancel {
  background-color: var(--color-default-normal);
  color: var(--color-negative-normal);
  border: 2px solid var(--color-default-highlighted);
  padding: 10px 28px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  box-shadow: none;
  text-transform: none;
  text-align: center;
  line-height: 1.2;
  outline: none;
  transform: none;
}

.btn-cancel:hover {
  color: #fff;
  background-color: var(--color-negative-normal);
  border-color: var(--color-negative-normal);
  box-shadow: none;
  transform: none;
}

.btn-cancel:active {
  color: #fff;
  background-color: var(--color-negative-normal);
  border-color: var(--color-negative-normal);
  box-shadow: none;
  transform: none;
}

.btn-cancel:focus {
  outline: none;
  box-shadow: none;
}

/* Responsive design */
@media (max-width: 768px) {
  .progress-container {
    padding: 24px 16px;
    margin: 16px;
    width: calc(100% - 32px);
  }

  .file-progress-item {
    padding: 12px;
  }

  .file-name {
    font-size: 0.85rem;
  }

  .progress-circle {
    width: 35px;
    height: 35px;
  }

  .progress-circle-bg,
  .progress-circle-fill {
    r: 12;
  }
}

/* Animations for different states */
.status-textract .progress-circle-fill,
.status-bedrock .progress-circle-fill {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Custom scrollbar for files list */
.files-progress::-webkit-scrollbar {
  width: 6px;
}

.files-progress::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.files-progress::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.files-progress::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}
