/*
 * upload-tray.css  —  Upload progress tray (fixed bottom-right)
 * Matches the portal UploadProgressBar card style.
 */

/* ── Tray wrapper ─────────────────────────────────────────────────────────── */
.ut-tray {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 360px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

/* ── Card ─────────────────────────────────────────────────────────────────── */
.ut-card {
    pointer-events: all;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(15,23,42,0.13), 0 2px 8px rgba(15,23,42,0.06);
    padding: 14px 16px 12px;
    animation: utSlideIn 0.18s ease-out;
}

.ut-card--success { border-left: 4px solid #16a34a; }
.ut-card--error   { border-left: 4px solid #dc2626; }

@keyframes utSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Top row: icon · text · action button ─────────────────────────────────── */
.ut-top-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.ut-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.95rem;
}
.ut-icon--uploading { background: #eff6ff; color: #2563eb; }
.ut-icon--success   { background: #dcfce7; color: #16a34a; }
.ut-icon--error     { background: #fee2e2; color: #dc2626; }
.ut-icon--retrying  { background: #fef3c7; color: #f59e0b; }

/* ── Meta: filename + doc type ────────────────────────────────────────────── */
.ut-meta {
    flex: 1;
    min-width: 0;
}

.ut-filename {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.ut-doctype {
    font-size: 0.7rem;
    font-weight: 700;
    color: #2563eb;
    letter-spacing: 0.04em;
    margin-top: 2px;
    text-transform: uppercase;
}

/* ── Action button (× Cancel or × dismiss) ────────────────────────────────── */
.ut-action-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    background: none;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 4px 9px;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
    transition: all 0.15s;
    line-height: 1;
}

.ut-action-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

/* ── Progress bar ─────────────────────────────────────────────────────────── */
.ut-progress-track {
    background: #e2e8f0;
    border-radius: 99px;
    height: 7px;
    overflow: hidden;
    margin-bottom: 7px;
}

.ut-progress-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.35s ease, background 0.25s ease;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
}

.ut-progress-fill--retrying  { background: #f59e0b; }
.ut-progress-fill--preparing {
    background: linear-gradient(90deg, #93c5fd, #3b82f6, #93c5fd);
    background-size: 200% 100%;
    animation: utPreparing 1.5s linear infinite;
}

@keyframes utPreparing {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* ── Bottom row: status text + file size ──────────────────────────────────── */
.ut-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ut-status-text {
    font-size: 0.75rem;
    color: #64748b;
}

.ut-status--success  { color: #16a34a; font-weight: 600; }
.ut-status--retrying { color: #b45309; }

.ut-filesize {
    font-size: 0.72rem;
    color: #64748b;
}

/* ── Error message ────────────────────────────────────────────────────────── */
.ut-error-msg {
    font-size: 0.72rem;
    color: #dc2626;
    margin-top: 4px;
    line-height: 1.5;
    word-break: break-word;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .ut-tray { left: 8px; right: 8px; width: auto; bottom: 8px; }
}
