/**
 * Queue wait + progress banner — design tokens, no hardcoded colors.
 *
 * Phase 2.4 of the standalone Coordinated Pool Operations plan
 * (May 7, 2026). The banner appears at the top of the FPS calculator
 * page when a user submits a task that creates a pool job. Polls
 * /queue/status every 2 s and renders queued/running/failed states.
 *
 * Dark mode: PCBuildMate's theme tokens already invert when
 * `html.dark` is set; this CSS uses those tokens so we get dark mode
 * for free. Mobile/zoom: clamp() on font-size + responsive padding.
 *
 * Local custom-property scope (--qwb-*) lets per-state cards override
 * accent color without touching the theme palette.
 */

.pkc-queue-wait-banner {
  /* Vertical-stack inside whatever ancestor we mount on. */
  margin: var(--space-md, 1rem) 0;
  font-family: inherit;
}

.pkc-queue-wait-banner:empty {
  display: none;
}

.pkc-qwb-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(var(--space-sm, 0.5rem), 1.5vw, var(--space-md, 1rem));
  padding: clamp(var(--space-md, 1rem), 2vw, var(--space-lg, 1.5rem));
  border-radius: var(--radius-lg, 12px);
  background: var(--bg-secondary, #242424);
  border-left: 4px solid var(--qwb-accent, var(--brand-primary, #3077A6));
  box-shadow: var(--shadow-md, 0 4px 6px rgba(0, 0, 0, 0.3));
  color: var(--text-primary, #fff);
  /* Subtle entrance — fades in when state changes. */
  animation: pkc-qwb-fade-in 240ms ease-out;
}

@keyframes pkc-qwb-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Per-state accents — override --qwb-accent locally. */
.pkc-qwb-queued   { --qwb-accent: var(--info,    #38b6ff); }
.pkc-qwb-running  { --qwb-accent: var(--brand-primary, #3077A6); }
.pkc-qwb-failed   { --qwb-accent: var(--error,   #f87171); }
.pkc-qwb-unknown  { --qwb-accent: var(--text-muted, #666); }

.pkc-qwb-icon {
  font-size: clamp(1.5rem, 3vw + 0.5rem, 2rem);
  line-height: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: clamp(2rem, 4vw, 2.5rem);
  color: var(--qwb-accent);
}

/* Animated pulse on the running icon to signal liveness. */
.pkc-qwb-running .pkc-qwb-icon {
  animation: pkc-qwb-pulse 1.6s ease-in-out infinite;
}
@keyframes pkc-qwb-pulse {
  0%, 100% { transform: scale(1);   opacity: 1;   }
  50%      { transform: scale(1.1); opacity: 0.7; }
}

.pkc-qwb-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm, 0.5rem);
  min-width: 0;  /* allow truncation in children */
}

.pkc-qwb-title {
  font-size: clamp(1rem, 1.6vw + 0.5rem, 1.15rem);
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary, #fff);
}

.pkc-qwb-detail {
  font-size: clamp(0.875rem, 1.2vw + 0.4rem, 0.95rem);
  color: var(--text-secondary, #a0a0a0);
  line-height: 1.4;
}

.pkc-qwb-subtle {
  font-size: clamp(0.8125rem, 1vw + 0.4rem, 0.875rem);
  color: var(--text-muted, #666);
  line-height: 1.5;
}

.pkc-qwb-progress {
  height: 6px;
  background: var(--bg-tertiary, #2d2d2d);
  border-radius: var(--radius-sm, 4px);
  overflow: hidden;
  margin: var(--space-xs, 0.25rem) 0;
}

.pkc-qwb-progress-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--qwb-accent) 0%,
    color-mix(in srgb, var(--qwb-accent) 70%, white) 100%
  );
  transition: width 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Live event list (Phase 3 will populate). */
.pkc-qwb-events {
  list-style: none;
  margin: 0;
  padding: var(--space-sm, 0.5rem) 0 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(0.75rem, 0.95vw + 0.4rem, 0.85rem);
  color: var(--text-secondary, #a0a0a0);
  max-height: 8.5em;
  overflow-y: auto;
  border-top: 1px solid var(--border, #333);
}

.pkc-qwb-events li {
  display: grid;
  grid-template-columns: 5em 1.5em 1fr;
  gap: var(--space-xs, 0.25rem);
  padding: 2px 0;
  align-items: baseline;
}

.pkc-qwb-ev-ts {
  color: var(--text-muted, #666);
  font-variant-numeric: tabular-nums;
}

.pkc-qwb-ev-icon {
  text-align: center;
}

.pkc-qwb-ev-detail {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* New events animate in subtly. */
.pkc-qwb-events li {
  animation: pkc-qwb-event-enter 320ms ease-out;
}
@keyframes pkc-qwb-event-enter {
  from { opacity: 0; transform: translateX(-4px); }
  to   { opacity: 1; transform: translateX(0); }
}
