/*
 * Background async upload panel styles
 * Provides non-blocking UI feedback for file uploads.
 */
.async-upload-panel {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 320px;
    max-width: calc(100% - 48px);
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1060;
    font-family: "Poppins", "Segoe UI", sans-serif;
    color: #0f172a;
}

.async-upload-panel.is-hidden {
    display: none !important;
}

.async-upload-panel.is-visible {
    display: flex;
}

.async-upload-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
}

.async-upload-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.async-upload-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.async-upload-close,
.async-upload-cancel {
    border: none;
    background: rgba(15, 23, 42, 0.18);
    color: #ffffff;
    width: 26px;
    height: 26px;
    border-radius: 26px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
}

.async-upload-close:hover,
.async-upload-cancel:hover:not([disabled]) {
    background: rgba(15, 23, 42, 0.32);
}

.async-upload-cancel[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

.async-upload-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.async-upload-status {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.async-upload-status-line {
    font-size: 13px;
    line-height: 1.4;
}

.async-upload-queue-line {
    font-size: 12px;
    color: #475569;
}

.async-upload-progress {
    position: relative;
    width: 100%;
    height: 6px;
    background: rgba(148, 163, 184, 0.35);
    border-radius: 999px;
    overflow: hidden;
}

.async-upload-progress-bar {
    position: absolute;
    inset: 0;
    width: 0;
    background: linear-gradient(135deg, #38bdf8, #6366f1);
    transition: width 0.2s ease;
}

.async-upload-progress-bar.is-error {
    background: linear-gradient(135deg, #f87171, #f97316);
}

.async-upload-results {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 220px;
    overflow-y: auto;
}

.async-upload-result {
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(248, 250, 252, 0.9);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.async-upload-result--error {
    border-color: rgba(248, 113, 113, 0.65);
    background: rgba(254, 242, 242, 0.95);
    color: #991b1b;
}

.async-upload-result--cancelled {
    border-color: rgba(251, 191, 36, 0.65);
    background: rgba(255, 251, 235, 0.95);
    color: #92400e;
}

.async-upload-result-title {
    font-size: 13px;
    font-weight: 600;
    color: inherit;
}

.async-upload-result-meta {
    font-size: 12px;
    color: #475569;
    line-height: 1.45;
}

.async-upload-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.async-upload-pill {
    border: none;
    background: #1d4ed8;
    color: #ffffff;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: background 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.async-upload-pill:hover {
    background: #1e40af;
    color: #ffffff;
    text-decoration: none;
}

.async-upload-pill.is-neutral {
    background: #0f172a;
}

.async-upload-pill.is-light {
    background: rgba(15, 23, 42, 0.08);
    color: #0f172a;
}

.async-upload-pill.is-light:hover {
    background: rgba(15, 23, 42, 0.14);
}

.async-upload-empty {
    font-size: 12px;
    color: #64748b;
    text-align: center;
    padding: 6px 0;
}

@media (max-width: 575.98px) {
    .async-upload-panel {
        right: 16px;
        left: 16px;
        width: auto;
        max-width: none;
        bottom: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .async-upload-progress-bar {
        transition: none;
    }
}
