/* Workflow-Hub (P4) — Mission Control */

.wf-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.wf-header-actions {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.wf-health-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-secondary, #8b949e);
  display: inline-block;
  flex-shrink: 0;
}

.wf-health-dot.wf-health-ok {
  background: #3fb950;
  box-shadow: 0 0 0 3px rgba(63, 185, 80, 0.18);
}

.wf-health-dot.wf-health-off {
  background: #f85149;
  box-shadow: 0 0 0 3px rgba(248, 81, 73, 0.15);
}

.wf-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.wf-card {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated, #1e2030);
  border: 1px solid var(--border-color, #30363d);
  border-radius: 10px;
  touch-action: manipulation;
}

.wf-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-muted, #484f58);
}

.wf-dot-on {
  background: #3fb950;
}

.wf-dot-off {
  background: #484f58;
}

.wf-dot-pulse {
  animation: wf-pulse 1.4s ease-in-out infinite;
}

@keyframes wf-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(63, 185, 80, 0); }
  100% { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0); }
}

.wf-info {
  flex: 1;
  min-width: 0;
}

.wf-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary, #e6edf3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wf-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--text-secondary, #8b949e);
  flex-wrap: wrap;
}

.wf-badge {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  line-height: 1.4;
}

.wf-badge-ok      { background: rgba(63, 185, 80, 0.18);   color: #3fb950; }
.wf-badge-err     { background: rgba(248, 81, 73, 0.18);   color: #f85149; }
.wf-badge-warn    { background: rgba(210, 153, 34, 0.18);  color: #d29922; }
.wf-badge-run     { background: rgba(88, 166, 255, 0.18);  color: #58a6ff; }
.wf-badge-neutral { background: rgba(139, 148, 158, 0.18); color: #8b949e; }

.wf-spark {
  width: 80px;
  height: 28px;
  flex-shrink: 0;
}

.wf-spark canvas {
  width: 80px !important;
  height: 28px !important;
  display: block;
}

.wf-trigger {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-color, #30363d);
  background: var(--bg-recessed, #161b22);
  color: var(--accent-primary, #f0883e);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  touch-action: manipulation;
  transition: transform 100ms ease, background 100ms ease;
}

.wf-trigger:hover:not(:disabled) {
  background: var(--accent-primary, #f0883e);
  color: #fff;
}

.wf-trigger:active:not(:disabled) {
  transform: scale(0.95);
}

.wf-trigger:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.wf-trigger-loading {
  animation: wf-spin 0.8s linear infinite;
}

@keyframes wf-spin {
  to { transform: rotate(360deg); }
}

.wf-trigger i {
  width: 16px;
  height: 16px;
}

.wf-empty {
  padding: 2rem 1rem;
  text-align: center;
  background: var(--bg-elevated, #1e2030);
  border: 1px solid var(--border-color, #30363d);
  border-radius: 10px;
  color: var(--text-secondary, #8b949e);
}

/* Mobile: kompakter, Sparkline schrumpft */
@media (max-width: 600px) {
  .wf-card {
    padding: 0.625rem 0.75rem;
    gap: 0.625rem;
  }
  .wf-spark, .wf-spark canvas { width: 56px !important; height: 24px !important; }
  .wf-name { font-size: 0.9rem; }
  .wf-meta { font-size: 0.72rem; }
}

/* Light-Mode-Overrides */
[data-theme="light"] .wf-card {
  background: var(--bg-base, #ffffff);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .wf-trigger {
  background: var(--bg-elevated, #f6f8fa);
}

[data-theme="light"] .wf-empty {
  background: var(--bg-elevated, #f6f8fa);
}

/* --- Webhook-Support: Actions-Gruppe + Config-Button + Modal-Form --- */
.wf-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.wf-config {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-color, #30363d);
  background: var(--bg-recessed, #161b22);
  color: var(--text-secondary, #8b949e);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  touch-action: manipulation;
}
.wf-config i { width: 14px; height: 14px; }
.wf-config:hover { color: var(--text-primary, #e6edf3); border-color: var(--accent-primary, #f0883e); }
.wf-config-set { color: var(--accent-primary, #f0883e); border-color: var(--accent-primary, #f0883e); }

.wf-webhook-icon {
  width: 13px;
  height: 13px;
  color: var(--accent-primary, #f0883e);
  vertical-align: middle;
  margin-left: 4px;
}

.wf-webhook-form { display: flex; flex-direction: column; gap: 0.5rem; }
.wf-webhook-hint { font-size: 0.82rem; color: var(--text-secondary, #8b949e); line-height: 1.45; margin: 0; }
.wf-webhook-label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary, #8b949e); }
.wf-webhook-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-primary, #e6edf3);
  background: var(--bg-recessed, #161b22);
  border: 1px solid var(--border-color, #30363d);
  border-radius: 8px;
}
.wf-webhook-input:focus { outline: none; border-color: var(--accent-primary, #f0883e); }
.wf-webhook-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.4rem; }

[data-theme="light"] .wf-config { background: var(--bg-elevated, #f6f8fa); }
[data-theme="light"] .wf-webhook-input { background: var(--bg-base, #ffffff); }
