/* ========================================================================== */
/* Runner Panel                                                              */
/* ========================================================================== */

/* ── Runner Panel ── */

.runner-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.runner-card {
  position: relative;
  border-radius: 10px;
  border: 1px solid var(--xbot-border);
  background: var(--xbot-bg-primary);
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.runner-card:hover {
  border-color: var(--xbot-border-light);
  background: var(--xbot-bg-secondary);
}

.runner-card-active {
  border-color: var(--xbot-accent-blue);
  background: rgba(59, 130, 246, 0.08);
}

.runner-card-active:hover {
  background: rgba(59, 130, 246, 0.12);
}

.runner-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.runner-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.runner-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.runner-dot-online {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

.runner-dot-offline {
  background: var(--xbot-border-light);
}

.runner-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--xbot-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.runner-active-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.2);
  color: var(--xbot-text-link);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.runner-card-menu-wrap {
  position: relative;
  flex-shrink: 0;
}

.runner-menu-btn {
  background: transparent;
  border: none;
  color: var(--xbot-text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: all 0.15s;
}

.runner-menu-btn:hover {
  color: var(--xbot-text-primary);
  background: var(--xbot-bg-elevated);
}

.runner-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 10;
  min-width: 140px;
  background: var(--xbot-bg-secondary);
  border: 1px solid var(--xbot-border);
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.runner-menu-item {
  display: block;
  width: 100%;
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: var(--xbot-text-primary);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
}

.runner-menu-item:hover {
  background: var(--xbot-bg-elevated);
}

.runner-menu-item-danger {
  color: var(--xbot-text-danger);
}

.runner-menu-item-danger:hover {
  background: rgba(127, 29, 29, 0.3);
}

.runner-card-info {
  margin-top: 4px;
  padding-left: 16px;
  font-size: 12px;
  color: var(--xbot-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.runner-card-meta {
  color: var(--xbot-border-light);
}

.runner-card-command {
  position: relative;
  margin-top: 8px;
  padding-left: 16px;
}

.runner-command-text {
  display: block;
  width: 100%;
  padding: 8px 36px 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--xbot-border);
  background: var(--xbot-bg-primary);
  color: #a5f3fc;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  line-height: 1.4;
  word-break: break-all;
  box-sizing: border-box;
}

.runner-add-form {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--xbot-border);
  background: var(--xbot-bg-primary);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Delete confirmation dialog */
.runner-delete-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
}

.runner-delete-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 201;
  background: var(--xbot-bg-secondary);
  border: 1px solid var(--xbot-border);
  border-radius: 12px;
  padding: 20px;
  width: 320px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.runner-delete-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--xbot-text-primary);
}

.runner-delete-text {
  font-size: 14px;
  color: var(--xbot-text-secondary);
  margin-top: 8px;
}

.runner-delete-text strong {
  color: var(--xbot-text-primary);
}

.runner-delete-warning {
  font-size: 12px;
  color: #fbbf24;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.2);
}

/* ── Light theme overrides ── */

[data-theme="light"] .runner-card {
  border-color: #e7e5e4;
  background: #fafaf9;
}

[data-theme="light"] .runner-card:hover {
  border-color: #d6d3d1;
  background: #f5f5f0;
}

[data-theme="light"] .runner-card-active {
  border-color: var(--xbot-accent-blue);
  background: rgba(59, 130, 246, 0.06);
}

[data-theme="light"] .runner-name {
  color: #1c1917;
}

[data-theme="light"] .runner-active-badge {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
  border-color: rgba(59, 130, 246, 0.25);
}

[data-theme="light"] .runner-dot-offline {
  background: #d6d3d1;
}

[data-theme="light"] .runner-menu-btn:hover {
  color: #1c1917;
  background: #e7e5e4;
}

[data-theme="light"] .runner-menu {
  background: #fafaf9;
  border-color: #e7e5e4;
}

[data-theme="light"] .runner-menu-item {
  color: #1c1917;
}

[data-theme="light"] .runner-menu-item:hover {
  background: #e7e5e4;
}

[data-theme="light"] .runner-card-info {
  color: #78716c;
}

[data-theme="light"] .runner-card-meta {
  color: #a8a29e;
}

[data-theme="light"] .runner-command-text {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0e7490;
}

[data-theme="light"] .runner-add-form {
  border-color: #e7e5e4;
  background: #fafaf9;
}

[data-theme="light"] .runner-delete-dialog {
  background: #fafaf9;
  border-color: #e7e5e4;
}

[data-theme="light"] .runner-delete-title {
  color: #1c1917;
}

[data-theme="light"] .runner-delete-text {
  color: #78716c;
}

[data-theme="light"] .runner-delete-text strong {
  color: #1c1917;
}

