/* ========================================
 * CLI Tool Management Styles
 * ======================================== */

/* Disabled tool card */
.cli-tool-card.disabled {
  opacity: 0.6;
}

.cli-tool-card.disabled .cli-tool-header {
  opacity: 0.8;
}

/* Disabled status indicator */
.cli-tool-status.status-disabled {
  background: hsl(var(--warning));
}

/* Warning badge */
.cli-tool-badge.badge-warning {
  background: hsl(var(--warning) / 0.15);
  color: hsl(var(--warning));
  font-size: 0.65rem;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  margin-left: 0.25rem;
}

/* Compact toggle for tool cards */
.cli-toggle-compact {
  position: relative;
  display: inline-block;
  width: 28px;
  height: 16px;
  cursor: pointer;
}

.cli-toggle-compact input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.cli-toggle-slider-compact {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: hsl(var(--muted));
  transition: 0.2s;
  border-radius: 16px;
}

.cli-toggle-slider-compact:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.cli-toggle-compact input:checked + .cli-toggle-slider-compact {
  background-color: hsl(var(--primary));
}

.cli-toggle-compact input:checked + .cli-toggle-slider-compact:before {
  transform: translateX(12px);
}

.cli-toggle-compact input:focus + .cli-toggle-slider-compact {
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.5);
}

/* Language Setting Status Badge */
.cli-setting-status {
  margin-left: 0.75rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 0.25rem;
  display: inline-flex;
  align-items: center;
}

.cli-setting-status.enabled {
  background: hsl(var(--primary) / 0.15);
  color: hsl(var(--primary));
}

.cli-setting-status.disabled {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}

/* Ghost button variant for destructive actions */
.btn-ghost.text-destructive {
  color: hsl(var(--destructive));
}

/* ========================================
 * Tool Configuration Modal
 * ======================================== */

/* Tool item clickable */
.tool-item.clickable {
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.tool-item.clickable:hover .tool-config-icon {
  opacity: 1;
}

.tool-config-icon {
  margin-left: 0.375rem;
  color: hsl(var(--muted-foreground));
  opacity: 0;
  transition: opacity 0.15s ease;
}

/* Tool Config Modal */
.tool-config-modal {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.tool-config-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tool-config-section h4 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: hsl(var(--muted-foreground));
  margin: 0;
}

.tool-config-section h4 .text-muted {
  font-weight: 400;
  text-transform: none;
  color: hsl(var(--muted-foreground) / 0.7);
}

/* Status Badges */
.tool-config-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 500;
  border-radius: 9999px;
}

.badge-success {
  background: hsl(var(--success) / 0.15);
  color: hsl(var(--success));
}

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

.badge-muted {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}

/* Config Actions */
.tool-config-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-danger-outline {
  border-color: hsl(var(--destructive) / 0.5);
  color: hsl(var(--destructive));
}

.btn-danger-outline:hover {
  background: hsl(var(--destructive) / 0.1);
  border-color: hsl(var(--destructive));
}

/* Config Selects and Inputs */
.tool-config-select,
.tool-config-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  font-family: inherit;
  border: 1px solid hsl(var(--border));
  border-radius: 0.375rem;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tool-config-select:focus,
.tool-config-input:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 2px hsl(var(--primary) / 0.2);
}

.tool-config-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.25rem;
  padding-right: 2rem;
}

.tool-config-input.hidden {
  display: none;
}

.tool-config-input {
  margin-top: 0.375rem;
}

/* Config Footer */
.tool-config-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.25rem 1.25rem 1.25rem;
  border-top: 1px solid hsl(var(--border));
  margin-top: 0.5rem;
}

.tool-config-footer .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tool-config-footer .btn-outline {
  background: transparent;
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
}

.tool-config-footer .btn-outline:hover {
  background: hsl(var(--muted));
  border-color: hsl(var(--muted-foreground) / 0.3);
}

.tool-config-footer .btn-primary {
  background: hsl(var(--primary));
  border: 1px solid hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.tool-config-footer .btn-primary:hover {
  background: hsl(var(--primary) / 0.9);
}

/* Model Select Group */
.model-select-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.model-select-group .tool-config-input {
  margin-top: 0;
}

.btn-ghost.text-destructive:hover {
  background: hsl(var(--destructive) / 0.1);
}

/* ========================================
 * CLI Manager Split Layout (Claude Config)
 * ======================================== */

.cli-manager-split {
  display: flex;
  gap: var(--spacing-md, 1rem);
  height: 100%;
  min-height: 400px;
}

.cli-manager-sidebar {
  width: 280px;
  flex-shrink: 0;
  overflow-y: auto;
  background: hsl(var(--card));
  border-radius: 0.5rem;
  border: 1px solid hsl(var(--border));
  padding: 1rem;
}

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

.cli-manager-main {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  background: hsl(var(--card));
  border-radius: 0.5rem;
  border: 1px solid hsl(var(--border));
}

/* Tool List Items */
.cli-tool-list-item {
  padding: 0.625rem 0.75rem;
  cursor: pointer;
  border-radius: 0.375rem;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.cli-tool-list-item:hover {
  background: hsl(var(--accent));
}

.cli-tool-list-item.selected {
  background: hsl(var(--primary) / 0.1);
  border-left: 3px solid hsl(var(--primary));
  padding-left: calc(0.75rem - 3px);
}

.cli-tool-list-item .tool-name {
  font-weight: 500;
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.cli-tool-list-item .tool-status.installed {
  background: hsl(var(--success));
}

.cli-tool-list-item .tool-status.not-installed {
  background: hsl(var(--muted-foreground) / 0.4);
}

/* Config Mode Toggle */
.config-mode-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  background: hsl(var(--muted) / 0.5);
  padding: 0.25rem;
  border-radius: 0.5rem;
}

.config-mode-btn {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 0.375rem;
  background: transparent;
  color: hsl(var(--muted-foreground));
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
}

.config-mode-btn:hover {
  color: hsl(var(--foreground));
}

.config-mode-btn.active {
  background: hsl(var(--background));
  color: hsl(var(--primary));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Tool Detail Header */
.tool-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid hsl(var(--border));
}

.tool-detail-header h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Claude Settings Form */
.claude-config-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.claude-config-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.claude-config-form .form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.claude-config-form .form-control {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  font-family: inherit;
  border: 1px solid hsl(var(--border));
  border-radius: 0.375rem;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.claude-config-form .form-control:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 2px hsl(var(--primary) / 0.2);
}

.claude-config-form .form-control::placeholder {
  color: hsl(var(--muted-foreground) / 0.6);
}

/* Model Config Section */
.model-config-section {
  background: hsl(var(--muted) / 0.3);
  padding: 1rem;
  border-radius: 0.5rem;
  margin-top: 0.5rem;
}

.model-config-section h4 {
  font-size: 0.8125rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.model-config-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (max-width: 768px) {
  .model-config-grid {
    grid-template-columns: 1fr;
  }
}

/* Empty State */
.cli-manager-main .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 200px;
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  gap: 0.5rem;
}

.cli-manager-main .empty-state i {
  opacity: 0.5;
}

/* Endpoints List in Config Panel */
.claude-endpoints-list {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid hsl(var(--border));
}

.claude-endpoints-list h4 {
  font-size: 0.8125rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.claude-endpoint-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.75rem;
  background: hsl(var(--muted) / 0.3);
  border-radius: 0.375rem;
  margin-bottom: 0.5rem;
}

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

.claude-endpoint-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.claude-endpoint-name {
  font-weight: 500;
  font-size: 0.8125rem;
}

.claude-endpoint-meta {
  font-size: 0.6875rem;
  color: hsl(var(--muted-foreground));
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.claude-endpoint-actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* Config Source Badge */
.config-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.375rem;
  font-size: 0.625rem;
  font-weight: 500;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.config-source-badge.provider {
  background: hsl(var(--primary) / 0.15);
  color: hsl(var(--primary));
}

.config-source-badge.direct {
  background: hsl(var(--success) / 0.15);
  color: hsl(var(--success));
}

