.settings-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: var(--vscode-editor-background);
  color: var(--vscode-foreground);
}

/* Header with search */
.settings-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--vscode-panel-border);
  background-color: var(--vscode-editor-background);
  flex-shrink: 0;
}

.settings-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 400;
  color: var(--vscode-foreground);
  white-space: nowrap;
}

.settings-search {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.settings-search-icon {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--vscode-input-placeholderForeground);
  display: flex;
  align-items: center;
  pointer-events: none;
}

.settings-search input {
  width: 100%;
  padding: 6px 28px 6px 30px;
  font-size: 13px;
  background-color: var(--vscode-input-background);
  border: 1px solid var(--vscode-input-border);
  color: var(--vscode-input-foreground);
  border-radius: 4px;
  outline: none;
}

.settings-search input::placeholder {
  color: var(--vscode-input-placeholderForeground);
}

.settings-search input:focus {
  border-color: var(--vscode-focusBorder);
}

.settings-search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--vscode-descriptionForeground);
  cursor: pointer;
  font-size: 11px;
  padding: 2px 4px;
  opacity: 0.7;
}

.settings-search-clear:hover {
  opacity: 1;
}

/* Body layout - simplified, no internal sidebar */
.settings-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px 40px;
}

/* No results message */
.settings-no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 48px 24px;
  color: var(--vscode-descriptionForeground);
}

.settings-no-results p {
  margin: 0;
  font-size: 14px;
}

.settings-no-results button {
  padding: 6px 14px;
  font-size: 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background-color: var(--vscode-button-secondaryBackground);
  color: var(--vscode-button-secondaryForeground);
}

.settings-no-results button:hover {
  background-color: var(--vscode-button-secondaryHoverBackground);
}

/* Setting section */
.setting-section {
  margin-bottom: 32px;
}

.setting-section-header {
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--vscode-panel-border);
}

.setting-section-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--vscode-foreground);
}

.setting-section-description {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--vscode-descriptionForeground);
  line-height: 1.5;
}

.setting-section-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Individual setting row */
.setting-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 16px;
  border-radius: 4px;
  transition: background-color 0.15s;
}

.setting-row:hover {
  background-color: var(--vscode-list-hoverBackground);
}

.setting-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.setting-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--vscode-foreground);
}

.setting-description {
  margin: 0;
  font-size: 12px;
  color: var(--vscode-descriptionForeground);
  line-height: 1.5;
}

.setting-control {
  margin-top: 4px;
}

.setting-control input[type="text"],
.setting-control input[type="password"],
.setting-control textarea {
  width: 100%;
  max-width: 400px;
  padding: 6px 10px;
  font-size: 13px;
  background-color: var(--vscode-input-background);
  border: 1px solid var(--vscode-input-border);
  color: var(--vscode-input-foreground);
  border-radius: 4px;
  outline: none;
  font-family: inherit;
}

.setting-control textarea {
  resize: vertical;
  min-height: 60px;
}

.setting-control input:focus,
.setting-control textarea:focus {
  border-color: var(--vscode-focusBorder);
}

.setting-control input::placeholder,
.setting-control textarea::placeholder {
  color: var(--vscode-input-placeholderForeground);
}

.setting-control select {
  padding: 6px 10px;
  font-size: 13px;
  background-color: var(--vscode-dropdown-background);
  border: 1px solid var(--vscode-dropdown-border);
  color: var(--vscode-dropdown-foreground);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  min-width: 240px;
}

.setting-control select:focus {
  border-color: var(--vscode-focusBorder);
}

/* Input group with button */
.setting-input-group {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 400px;
}

.setting-input-group input {
  flex: 1;
}

.setting-toggle-visibility {
  background: transparent;
  border: none;
  padding: 4px 6px;
  cursor: pointer;
  font-size: 16px;
  opacity: 0.6;
  transition: opacity 0.15s;
  color: var(--vscode-foreground);
}

.setting-toggle-visibility:hover {
  opacity: 1;
}

/* Info banner */
.setting-info-banner {
  padding: 10px 16px;
  margin: 0 0 4px;
  background: var(--vscode-editorInfo-background, rgba(0, 120, 212, 0.1));
  border-left: 3px solid var(--vscode-editorInfo-foreground, #3794ff);
  border-radius: 3px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--vscode-foreground);
}

.setting-info-banner p {
  margin: 0;
}

/* Action buttons */
.setting-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px 4px;
  flex-wrap: wrap;
}

.setting-actions button {
  padding: 6px 14px;
  font-size: 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.15s;
}

.setting-actions button.primary {
  background-color: var(--vscode-button-background);
  color: var(--vscode-button-foreground);
}

.setting-actions button.primary:hover {
  background-color: var(--vscode-button-hoverBackground);
}

.setting-actions button.secondary {
  background-color: var(--vscode-button-secondaryBackground);
  color: var(--vscode-button-secondaryForeground);
}

.setting-actions button.secondary:hover {
  background-color: var(--vscode-button-secondaryHoverBackground);
}

.setting-actions button.danger {
  color: var(--vscode-errorForeground, #f48771);
}

.setting-actions button.danger:hover {
  background-color: rgba(244, 135, 113, 0.1);
}

/* Status indicators */
.setting-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  margin-top: 4px;
  font-size: 12px;
  border-radius: 4px;
}

.setting-status.success {
  color: var(--vscode-testing-iconPassed, #73c991);
  background-color: rgba(115, 201, 145, 0.08);
}

.setting-status .status-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.setting-status .status-detail {
  color: var(--vscode-descriptionForeground);
}

/* Setting row button styling */
.setting-row .setting-control button {
  padding: 6px 14px;
  font-size: 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background-color: var(--vscode-button-secondaryBackground);
  color: var(--vscode-button-secondaryForeground);
  transition: background-color 0.15s;
}

.setting-row .setting-control button:hover {
  background-color: var(--vscode-button-secondaryHoverBackground);
}

/* Categories management styles */
.categories-table-wrapper {
  padding: 12px 16px;
  overflow-x: auto;
}

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

.categories-table th,
.categories-table td {
  border-bottom: 1px solid var(--vscode-panel-border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: middle;
}

.categories-table th {
  color: var(--vscode-descriptionForeground);
  font-weight: 600;
}

.categories-table td input[type="text"] {
  width: 100%;
  min-width: 200px;
  padding: 6px 10px;
  font-size: 13px;
  background-color: var(--vscode-input-background);
  border: 1px solid var(--vscode-input-border);
  color: var(--vscode-input-foreground);
  border-radius: 4px;
  outline: none;
}

.categories-table td input[type="text"]:focus {
  border-color: var(--vscode-focusBorder);
}

.category-name-cell {
  font-weight: 500;
  white-space: nowrap;
}

.category-checkbox-cell {
  text-align: center;
}

.category-actions-cell {
  text-align: center;
}

.category-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--vscode-panel-border);
  color: var(--vscode-foreground);
  cursor: pointer;
  opacity: 0.8;
  font-size: 12px;
  border-radius: 4px;
  transition: opacity 0.15s, background-color 0.15s, border-color 0.15s;
}

.category-remove:hover {
  opacity: 1;
  background-color: var(--vscode-toolbar-hoverBackground);
  border-color: var(--vscode-focusBorder);
}

.category-add-form {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  align-items: center;
}

.category-add-form input {
  flex: 1;
  max-width: 300px;
  padding: 6px 12px;
  font-size: 13px;
  background-color: var(--vscode-input-background);
  border: 1px solid var(--vscode-input-border);
  color: var(--vscode-input-foreground);
  border-radius: 4px;
  outline: none;
}

.category-add-form input:focus {
  border-color: var(--vscode-focusBorder);
}

.category-add-form input::placeholder {
  color: var(--vscode-input-placeholderForeground);
}

/* AI Settings */
.system-prompt-textarea {
  width: 100%;
  min-height: 150px;
  max-height: 400px;
  padding: 10px 12px;
  font-size: 12px;
  font-family: var(--vscode-editor-font-family), monospace;
  line-height: 1.5;
  background-color: var(--vscode-input-background);
  border: 1px solid var(--vscode-input-border);
  color: var(--vscode-input-foreground);
  border-radius: 4px;
  outline: none;
  resize: vertical;
}

.system-prompt-textarea:focus {
  border-color: var(--vscode-focusBorder);
}

.system-prompt-textarea::placeholder {
  color: var(--vscode-input-placeholderForeground);
}

.setting-inline-action {
  display: flex;
  gap: 8px;
  align-items: center;
}

.setting-inline-action input {
  flex: 1;
  max-width: 300px;
}

.setting-row-full {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 4px;
  transition: background-color 0.15s;
}

.setting-row-full:hover {
  background-color: var(--vscode-list-hoverBackground);
}

.setting-row-full .setting-control {
  width: 100%;
}

.setting-row-full .setting-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
