/* ===================================
   UPDATE BADGE ATOM
   ===================================

   Persistent orange pill in TopNav announcing a freshly deployed version.
   Gentle pulse draws the eye without flashing. Click opens the update
   popover. All values from design tokens; no hardcoded colors or spacing.
*/

.update-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2_5);
  background-color: var(--color-warning);
  color: var(--text-on-primary, #fff);
  border: var(--border-width-1) solid var(--color-warning-hover);
  border-radius: var(--border-radius-full);
  font-family: var(--font-family-sans);
  font-weight: var(--font-weight-medium);
  font-size: var(--text-xs);
  line-height: var(--line-height-tight);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background-color var(--duration-fast) var(--easing-default),
              transform var(--duration-fast) var(--easing-default);
  animation: update-badge-pulse 2.4s ease-in-out infinite;
}

.update-badge:hover {
  background-color: var(--color-warning-hover);
  animation-play-state: paused;
}

.update-badge:active {
  transform: scale(0.97);
}

.update-badge:focus-visible {
  outline: var(--border-width-2) solid var(--color-warning-hover);
  outline-offset: var(--space-0_5);
}

.update-badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.update-badge-icon svg {
  stroke-width: 2.5;
}

.update-badge-text {
  display: inline-block;
}

/* Gentle breathing glow. Opacity stays steady so the pill remains readable;
   the pulse is on the surrounding shadow only. */
@keyframes update-badge-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.45);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0);
  }
}

@media (max-width: 640px) {
  .update-badge {
    padding: var(--space-0_5) var(--space-2);
    font-size: var(--text-2xs);
  }
}

@media (prefers-reduced-motion: reduce) {
  .update-badge {
    animation: none;
  }
}

/* ===================================
   UPDATE POPOVER
   ===================================

   Anchored panel that opens beside the pill, showing the deploy's whatsNew
   text and a Reload button. Plain absolute-positioned floater; closed on
   outside-click. No modal, no overlay, no scroll lock.
*/

.update-popover {
  position: fixed;
  z-index: var(--z-index-popover, 1000);
  min-width: 260px;
  max-width: 320px;
  background-color: var(--bg-surface, #fff);
  color: var(--text-primary);
  border: var(--border-width-1) solid var(--border-default);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-3);
  font-family: var(--font-family-sans);
  font-size: var(--text-sm);
  line-height: var(--line-height-normal);
}

.update-popover-title {
  margin: 0 0 var(--space-2) 0;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.update-popover-body {
  margin: 0 0 var(--space-3) 0;
  color: var(--text-secondary);
  word-break: break-word;
}

.update-popover-meta {
  margin: 0 0 var(--space-3) 0;
  font-size: var(--text-xs);
  color: var(--text-muted, var(--text-secondary));
}

.update-popover-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}
