/* agent-ui / loading-state — first-class component (promoted from host extracts). */
/* ===== host composition (host chrome; compose MVP) ===== */

/* 01 Loading variants: Drive / Dots / Orbit + elapsed */
.au-loading,
.au-loading-state {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  min-height: 8rem;
  padding: 24px;
  text-align: center;
}
.au-loading__label {
  color: var(--au-fg);
  font: 500 14px/1.3 var(--au-font-sans);
}
.au-loading__time {
  color: var(--au-fg-subtle);
  font: 400 12px/1 var(--au-font-mono);
  font-variant-numeric: tabular-nums;
}
.au-loading__variants {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 8px;
}
.au-loading__variants .au-btn[aria-pressed="true"] {
  background: var(--au-surface-muted);
  color: var(--au-fg);
}
.au-loading[data-au-variant="dots"] .au-loading__mark { display: none; }
.au-loading[data-au-variant="dots"] .au-thinking-indicator { display: inline-flex; }
.au-loading:not([data-au-variant="dots"]) .au-thinking-indicator { display: none; }
.au-loading__mark {
  --au-load-size: 28px;
  color: var(--au-action);
  height: var(--au-load-size);
  position: relative;
  width: var(--au-load-size);
}
.au-loading[data-au-variant="drive"] .au-loading__mark::before {
  animation: au-load-drive 1.1s linear infinite;
  background:
    linear-gradient(currentColor 0 0) 0 0 / 33% 33%,
    linear-gradient(currentColor 0 0) 50% 0 / 33% 33%,
    linear-gradient(currentColor 0 0) 100% 0 / 33% 33%,
    linear-gradient(currentColor 0 0) 0 50% / 33% 33%,
    linear-gradient(currentColor 0 0) 50% 50% / 33% 33%,
    linear-gradient(currentColor 0 0) 100% 50% / 33% 33%,
    linear-gradient(currentColor 0 0) 0 100% / 33% 33%,
    linear-gradient(currentColor 0 0) 50% 100% / 33% 33%,
    linear-gradient(currentColor 0 0) 100% 100% / 33% 33%;
  background-repeat: no-repeat;
  content: "";
  display: block;
  height: 100%;
  opacity: 0.85;
  width: 100%;
}
.au-loading[data-au-variant="orbit"] .au-loading__mark::before,
.au-loading[data-au-variant="orbit"] .au-loading__mark::after {
  border: 2px solid color-mix(in srgb, var(--au-action) 35%, transparent);
  border-radius: 50%;
  content: "";
  inset: 0;
  position: absolute;
}
.au-loading[data-au-variant="orbit"] .au-loading__mark::after {
  animation: au-load-orbit 0.9s linear infinite;
  border-color: var(--au-action) transparent transparent transparent;
}
@media (prefers-reduced-motion: reduce) {
  .au-loading[data-au-variant="drive"] .au-loading__mark::before,
  .au-loading[data-au-variant="orbit"] .au-loading__mark::after { animation: none; }



/* ===== host composition detail chrome (per-component pages only) ===== */
/* Pixel-grid Drive mark closer to host composition */
.au-loading[data-au-variant="drive"] .au-loading__mark {
  --au-load-size: 14px;
}
.au-loading[data-au-variant="drive"] .au-loading__mark::before {
  animation: au-pixel-on 650ms ease-in-out infinite;
  background:
    linear-gradient(currentColor 0 0) 0 0 / 4px 4px,
    linear-gradient(currentColor 0 0) 5.5px 0 / 4px 4px,
    linear-gradient(currentColor 0 0) 11px 0 / 4px 4px,
    linear-gradient(currentColor 0 0) 0 5.5px / 4px 4px,
    linear-gradient(currentColor 0 0) 5.5px 5.5px / 4px 4px,
    linear-gradient(currentColor 0 0) 11px 5.5px / 4px 4px,
    linear-gradient(currentColor 0 0) 0 11px / 4px 4px,
    linear-gradient(currentColor 0 0) 5.5px 11px / 4px 4px,
    linear-gradient(currentColor 0 0) 11px 11px / 4px 4px;
  background-repeat: no-repeat;
  opacity: 0.85;
  width: 15.5px;
  height: 15.5px;
}
@media (prefers-reduced-motion: reduce) {
  .au-loading[data-au-variant="drive"] .au-loading__mark::before { animation: none; opacity: 0.7; }

@keyframes au-load-drive {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}
@keyframes au-load-orbit { to { transform: rotate(360deg); } }

@keyframes au-pixel-on {
  0%, 100% { opacity: 0.2; }
  40% { opacity: 1; }
}

/* --- absorbed: thinking-indicator (alias classes preserved) --- */
.au-thinking-indicator {
  align-items: center;
  color: var(--au-fg-muted);
  display: inline-flex;
  font-size: 13px;
  gap: 8px;
}

.au-thinking-indicator__label {
  color: var(--au-fg-muted);
  font-family: var(--au-font-sans);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}

.au-thinking-indicator[hidden] {
  display: none;
}

.au-thinking-indicator__dots {
  display: inline-flex;
  gap: 4px;
}

.au-thinking-indicator__dots span {
  animation: au-thinking-pulse 1.2s var(--au-ease) infinite;
  background: var(--au-fg-muted);
  border-radius: 50%;
  height: 4px;
  opacity: 0.45;
  width: 4px;
}

.au-thinking-indicator__dots span:nth-child(2) {
  animation-delay: 120ms;
}

.au-thinking-indicator__dots span:nth-child(3) {
  animation-delay: 240ms;
}

@keyframes au-thinking-pulse {
  0%,
  60%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .au-thinking-indicator__dots span {
    animation: none;
    opacity: 0.8;
  }
}

/* --- absorbed: status-pill → variant pill --- */
/* agent-ui / status-pill — first-class component (promoted from host extracts). */
.au-status-pill {
  align-items: center;
  background: var(--au-surface-muted);
  border-radius: var(--au-radius-pill);
  color: var(--au-fg-muted);
  display: inline-flex;
  font: 500 11px/1 var(--au-font-sans);
  gap: 6px;
  padding: 4px 8px;
  text-transform: capitalize;
}
.au-status-pill::before {
  background: var(--au-fg-subtle);
  border-radius: 50%;
  content: "";
  height: 6px;
  width: 6px;
}
.au-status-pill[data-au-state="running"]::before,
.au-status-pill[data-au-state="streaming"]::before { background: var(--au-action); }
.au-status-pill[data-au-state="success"],
.au-status-pill[data-au-state="completed"] { color: var(--au-fg); }
.au-status-pill[data-au-state="success"]::before,
.au-status-pill[data-au-state="completed"]::before { background: var(--au-success); }
.au-status-pill[data-au-state="error"]::before,
.au-status-pill[data-au-state="failed"]::before { background: var(--au-danger); }


/* Compact pill variant (formerly status-pill standalone) */
.au-loading[data-au-variant="pill"],
.au-loading-state[data-au-variant="pill"] {
  display: inline-flex;
  flex-direction: row;
  gap: 6px;
  min-height: 0;
  padding: 0;
  text-align: start;
}
.au-loading[data-au-variant="pill"] .au-loading__mark,
.au-loading[data-au-variant="pill"] .au-loading__time,
.au-loading[data-au-variant="pill"] .au-thinking-indicator {
  display: none;
}
