/* Header Badge — Gmail Import Progress Indicator */
/* PRD v10.1: Gmail Import via Chat */

.header-badge-btn {
  position: relative;
  display: none; /* hidden by default, shown by JS */
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 36px;
  width: 36px;
  min-height: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  padding: 0;
  transition: background-color 0.2s;
}

.header-badge-btn:hover {
  background-color: rgba(0, 0, 0, 0.06);
}

.header-badge-btn.visible {
  display: inline-flex;
}

/* Pulsing animation for running state — use box-shadow instead of opacity
   so the child dropdown isn't affected */
.header-badge-btn.running {
  animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0); }
}

/* Fade out animation for complete state */
.header-badge-btn.fading {
  animation: badge-fade 500ms forwards;
}

@keyframes badge-fade {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Badge dropdown */
.header-badge-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  min-width: 280px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 16px;
  z-index: 1000;
  display: none;
}

.header-badge-dropdown.open {
  display: block;
}

.header-badge-dropdown-title {
  font-weight: 600;
  font-size: 14px;
  color: #1a1a1a;
  margin-bottom: 12px;
}

/* Progress bar */
.header-badge-progress {
  width: 100%;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}

.header-badge-progress-fill {
  height: 100%;
  background: #3b82f6;
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* Stage messages */
.header-badge-stages {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.6;
}

.header-badge-stages .stage-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-badge-stages .stage-line .stage-icon {
  flex-shrink: 0;
}

/* Action button in dropdown */
.header-badge-action {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 16px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s;
}

.header-badge-action:hover {
  background: #2563eb;
}

.header-badge-action.secondary {
  background: #f3f4f6;
  color: #374151;
}

.header-badge-action.secondary:hover {
  background: #e5e7eb;
}

/* Started time */
.header-badge-time {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 8px;
}

/* Result summary */
.header-badge-result {
  font-size: 14px;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.header-badge-result .result-icon {
  margin-right: 4px;
}

/* Red notification dot — persistent unread indicator */
.header-badge-btn.has-notification::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  animation: notification-pulse 2s infinite;
}

@keyframes notification-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  50% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0); }
}
