/* PluginsTab — plugin list, browse, and log viewer styles */

/* Section header with docs link */

.sectionHeader {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

.sectionHeader h3 {
  margin: 0;
}

.docsLink {
  background: none;
  border: none;
  color: var(--accent);
  font-size: var(--font-sm);
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  transition: opacity 0.15s;
}

.docsLink:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Sub-tab switcher */

.subTabs {
  display: flex;
  gap: 2px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.subTab {
  background: none;
  border: none;
  color: var(--fg-secondary);
  font-size: var(--font-sm);
  padding: 4px 12px 6px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.subTab:hover {
  color: var(--fg-primary);
}

.subTab.subTabActive {
  color: var(--fg-primary);
  border-bottom-color: var(--accent);
}

/* Browse view */

.browseHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.refreshBtn {
  background: none;
  border: 1px solid var(--border);
  color: var(--fg-secondary);
  font-size: var(--font-sm);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.refreshBtn:hover {
  background: var(--bg-highlight);
  color: var(--fg-primary);
}

.refreshBtn:disabled {
  opacity: 0.5;
  cursor: default;
}

.browseRow {
  background: var(--bg-primary);
}

.installBtn {
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: var(--font-sm);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.installBtn:hover {
  background: rgba(88, 166, 255, 0.1);
}

.installBtn:disabled {
  opacity: 0.5;
  cursor: default;
}

.updateBadge {
  font-size: var(--font-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: rgba(88, 166, 255, 0.15);
  color: var(--accent);
}

.installedBadge {
  font-size: var(--font-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--fg-muted);
}

.pluginList {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.pluginRow {
  background: var(--bg-primary);
}

.pluginHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px 12px;
  gap: 12px;
}

.pluginInfo {
  flex: 1;
  min-width: 0;
}

.pluginNameRow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pluginName {
  font-weight: 600;
  font-size: var(--font-sm);
  color: var(--fg-primary);
}

.pluginVersion {
  font-size: var(--font-sm);
  color: var(--fg-muted);
}

.badge {
  font-size: var(--font-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
}

.badge[data-type="builtin"] {
  background: var(--bg-tertiary);
  color: var(--fg-muted);
}

.badge[data-type="error"] {
  background: rgba(248, 81, 73, 0.15);
  color: var(--error);
}

.badge[data-type="warning"] {
  background: rgba(210, 153, 34, 0.15);
  color: var(--warning);
}

.pluginDescription {
  margin: 4px 0 0;
  font-size: var(--font-sm);
  color: var(--fg-secondary);
}

.pluginCapabilities {
  margin: 2px 0 0;
  font-size: var(--font-xs);
  color: var(--fg-muted);
  font-family: var(--font-mono);
}

.pluginError {
  margin: 4px 0 0;
  font-size: var(--font-sm);
  color: var(--error);
}

.pluginActions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.pluginActionsRow {
  display: flex;
  align-items: center;
  gap: 8px;
}

.docsBtn {
  background: none;
  border: 1px solid var(--border);
  color: var(--fg-secondary);
  font-size: var(--font-sm);
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.docsBtn:hover {
  background: var(--bg-highlight);
  color: var(--accent);
  border-color: var(--accent);
}

.logsBtn {
  background: none;
  border: 1px solid var(--border);
  color: var(--fg-secondary);
  font-size: var(--font-sm);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.logsBtn:hover {
  background: var(--bg-highlight);
  color: var(--fg-primary);
}

.logsBtn.logsActive {
  background: var(--bg-tertiary);
  color: var(--fg-primary);
  border-color: var(--fg-muted);
}

.dashboardBtn {
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: var(--font-sm);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dashboardBtn:hover {
  background: var(--accent);
  color: var(--bg-primary);
}

.btnIcon {
  display: inline-flex;
  align-items: center;
  width: 12px;
  height: 12px;
}

.btnIcon svg {
  width: 100%;
  height: 100%;
}

/* Log viewer */

.logViewer {
  border-top: 1px solid var(--border);
  padding: 8px 12px;
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg-secondary);
}

.logEmpty {
  font-size: var(--font-sm);
  color: var(--fg-muted);
  margin: 0;
}

.logEntries {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: var(--font-xs);
}

.logEntry {
  display: flex;
  gap: 8px;
  line-height: 1.4;
}

.logTime {
  color: var(--fg-muted);
  flex-shrink: 0;
}

.logLevel {
  flex-shrink: 0;
  width: 40px;
  text-transform: uppercase;
  font-weight: 600;
}

.logEntry[data-level="error"] .logLevel {
  color: var(--error);
}

.logEntry[data-level="warn"] .logLevel {
  color: var(--warning);
}

.logEntry[data-level="info"] .logLevel {
  color: var(--accent);
}

.logEntry[data-level="debug"] .logLevel {
  color: var(--fg-muted);
}

.logMessage {
  color: var(--fg-secondary);
  word-break: break-word;
}

/* Uninstall button */

.uninstallBtn {
  background: none;
  border: 1px solid var(--border);
  color: var(--fg-secondary);
  font-size: var(--font-sm);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.uninstallBtn:hover {
  background: rgba(248, 81, 73, 0.1);
  color: var(--error);
  border-color: var(--error);
}

/* Install row at bottom of tab */

.installRow {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
