/**
 * Upload Progress Bar
 * Injected by document_upload_controller.js below the drop zone while a file
 * is being sent. Determinate (width = bytes sent) when the controller owns the
 * XHR; .is-indeterminate for native submits where no progress events exist.
 */
.upload-progress {
    margin-top: 12px;
}

.upload-progress-track {
    height: 8px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.upload-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #16a34a, #22c55e);
    transition: width 0.2s ease;
}

.upload-progress-label {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
    font-size: 0.85rem;
    color: #6b7280;
}

.upload-progress.is-done .upload-progress-fill {
    background: #16a34a;
}

.upload-progress.is-done .upload-progress-text {
    color: #166534;
    font-weight: 600;
}

/* No byte counts available (native form submit) — slide a bar back and forth
   so it still reads as "in flight" rather than frozen. */
.upload-progress.is-indeterminate .upload-progress-fill {
    width: 40%;
    transition: none;
    animation: uploadProgressSlide 1.1s ease-in-out infinite;
}

@keyframes uploadProgressSlide {
    0%   { margin-left: -40%; }
    100% { margin-left: 100%; }
}
