/* LLM Configuration Utility */

.llm-page-container {
  padding: 20px;
  height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.llm-info-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 13px;
  color: var(--color-text-secondary);
  padding: 0 4px;
}

.llm-info-bar strong {
  color: var(--color-text-primary);
}

/* Main table panel - uses .settings-panel pattern */
.llm-table-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.llm-table-scroll {
  flex: 1;
  overflow: auto;
}

.llm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.llm-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.llm-table th {
  background: var(--color-neutral-100);
  border-bottom: 1px solid var(--color-border);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
}

.llm-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.llm-table tbody tr:hover {
  background: var(--color-neutral-50);
}

.llm-table tbody tr:last-child td {
  border-bottom: none;
}

/* Badges */
.llm-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.llm-badge-configured {
  background: #dbeafe;
  color: #1e40af;
}

.llm-badge-discovered {
  background: #fef3c7;
  color: #92400e;
}

.llm-badge-both {
  background: #d1fae5;
  color: #065f46;
}

.llm-badge-default {
  background: #1e40af;
  color: #fff;
  margin-left: 6px;
}

.llm-badge-cheap {
  background: #bbf7d0;
  color: #166534;
  margin-left: 6px;
}

.llm-badge-balanced {
  background: #fde68a;
  color: #92400e;
  margin-left: 6px;
}

.llm-badge-precise {
  background: #c7d2fe;
  color: #3730a3;
  margin-left: 6px;
}

.llm-badge-ok {
  background: #d1fae5;
  color: #065f46;
}

.llm-badge-error {
  background: #fee2e2;
  color: #991b1b;
}

.llm-badge-running {
  background: #fef3c7;
  color: #92400e;
}

/* Model ID column */
.llm-model-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

/* Pricing */
.llm-pricing {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  white-space: nowrap;
}

.llm-pricing-na {
  color: var(--color-text-tertiary);
}

/* Temperature support */
.llm-temp-yes {
  color: #16a34a;
}

.llm-temp-no {
  color: #dc2626;
}

/* Response time */
.llm-latency {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  color: var(--color-text-secondary);
}

/* Response content */
.llm-response {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

/* Action button */
.llm-ping-btn {
  padding: 4px 12px;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.llm-ping-btn:hover {
  background: var(--color-neutral-100);
}

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

/* Results panel - uses .settings-panel pattern */
.llm-results-panel {
  flex-shrink: 0;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  max-height: 200px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.llm-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-neutral-50);
}

.llm-results-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.llm-results-summary {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.llm-results-summary .success {
  color: #16a34a;
  font-weight: 600;
}

.llm-results-summary .error {
  color: #dc2626;
  font-weight: 600;
}

.llm-log-area {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
}

.llm-log-entry {
  padding: 2px 0;
}

.llm-log-success {
  color: #16a34a;
}

.llm-log-error {
  color: #dc2626;
}

.llm-log-info {
  color: var(--color-text-secondary);
}

.llm-export-info {
  padding: 8px 16px;
  border-top: 1px solid var(--color-border);
  font-size: 12px;
  color: var(--color-text-secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Loading spinner */
.llm-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: llm-spin 0.7s linear infinite;
  margin-right: 4px;
  vertical-align: middle;
}

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

/* Empty state */
.llm-empty {
  padding: 40px;
  text-align: center;
  color: var(--color-text-secondary);
}

/* Error text */
.llm-error {
  color: #dc2626;
}

/* Hidden by default */
.llm-hidden {
  display: none;
}

/* Capability badges */
.llm-badge-cap {
  background: var(--color-surface-accent, #e0f2fe);
  color: var(--color-text, #0369a1);
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  margin-right: 2px;
}

.llm-caps {
  max-width: 140px;
  white-space: normal;
  line-height: 1.6;
}

/* Disabled ping button */
.llm-ping-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Availability badges */
.llm-badge-avail-ok {
  background: var(--color-success-bg, #dcfce7);
  color: var(--color-success, #16a34a);
}

.llm-badge-avail-pilot {
  background: var(--color-warning-bg, #fef3c7);
  color: var(--color-warning, #d97706);
}

.llm-badge-avail-other {
  background: var(--color-info-bg, #e0f2fe);
  color: var(--color-info, #0284c7);
}

.llm-badge-avail-unknown {
  background: var(--color-neutral-bg, #f3f4f6);
  color: var(--color-neutral, #6b7280);
}

/* Unavailable row styling */
.llm-row-unavailable {
  opacity: 0.6;
}

.llm-row-unavailable td {
  background: var(--color-surface-dim, #f9fafb);
}
