/* ========================================
 * Legacy Container Styles (kept for compatibility)
 * ======================================== */

/* Container */
.cli-manager-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.cli-manager-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.25rem;
  align-items: start;
}

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

/* Panels */
.cli-panel {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 1px 3px hsl(var(--foreground) / 0.04);
  transition: box-shadow 0.2s ease;
}

.cli-panel:hover {
  box-shadow: 0 4px 12px hsl(var(--foreground) / 0.08);
}

.cli-panel-full {
  grid-column: 1 / -1;
}

/* Status Panel */
.cli-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.3);
}

.cli-status-header h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin: 0;
  letter-spacing: -0.01em;
}

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

.cli-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
}

.cli-tool-card {
  padding: 0.625rem 0.5rem;
  border-radius: 0.5rem;
  background: hsl(var(--background));
  text-align: center;
  border: 1.5px solid hsl(var(--border));
  transition: all 0.2s ease;
}

.cli-tool-card.available {
  background: hsl(var(--background));
}

.cli-tool-card.available:hover {
  box-shadow: 0 2px 8px hsl(var(--foreground) / 0.08);
}

/* Tool-specific border colors */
.cli-tool-card.tool-gemini.available {
  border-color: hsl(210 80% 55% / 0.5);
}

.cli-tool-card.tool-gemini.available:hover {
  border-color: hsl(210 80% 55% / 0.7);
}

.cli-tool-card.tool-qwen.available {
  border-color: hsl(280 70% 55% / 0.5);
}

.cli-tool-card.tool-qwen.available:hover {
  border-color: hsl(280 70% 55% / 0.7);
}

.cli-tool-card.tool-codex.available {
  border-color: hsl(142 71% 45% / 0.5);
}

.cli-tool-card.tool-codex.available:hover {
  border-color: hsl(142 71% 45% / 0.7);
}

.cli-tool-card.tool-claude.available {
  border-color: hsl(25 90% 50% / 0.5);
}

.cli-tool-card.tool-claude.available:hover {
  border-color: hsl(25 90% 50% / 0.7);
}

.cli-tool-card.unavailable {
  border-color: hsl(var(--border));
  opacity: 0.6;
}

.cli-tool-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  margin-bottom: 0.1875rem;
}

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

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

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

.cli-tool-name {
  font-weight: 600;
  font-size: 0.8125rem;
  color: hsl(var(--foreground));
  letter-spacing: -0.01em;
}

.cli-tool-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;
}

.cli-tool-badge-disabled {
  font-size: 0.5625rem;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  background: hsl(38 92% 50% / 0.2);
  color: hsl(38 92% 50%);
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Disabled tool card state */
.cli-tool-card.disabled {
  opacity: 0.7;
  border-style: dashed;
}

.cli-tool-card.disabled .cli-tool-name {
  color: hsl(var(--muted-foreground));
}

.cli-tool-info {
  font-size: 0.6875rem;
  margin-bottom: 0.3125rem;
  color: hsl(var(--muted-foreground));
}

.cli-tool-info .text-success {
  color: hsl(var(--success));
  font-weight: 500;
}

/* CLI Tool Description */
.cli-tool-desc {
  font-size: 0.625rem;
  color: hsl(var(--muted-foreground) / 0.8);
  line-height: 1.3;
}

/* CLI Tool Actions */
.cli-tool-actions {
  min-height: 1.75rem;
}

/* CodexLens specific styles */
.cli-tool-card.tool-codexlens.available {
  border-color: hsl(35 90% 50% / 0.5);
}

.cli-tool-card.tool-codexlens.available:hover {
  border-color: hsl(35 90% 50% / 0.7);
}

/* Semantic Search specific styles */
.cli-tool-card.tool-semantic.available {
  border-color: hsl(260 80% 60% / 0.5);
}

.cli-tool-card.tool-semantic.available:hover {
  border-color: hsl(260 80% 60% / 0.7);
}

.cli-tool-card.tool-semantic.clickable {
  cursor: pointer;
}

.cli-tool-card.tool-semantic.clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px hsl(260 80% 60% / 0.15);
}

/* Execute Panel */
.cli-execute-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid hsl(var(--border));
}

.cli-execute-header h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin: 0;
}

.cli-execute-form {
  padding: 1rem;
}

.cli-execute-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

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

.cli-form-group label {
  font-size: 0.75rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}

.cli-select,
.cli-textarea {
  padding: 0.5rem;
  border: 1px solid hsl(var(--border));
  border-radius: 0.375rem;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 0.875rem;
}

.cli-textarea {
  min-height: 80px;
  resize: vertical;
  font-family: monospace;
}

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

.cli-execute-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

/* History Panel */
.cli-history-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);
}

.cli-history-header h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin: 0;
  letter-spacing: -0.01em;
}

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

.cli-history-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Search Input for History */
.cli-history-search {
  padding: 0.375rem 0.625rem;
  border: 1px solid hsl(var(--border));
  border-radius: 0.375rem;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 0.75rem;
  width: 160px;
  transition: all 0.2s ease;
}

.cli-history-search:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 2px hsl(var(--primary) / 0.15);
  width: 200px;
}

.cli-history-search::placeholder {
  color: hsl(var(--muted-foreground) / 0.7);
}

.cli-tool-filter {
  padding: 0.375rem 0.625rem;
  border: 1px solid hsl(var(--border));
  border-radius: 0.375rem;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cli-tool-filter:hover {
  border-color: hsl(var(--primary) / 0.5);
}

.cli-tool-filter:focus {
  outline: none;
  border-color: hsl(var(--primary));
}

.cli-history-list {
  max-height: 450px;
  overflow-y: auto;
}

.cli-history-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid hsl(var(--border) / 0.5);
  cursor: pointer;
  transition: all 0.15s ease;
}

.cli-history-item:hover {
  background: hsl(var(--hover));
}

.cli-history-item:hover .cli-history-actions {
  opacity: 1;
}

.cli-history-item:last-child {
  border-bottom: none;
}

.cli-history-item-content {
  flex: 1;
  min-width: 0;
}

.cli-history-item-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.375rem;
}

.cli-tool-tag {
  font-size: 0.5625rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cli-tool-gemini {
  background: hsl(210 80% 55% / 0.12);
  color: hsl(210 80% 45%);
}

.cli-tool-qwen {
  background: hsl(280 70% 55% / 0.12);
  color: hsl(280 70% 45%);
}

.cli-tool-codex {
  background: hsl(142 71% 45% / 0.12);
  color: hsl(142 71% 35%);
}

.cli-tool-claude {
  background: hsl(25 90% 50% / 0.12);
  color: hsl(25 90% 40%);
}

.cli-history-time {
  font-size: 0.6875rem;
  color: hsl(var(--muted-foreground));
}

.cli-history-prompt {
  font-size: 0.8125rem;
  font-weight: 450;
  color: hsl(var(--foreground));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.4;
}

.cli-history-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.6875rem;
  margin-top: 0.25rem;
  color: hsl(var(--muted-foreground));
}

/* History Item Actions */
.cli-history-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity 0.15s ease;
  margin-left: 0.5rem;
}

.cli-history-actions .btn-icon {
  padding: 0.25rem;
  color: hsl(var(--muted-foreground));
}

.cli-history-actions .btn-icon:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--hover));
}

.cli-history-actions .btn-icon.btn-danger:hover {
  color: hsl(var(--destructive));
  background: hsl(var(--destructive) / 0.1);
}

/* Output Panel */
.cli-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid hsl(var(--border));
}

.cli-output-header h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin: 0;
}

.cli-output-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-indicator.running {
  background: hsl(var(--warning));
  animation: pulse 1.5s infinite;
}

.status-indicator.success {
  background: hsl(var(--success));
}

.status-indicator.error {
  background: hsl(var(--destructive));
}

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

.cli-output-content {
  padding: 1rem;
  background: hsl(var(--muted));
  font-family: monospace;
  font-size: 0.75rem;
  color: hsl(var(--foreground));
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0;
}

/* Detail Modal */
.cli-detail-header {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid hsl(var(--border));
}

.cli-detail-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.625rem;
  flex-wrap: wrap;
}

.cli-detail-status {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cli-detail-status.status-success {
  background: hsl(var(--success) / 0.12);
  color: hsl(var(--success));
}

.cli-detail-status.status-error {
  background: hsl(var(--destructive) / 0.12);
  color: hsl(var(--destructive));
}

.cli-detail-status.status-timeout {
  background: hsl(var(--warning) / 0.12);
  color: hsl(var(--warning));
}

.cli-detail-meta {
  display: flex;
  gap: 1.25rem;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  flex-wrap: wrap;
}

.cli-detail-meta span {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.cli-detail-section {
  margin-bottom: 1.25rem;
}

.cli-detail-section h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cli-detail-section h4 i {
  width: 14px;
  height: 14px;
  color: hsl(var(--muted-foreground));
}

.cli-detail-prompt {
  padding: 1rem;
  background: hsl(var(--muted) / 0.5);
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
  font-family: 'SF Mono', 'Consolas', 'Liberation Mono', monospace;
  font-size: 0.75rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 200px;
  overflow-y: auto;
  color: hsl(var(--foreground));
}

.cli-detail-output {
  padding: 1rem;
  background: hsl(var(--muted) / 0.5);
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
  font-family: 'SF Mono', 'Consolas', 'Liberation Mono', monospace;
  font-size: 0.75rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 350px;
  overflow-y: auto;
  color: hsl(var(--foreground));
}

.cli-detail-error {
  padding: 1rem;
  background: hsl(var(--destructive) / 0.08);
  border: 1px solid hsl(var(--destructive) / 0.2);
  border-radius: 0.5rem;
  font-family: 'SF Mono', 'Consolas', 'Liberation Mono', monospace;
  font-size: 0.75rem;
  line-height: 1.6;
  color: hsl(var(--destructive));
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 180px;
  overflow-y: auto;
}

/* Detail Actions */
.cli-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid hsl(var(--border));
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.9;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-icon {
  padding: 0.375rem;
  background: transparent;
  border: none;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  border-radius: 0.25rem;
  transition: all 0.15s ease;
}

.btn-icon:hover {
  background: hsl(var(--hover));
  color: hsl(var(--foreground));
}

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

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

.btn-sm.btn-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}

.btn-sm.btn-primary:hover {
  opacity: 0.9;
}

.btn-sm.btn-outline {
  background: transparent;
  border-color: hsl(var(--border));
}

.btn-sm.btn-outline:hover {
  background: hsl(var(--hover));
}

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

.btn-outline:hover {
  background: hsl(var(--hover));
}

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

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

/* Enable/Disable button variants */
.btn-sm.btn-outline-success {
  background: transparent;
  border: 1px solid hsl(142 76% 36% / 0.4);
  color: hsl(142 76% 36%);
}

.btn-sm.btn-outline-success:hover {
  background: hsl(142 76% 36% / 0.1);
  border-color: hsl(142 76% 36% / 0.6);
}

.btn-sm.btn-outline-warning {
  background: transparent;
  border: 1px solid hsl(38 92% 50% / 0.4);
  color: hsl(38 92% 50%);
}

.btn-sm.btn-outline-warning:hover {
  background: hsl(38 92% 50% / 0.1);
  border-color: hsl(38 92% 50% / 0.6);
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: hsl(var(--muted-foreground));
}

.empty-state svg {
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

.empty-state p {
  font-size: 0.875rem;
}

