/* CV Processing Queue Styles */
.cv-queue-widget {
  position: fixed;
  bottom: 84px;
  left: 300px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  width: 380px;
  max-height: 480px;
  z-index: 9999;
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 2px solid #ff6101;
}

.cv-queue-widget.active {
  display: flex;
}

.cv-queue-header {
  background: linear-gradient(135deg, #ff6101 0%, #d14400 100%);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.cv-queue-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cv-queue-count {
  background: rgba(255,255,255,0.3);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.cv-queue-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.cv-queue-item {
  background: #f9fafb;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  border-left: 4px solid #e5e7eb;
}

.cv-queue-item.queued {
  border-left-color: #3b82f6;
  background: #eff6ff;
}

.cv-queue-item.processing {
  border-left-color: #ff6101;
  background: #fff7ed;
  animation: pulse 2s ease-in-out infinite;
}

.cv-queue-item.completed {
  border-left-color: #10b981;
  background: #f0fdf4;
}

.cv-queue-item.failed {
  border-left-color: #ef4444;
  background: #fef2f2;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.cv-queue-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.cv-queue-candidate {
  font-weight: 600;
  font-size: 14px;
  color: #1f2937;
}

.cv-queue-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.cv-queue-status.queued {
  background: #3b82f6;
  color: white;
}

.cv-queue-status.processing {
  background: #ff6101;
  color: white;
}

.cv-queue-status.completed {
  background: #10b981;
  color: white;
}

.cv-queue-status.failed {
  background: #ef4444;
  color: white;
}

.cv-queue-file {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}

.cv-queue-time {
  font-size: 11px;
  color: #9ca3af;
}

.cv-queue-progress {
  margin-top: 8px;
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
}

.cv-queue-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #ff6101 0%, #d14400 100%);
  transition: width 0.3s ease;
  animation: indeterminate 1.5s ease-in-out infinite;
}

@keyframes indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

.cv-queue-empty {
  text-align: center;
  padding: 40px 20px;
  color: #9ca3af;
}

.cv-queue-empty i {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.cv-queue-footer {
  padding: 12px 20px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cv-queue-refresh-btn {
  background: #ff6101;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.cv-queue-refresh-btn:hover {
  background: #d14400;
  transform: translateY(-1px);
}

.cv-queue-refresh-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
}

.cv-queue-last-update {
  font-size: 11px;
  color: #6b7280;
}

/* Floating Action Button */
.cv-queue-fab {
  position: fixed;
  bottom: 24px;
  left: 300px;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #ff6101 0%, #d14400 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255, 97, 1, 0.4);
  z-index: 9998;
  transition: all 0.3s ease;
}

.cv-queue-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(255, 97, 1, 0.6);
}

.cv-queue-fab.has-jobs {
  animation: bounce 2s ease-in-out infinite;
}

.cv-queue-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Stats Bar */
.cv-queue-stats {
  display: flex;
  gap: 2px;
  padding: 8px 12px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.cv-queue-stat {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: default;
}

.cv-queue-stat.queued { background: #dbeafe; color: #1e40af; }
.cv-queue-stat.processing { background: #fff7ed; color: #c2410c; }
.cv-queue-stat.completed { background: #d1fae5; color: #065f46; }
.cv-queue-stat.failed { background: #fee2e2; color: #991b1b; }
.cv-queue-stat.dead_letter { background: #fce7f3; color: #9d174d; }

/* Dead Letter item */
.cv-queue-item.dead_letter {
  border-left-color: #9d174d;
  background: #fdf2f8;
}

.cv-queue-status.dead_letter {
  background: #9d174d;
  color: white;
}

/* Status row with retry info */
.cv-queue-status-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cv-queue-retry-info {
  font-size: 10px;
  color: #9ca3af;
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Error message */
.cv-queue-error {
  color: #ef4444;
  font-size: 11px;
  margin-top: 4px;
  line-height: 1.3;
}

/* Retry Button */
.cv-queue-retry-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 5px 12px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fbbf24;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.cv-queue-retry-btn:hover:not(:disabled) {
  background: #fbbf24;
  color: #78350f;
  transform: translateY(-1px);
}

.cv-queue-retry-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Resurrect Button */
.cv-queue-resurrect-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 5px 12px;
  background: #fce7f3;
  color: #9d174d;
  border: 1px solid #f472b6;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.cv-queue-resurrect-btn:hover:not(:disabled) {
  background: #f472b6;
  color: white;
  transform: translateY(-1px);
}

.cv-queue-resurrect-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Responsive: CV Queue Widget & FAB */
@media (max-width: 768px) {
  .cv-queue-fab {
    left: auto;
    right: 90px;
    bottom: 20px;
    width: 44px;
    height: 44px;
    font-size: 18px;
  }

  .cv-queue-widget {
    left: 12px;
    right: 12px;
    bottom: 72px;
    width: auto;
  }
}
