/* ========================================
 * CLI Manager Styles
 * Unified font: system-ui for UI, monospace for code
 * ======================================== */

/* ========================================
 * Status Manager - Two Column Layout
 * ======================================== */
.status-manager {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.status-two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .status-two-column {
    grid-template-columns: 1fr;
  }
}

/* Section Container */
.status-section {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 0.75rem;
  overflow: hidden;
}

/* CLI Section - No card wrapper */
.cli-section {
  /* No background, border, or card styling */
}

.cli-section .section-header {
  padding: 0 0 0.75rem 0;
  border-bottom: none;
  background: transparent;
}

.cli-section .section-header h3 {
  font-size: 0.9375rem;
}

.cli-section .tools-list,
.cli-section .ccw-list,
.cli-section .endpoint-tools-grid {
  padding: 0;
}

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.3);
}

.section-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-header h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin: 0;
}

.section-header h3 i {
  color: hsl(var(--muted-foreground));
}

.section-count {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.section-header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Tools List */
.tools-list {
  padding: 0.5rem;
}

.tool-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  border-radius: 0.5rem;
  margin-bottom: 0.375rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  transition: all 0.15s ease;
}

.tool-item:last-child {
  margin-bottom: 0;
}

.tool-item:hover {
  background: hsl(var(--hover));
  border-color: hsl(var(--primary) / 0.3);
}

.tool-item.available {
  /* No left border - use status dot instead */
}

.tool-item.unavailable {
  opacity: 0.7;
}

.tool-item.endpoint {
  /* No left border */
}

.tool-item-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

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

.tool-status-dot.status-available {
  background: hsl(var(--success));
  box-shadow: 0 0 6px hsl(var(--success) / 0.5);
}

.tool-status-dot.status-unavailable {
  background: hsl(var(--muted-foreground) / 0.4);
}

.tool-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.tool-item-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tool-item-desc {
  font-size: 0.6875rem;
  color: hsl(var(--muted-foreground));
}

.tool-default-badge {
  font-size: 0.5625rem;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tool-type-badge {
  font-size: 0.5625rem;
  font-weight: 500;
  padding: 0.125rem 0.375rem;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  border-radius: 0.25rem;
}

.tool-type-badge.ai {
  background: hsl(var(--primary) / 0.15);
  color: hsl(var(--primary));
}

.tool-type-badge.llm {
  background: hsl(142 76% 36% / 0.15);
  color: hsl(142 76% 36%);
}

/* Tool Tags - displayed in tool cards */
.tool-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.tool-tag {
  font-size: 0.5625rem;
  font-weight: 500;
  padding: 0.125rem 0.375rem;
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
  border-radius: 0.25rem;
}

/* Tags Input - used in config modal */
.tags-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Unified tag input - tags and input in one container */
.tags-unified-input {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  min-height: 2.5rem;
  padding: 0.375rem 0.5rem;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
  cursor: text;
  transition: border-color 0.15s ease;
}

.tags-unified-input:focus-within {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 2px hsl(var(--primary) / 0.1);
}

.tag-inline-input {
  flex: 1;
  min-width: 120px;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.8125rem;
  color: hsl(var(--foreground));
  padding: 0.25rem 0;
}

.tag-inline-input::placeholder {
  color: hsl(var(--muted-foreground) / 0.6);
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  min-height: 1.75rem;
  padding: 0.25rem;
  background: hsl(var(--muted) / 0.3);
  border-radius: 0.375rem;
}

.tag-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  background: hsl(var(--primary) / 0.15);
  color: hsl(var(--primary));
  border-radius: 0.25rem;
}

/* Tag color variants */
.tag-item.tag-分析, .tool-tag.tag-分析 {
  background: hsl(210 100% 50% / 0.15);
  color: hsl(210 100% 45%);
}

.tag-item.tag-编码, .tool-tag.tag-编码 {
  background: hsl(142 76% 36% / 0.15);
  color: hsl(142 76% 36%);
}

.tag-item.tag-Debug, .tool-tag.tag-Debug {
  background: hsl(0 84% 60% / 0.15);
  color: hsl(0 84% 50%);
}

.tag-item.tag-重构, .tool-tag.tag-重构 {
  background: hsl(280 70% 50% / 0.15);
  color: hsl(280 70% 45%);
}

.tag-item.tag-测试, .tool-tag.tag-测试 {
  background: hsl(45 93% 47% / 0.15);
  color: hsl(45 93% 35%);
}

.tag-item.tag-文档, .tool-tag.tag-文档 {
  background: hsl(180 70% 40% / 0.15);
  color: hsl(180 70% 35%);
}

.tag-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  padding: 0;
  border: none;
  background: transparent;
  color: hsl(var(--primary) / 0.6);
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1;
  border-radius: 0.125rem;
}

.tag-remove:hover {
  background: hsl(var(--destructive) / 0.2);
  color: hsl(var(--destructive));
}

/* Predefined Tags Row - prominent quick add buttons */
.predefined-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.predefined-tag-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.375rem 0.625rem;
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.predefined-tag-btn:hover {
  background: hsl(var(--primary) / 0.15);
  color: hsl(var(--primary));
  border-color: hsl(var(--primary) / 0.3);
}

.predefined-tag-btn.selected,
.predefined-tag-btn:disabled {
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--muted-foreground));
  border-color: hsl(var(--primary) / 0.2);
  opacity: 0.6;
  cursor: not-allowed;
}

.predefined-tag-btn i {
  opacity: 0.7;
}

/* Legacy predefined tags */
.predefined-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.5rem;
}

.predefined-tag {
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  background: hsl(var(--muted) / 0.5);
  color: hsl(var(--muted-foreground));
  border: 1px dashed hsl(var(--border));
  border-radius: 0.25rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.predefined-tag:hover {
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
  border-color: hsl(var(--primary) / 0.3);
}

.tool-item-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tool-status-text {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 500;
}

.tool-status-text.success {
  color: hsl(var(--success));
}

.tool-status-text.muted {
  color: hsl(var(--muted-foreground));
}

/* CCW List */
.ccw-list {
  padding: 0.5rem;
}

.ccw-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.75rem;
  border-radius: 0.5rem;
  margin-bottom: 0.375rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  transition: all 0.15s ease;
}

.ccw-item:last-child {
  margin-bottom: 0;
}

.ccw-item:hover {
  background: hsl(var(--hover));
  border-color: hsl(var(--primary) / 0.3);
}

.ccw-item-left {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.ccw-item-mode {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  flex-shrink: 0;
}

.ccw-item-mode.global {
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
}

.ccw-item-mode.path {
  background: hsl(var(--warning) / 0.1);
  color: hsl(var(--warning));
}

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

.ccw-item-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.ccw-item-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.ccw-item-path {
  font-size: 0.6875rem;
  color: hsl(var(--muted-foreground));
  font-family: 'SF Mono', 'Consolas', 'Liberation Mono', monospace;
  background: hsl(var(--muted) / 0.5);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  margin-bottom: 0.375rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ccw-item-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.625rem;
  color: hsl(var(--muted-foreground));
}

.ccw-item-meta span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.ccw-item-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.ccw-item:hover .ccw-item-actions {
  opacity: 1;
}

