/* ============================================
   _build.css
   Action Bar, Section Headers, Build Panel, Build Status,
   Build Stages, Build Actions
   ============================================ */

/* ============================================
   Action Bar
   ============================================ */

.action-bar {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  flex-wrap: wrap;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.action-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-on-accent);
}

.action-btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.action-btn.secondary {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.action-btn.secondary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.action-btn.icon-only {
  padding: var(--spacing-xs);
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}

.action-btn.icon-only:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.action-group {
  display: flex;
  gap: var(--spacing-xs);
}

/* ============================================
   Section Headers
   ============================================ */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 26px;
  min-height: 26px;
  padding: 0 var(--spacing-sm);
  font-size: var(--font-size-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.badge {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: var(--font-size-xxs);
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border-radius: 8px;
}

/* ============================================
   Build Panel
   ============================================ */

.build-panel {
  flex-shrink: 0;
}

.build-list {
  max-height: 200px;
  overflow-y: auto;
}

.build-item {
  border-bottom: 1px solid var(--border-subtle);
}

.build-item.selected {
  background: var(--bg-tertiary);
}

.build-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  cursor: pointer;
  transition: background 0.15s ease;
}

.build-header:hover {
  background: var(--bg-hover);
}

.expand-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
}

.build-status {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
}

.build-status.idle {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.build-status.building {
  background: rgba(137, 180, 250, 0.2);
  color: var(--info);
}

.build-status.success {
  background: rgba(166, 227, 161, 0.2);
  color: var(--success);
}

.build-status.error {
  background: rgba(243, 139, 168, 0.2);
  color: var(--error);
}

.build-status.warning {
  background: rgba(249, 226, 175, 0.2);
  color: var(--warning);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}

.build-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.build-name {
  font-weight: 500;
  color: var(--text-primary);
}

.build-entry {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.build-meta {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: var(--font-size-xs);
  font-family: var(--font-mono);
}

.error-count {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--error);
}

.warn-count {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--warning);
}

.duration {
  color: var(--text-muted);
}

/* Build Actions Bar - shown on selected build target */
.build-actions-bar {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  padding-left: 24px;
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border-subtle);
}

.build-actions-bar .build-action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-size: var(--font-size-sm);
  border: none;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.build-actions-bar .build-action-btn:hover {
  background: var(--accent);
  color: var(--text-on-accent);
}

.build-actions-bar .build-action-btn.primary {
  background: var(--ato-orange);
  color: white;
}

.build-actions-bar .build-action-btn.primary:hover {
  background: var(--ato-orange-light);
}

.build-actions-bar .action-divider {
  width: 1px;
  height: 16px;
  background: var(--border-subtle);
  margin: 0 var(--spacing-xs);
}

/* Legacy build-action-btn (keep for compatibility) */
.build-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  background: var(--ato-orange);
  color: white;
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: 0.9;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.build-header:hover .build-action-btn {
  opacity: 1;
}

.build-action-btn:hover {
  background: var(--ato-orange-light);
  color: white;
  transform: scale(1.1);
}

/* Build Stages */
.build-stages {
  padding: var(--spacing-sm) var(--spacing-md) var(--spacing-md);
  padding-left: 48px;
  background: var(--bg-secondary);
}

.stage-progress {
  display: flex;
  align-items: center;
  margin-bottom: var(--spacing-xs);
}

.stage-step {
  display: flex;
  align-items: center;
  flex: 1;
}

.stage-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  transition: all 0.2s ease;
}

.stage-step.running .stage-dot {
  background: var(--info);
  border-color: var(--info);
  box-shadow: 0 0 8px rgba(137, 180, 250, 0.5);
  animation: pulse 1.5s ease-in-out infinite;
}

.stage-step.success .stage-dot {
  background: var(--success);
  border-color: var(--success);
}

.stage-step.error .stage-dot {
  background: var(--error);
  border-color: var(--error);
}

.stage-step.warning .stage-dot {
  background: var(--warning);
  border-color: var(--warning);
}

.stage-line {
  flex: 1;
  height: 2px;
  background: var(--border-color);
  margin: 0 2px;
}

.stage-step.success .stage-line,
.stage-step.warning .stage-line {
  background: var(--success);
}

.stage-step.error .stage-line {
  background: var(--error);
}

.stage-labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-xxs);
  color: var(--text-muted);
}

.stage-label.success {
  color: var(--success);
}

.stage-label.error {
  color: var(--error);
}

.stage-label.warning {
  color: var(--warning);
}

.stage-label.running {
  color: var(--info);
}

.current-stage {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  margin-top: var(--spacing-sm);
  font-size: var(--font-size-xs);
  color: var(--info);
}

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