/* Upload progress ring, badge and dropdown panel */

/* Wrapper injected around .icon-btn.upload by upload_manager.js */
.upload-btn-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* SVG progress ring: sits inside the button, centered */
.upload-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  pointer-events: none;
  display: none;
}

.upload-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.upload-ring-bg {
  fill: none;
  stroke: rgba(255,255,255,0.25);
  stroke-width: 2.8;
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
}

.upload-ring-fill {
  fill: none;
  stroke: #3b82f6;
  stroke-width: 2.8;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.35s ease;
}

/* Active upload count badge */
.upload-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 15px;
  height: 15px;
  border-radius: 8px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
  z-index: 10;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  border: 1.5px solid #fff;
}

/* Dropdown panel */
.upload-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: -8px;
  width: 300px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.13);
  z-index: 2000;
  display: none;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
}

.upload-panel.open {
  display: block;
}

.upload-panel-header {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafafa;
}

.upload-panel-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  font-size: 18px;
  padding: 0;
  line-height: 1;
}
.upload-panel-close:hover { color: #374151; }

.upload-panel-body {
  max-height: 280px;
  overflow-y: auto;
}

.upload-panel-empty {
  padding: 20px 14px;
  text-align: center;
  color: #9ca3af;
  font-size: 12px;
}

.upload-file-item {
  padding: 9px 14px;
  border-bottom: 1px solid #f3f4f6;
}
.upload-file-item:last-child { border-bottom: none; }

.upload-file-name {
  font-size: 12px;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.upload-status-icon {
  font-size: 11px;
  flex-shrink: 0;
}

.upload-file-bar-track {
  height: 4px;
  background: #f3f4f6;
  border-radius: 2px;
  overflow: hidden;
}

.upload-file-bar-fill {
  height: 100%;
  background: #3b82f6;
  border-radius: 2px;
  transition: width 0.3s ease;
}
.upload-file-bar-fill.done  { background: #10b981; }
.upload-file-bar-fill.error { background: #ef4444; }

.upload-file-pct {
  font-size: 10px;
  color: #6b7280;
  margin-top: 3px;
  text-align: right;
}
