/* ═══════════════════════════════════════════════════════════
   TRANSFERS DOCK — Exact SVG Match
   ═══════════════════════════════════════════════════════════ */

#global-upload-panel {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 400px;
    max-width: calc(100vw - 48px);
    z-index: 9999;
}

#global-upload-panel.u-hidden {
    display: none !important;
}

.transfers-dock {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14), 0 4px 12px rgba(15, 23, 42, 0.06);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    font-family: system-ui, -apple-system, sans-serif;
}

/* ═══ HEADER ═══ */
.dock-header {
    padding: 14px 16px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.dock-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.dock-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.dock-title strong {
    font-weight: 600;
    color: #3b82f6;
}

.cloud-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #eff6ff;
    color: #3b82f6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.dock-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.btn-text {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    font-size: 10.5px;
    color: #475569;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-text:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

.btn-icon {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #64748b;
    cursor: pointer;
    font-size: 12px;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.15s ease;
}

.btn-icon:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

/* ═══ MASTER PROGRESS ═══ */
.master-progress-wrap {
    margin-top: 10px;
}

.master-bar-track {
    height: 5px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.master-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #06b6d4, #3b82f6, #8b5cf6, #ec4899);
    background-size: 200% 100%;
    animation: master-flow 4s ease infinite;
    transition: width 0.3s ease;
}

@keyframes master-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.master-stats {
    display: flex;
    justify-content: space-between;
    font-size: 10.5px;
    color: #64748b;
    margin-top: 6px;
    font-weight: 600;
}

#dockMasterSpeed {
    color: #3b82f6;
}

/* ═══ ITEMS LIST (scrollable) ═══ */
.dock-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 6px 0;
}

.dock-list::-webkit-scrollbar {
    width: 5px;
}

.dock-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.dock-list::-webkit-scrollbar-track {
    background: transparent;
}

/* ═══ ITEM ROW ═══ */
.dock-item {
    padding: 10px 16px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease;
}

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

.dock-item:hover {
    background: #fafbfc;
}

/* Row 1: icon + name + actions */
.item-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.item-info-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.item-icon {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    background: #f1f5f9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.file-name {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Row 2: meta */
.item-meta {
    font-size: 10.5px;
    color: #64748b;
    margin-top: 4px;
    font-weight: 500;
}

/* Row 3: seekbar */
.seek-track {
    height: 4px;
    background: #f1f5f9;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 6px;
}

.seek-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.vibrant-gradient {
    background: linear-gradient(90deg, #06b6d4, #3b82f6, #8b5cf6, #ec4899);
    background-size: 200% 100%;
    animation: seek-flow 3s ease infinite;
}

@keyframes seek-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.paused-fill {
    background: #94a3b8;
}

.done-fill {
    background: #22c55e;
}

/* ═══ ACTIONS ═══ */
.item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    align-items: center;
}

.icon-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    font-size: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    transition: all 0.15s ease;
    padding: 0;
    line-height: 1;
}

.icon-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.close-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #ef4444;
}

.resume-btn {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #16a34a;
}

.resume-btn:hover {
    background: #dcfce7;
    border-color: #86efac;
}

/* Processing spinner on the light-green pause/resume button:
   the default white spinner is invisible on #f0fdf4, so use the button's green. */
.resume-btn .cv-loader,
.dock-item .icon-btn .cv-loader--white {
    color: #16a34a;
}

.badge-done {
    font-size: 9.5px;
    font-weight: 700;
    color: #15803d;
    background: #dcfce7;
    padding: 3px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

/* ═══ FOOTER ═══ */
.dock-footer {
    padding: 10px 16px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    font-size: 10.5px;
    font-weight: 600;
    color: #64748b;
    text-align: center;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 480px) {
    #global-upload-panel {
        right: 12px;
        bottom: 12px;
        left: 12px;
        width: auto;
    }
}


/* ═══ DIRECTION INDICATOR ═══ */
.item-direction {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.direction-upload {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
}

.direction-download {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #15803d;
}

/* Adjust icon size slightly */
.item-icon {
    font-size: 14px !important;
}

/* ═══ STATUS ROW (dock only) ═══
   One scoped rule set. popup.css / dashboard.css style .upload-status-text with !important
   pills and colours; these !important overrides win inside the dock. Status sits under the
   meta line, above the seekbar, in a consistent 11px/600 weight. */
.dock-item .upload-status-text {
    display: block !important;
    margin: 4px 0 0 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    letter-spacing: 0 !important;
    font-variant-numeric: tabular-nums !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
.dock-item .upload-status-text.status-uploading,
.dock-item .upload-status-text.status-saving { color: #2563eb !important; }
.dock-item .upload-status-text.status-downloading { color: #0ea5e9 !important; }
.dock-item .upload-status-text.status-resuming { color: #0ea5e9 !important; }
.dock-item .upload-status-text.status-pausing { color: #d97706 !important; }
.dock-item .upload-status-text.status-paused { color: #64748b !important; }
.dock-item .upload-status-text.status-complete { color: #059669 !important; }
.dock-item .upload-status-text.status-error { color: #dc2626 !important; }

/* Status states: transparent background (no grey/colour pill) inside the dock.
   (0,3) specificity beats dashboard.css / popup.css .upload-status-text.status-* (0,2). */
.dock-item .upload-status-text.status-uploading,
.dock-item .upload-status-text.status-saving,
.dock-item .upload-status-text.status-downloading,
.dock-item .upload-status-text.status-resuming,
.dock-item .upload-status-text.status-pausing,
.dock-item .upload-status-text.status-paused,
.dock-item .upload-status-text.status-complete,
.dock-item .upload-status-text.status-error,
.dock-item .upload-status-text.status-queued,
.dock-item .upload-status-text.status-finalizing {
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
}

/* ═══ COMPACT ITEM (approved mockup) ═══
   Row 1: [icon btn][icon btn] filename  (single line)
   Row 2: 3px bar, full width
   Row 3: size · speed · ETA, 10.5px, one line
   No status text row. State shows through bar colour + icon. */
.dock-item {
    padding: 7px 12px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 5px !important;
}
.dock-item .item-top {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    min-width: 0 !important;
}
.dock-item .item-actions {
    display: flex !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
}
.dock-item .icon-btn {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    padding: 0 !important;
}
.dock-item .file-name {
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    min-width: 0 !important;
    flex: 1 !important;
}
.dock-item .seek-track {
    height: 5px !important;
    margin: 0 !important;
    background: #e2e8f0 !important;
    border-radius: 2px !important;
}
.dock-item .seek-fill { height: 100% !important; border-radius: 2px !important; }
.dock-item .seek-fill.active-fill { background: #2563eb !important; }
.dock-item .seek-fill.paused-fill { background: #94a3b8 !important; }
.dock-item .seek-fill.done-fill { background: #16a34a !important; }
.dock-item .seek-fill.error-fill { background: #dc2626 !important; }
.dock-item .item-meta {
    font-size: 10.5px !important;
    color: #64748b !important;
    margin: 0 !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-variant-numeric: tabular-nums !important;
}
/* status text row is removed from the item */
.dock-item .upload-status-text { display: none !important; }
/* dock list: max height + scroll for 10+ items */
.dock-list { max-height: 320px !important; overflow-y: auto !important; }

/* ═══ ROW 1 LAYOUT: [arrow][name] left · [buttons] right ═══ */
.dock-item .item-top {
    justify-content: space-between !important;
}
.dock-item .item-left {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex: 1 !important;
    min-width: 0 !important;
}
/* Plain arrow: no gradient, no box. Overrides .direction-* gradients above (0,2) */
.dock-item .item-direction {
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    font-size: 11px !important;
    font-weight: 400 !important;
}
.dock-item .item-direction.direction-download { color: #2563eb !important; }
.dock-item .item-direction.direction-upload { color: #16a34a !important; }
