/* kubectl Builder theme variables - matches site light theme */
.kubectl-builder-page {
  --kubectl-bg: #ffffff;
  --kubectl-card-bg: #f8f9fa;
  --kubectl-card-border: #e1e4e8;
  --kubectl-accent: #0969da;
  --kubectl-accent-soft: rgba(9, 105, 218, 0.1);
  --kubectl-accent-strong: #0550ae;
  --kubectl-text-main: #24292f;
  --kubectl-text-muted: #57606a;
  --kubectl-danger: #d1242f;
  --kubectl-success: #1a7f37;
  --kubectl-warning: #bf8700;
  --kubectl-radius-lg: 8px;
  --kubectl-radius-xl: 12px;
  --kubectl-shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
  --kubectl-border-subtle: 1px solid #d0d7de;
  --kubectl-transition-fast: 0.15s ease;
  --kubectl-font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  --kubectl-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --kubectl-input-bg: #ffffff;
  --kubectl-input-border: #d0d7de;
  --kubectl-fieldset-bg: #f6f8fa;
}

.kubectl-builder-page * {
  box-sizing: border-box;
}

/* Override page width for kubectl builder */
.page,
.content,
main .container,
article.page,
.single .content {
  max-width: 1400px !important;
}

.kubectl-builder-page {
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.kubectl-builder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.kubectl-builder-branding {
  display: flex;
  align-items: center;
  gap: 12px;
}

.kubectl-builder-logo-pill {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--kubectl-accent), var(--kubectl-accent-strong));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(9, 105, 218, 0.3);
  font-weight: 700;
  font-size: 20px;
  color: #ffffff;
}

.kubectl-builder-title-block h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.02em;
  color: var(--kubectl-text-main);
}

.kubectl-builder-title-block p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--kubectl-text-muted);
}

.kubectl-builder-badge {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--kubectl-input-border);
  color: var(--kubectl-text-muted);
  background: var(--kubectl-accent-soft);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.kubectl-builder-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--kubectl-success);
  box-shadow: 0 0 0 3px rgba(26, 127, 55, 0.2);
}

.kubectl-builder-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.4fr);
  gap: 18px;
  margin-bottom: 2rem;
}

@media (max-width: 900px) {
  .kubectl-builder-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.kubectl-builder-card {
  background: var(--kubectl-card-bg);
  border-radius: var(--kubectl-radius-xl);
  border: var(--kubectl-border-subtle);
  box-shadow: var(--kubectl-shadow-soft);
  padding: 18px 18px 16px;
}

.kubectl-builder-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.kubectl-builder-card-header h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--kubectl-text-main);
  font-weight: 600;
}

.kubectl-builder-card-header small {
  font-size: 11px;
  color: var(--kubectl-text-muted);
  display: block;
  margin-top: 2px;
  text-transform: none;
  letter-spacing: normal;
  font-weight: normal;
}

.kubectl-builder-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--kubectl-text-muted);
  margin: 14px 0 6px;
  font-weight: 600;
}

.kubectl-builder-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

@media (max-width: 700px) {
  .kubectl-builder-field-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.kubectl-builder-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.kubectl-builder-page label {
  color: var(--kubectl-text-main);
  font-size: 13px;
  font-weight: 500;
}

.kubectl-builder-page select,
.kubectl-builder-page input[type="text"],
.kubectl-builder-page .kubectl-builder-textarea {
  font-family: var(--kubectl-font-main);
  background: var(--kubectl-input-bg);
  border-radius: 6px;
  border: 1px solid var(--kubectl-input-border);
  padding: 7px 11px;
  color: var(--kubectl-text-main);
  outline: none;
  font-size: 13px;
  transition: border-color var(--kubectl-transition-fast), box-shadow var(--kubectl-transition-fast);
}

.kubectl-builder-page select:focus,
.kubectl-builder-page input[type="text"]:focus,
.kubectl-builder-page .kubectl-builder-textarea:focus {
  border-color: var(--kubectl-accent);
  box-shadow: 0 0 0 3px var(--kubectl-accent-soft);
}

.kubectl-builder-page select {
  cursor: pointer;
}

.kubectl-builder-page .kubectl-builder-textarea {
  min-height: 90px;
  resize: vertical;
  font-family: var(--kubectl-font-mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre;
}

/* Make command preview textarea larger */
.kubectl-builder-page textarea#commandPreview {
  min-height: 120px;
  width: 100%;
  max-width: 100%;
  font-family: var(--kubectl-font-mono);
  font-size: 13px;
  line-height: 1.6;
}

.kubectl-builder-helper-text {
  font-size: 11px;
  color: var(--kubectl-text-muted);
  line-height: 1.4;
}

.kubectl-builder-helper-text strong {
  color: var(--kubectl-text-main);
  font-weight: 600;
}

.kubectl-builder-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.kubectl-builder-chip {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--kubectl-input-bg);
  border: 1px solid var(--kubectl-input-border);
  color: var(--kubectl-text-muted);
  font-weight: 500;
}

.kubectl-builder-chip-op {
  border-color: var(--kubectl-accent);
  background: var(--kubectl-accent-soft);
  color: var(--kubectl-accent-strong);
  font-weight: 600;
}

.kubectl-builder-pill-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--kubectl-input-bg);
  border: 1px solid var(--kubectl-input-border);
  font-size: 11px;
  color: var(--kubectl-text-main);
  cursor: pointer;
  user-select: none;
  font-weight: 500;
  transition: all var(--kubectl-transition-fast);
}

.kubectl-builder-pill-toggle:hover {
  border-color: var(--kubectl-accent);
  background: var(--kubectl-accent-soft);
}

.kubectl-builder-pill-toggle input {
  display: none;
}

.kubectl-builder-pill-toggle-switch {
  width: 26px;
  height: 14px;
  border-radius: 999px;
  background: var(--kubectl-input-border);
  position: relative;
  flex-shrink: 0;
}

.kubectl-builder-pill-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--kubectl-text-muted);
  transition: transform 0.16s ease, background 0.16s ease;
}

.kubectl-builder-pill-toggle[data-enabled="true"] .kubectl-builder-pill-toggle-switch {
  background: var(--kubectl-success);
}

.kubectl-builder-pill-toggle[data-enabled="true"] .kubectl-builder-pill-toggle-knob {
  background: #ffffff;
  transform: translateX(12px);
}

.kubectl-builder-pill-toggle span {
  white-space: normal;
}

.kubectl-builder-btn-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.kubectl-builder-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 500;
  transition: all var(--kubectl-transition-fast);
  white-space: nowrap;
}

.kubectl-builder-btn-primary {
  background: var(--kubectl-accent);
  color: #ffffff;
  border-color: var(--kubectl-accent);
}

.kubectl-builder-btn-primary:hover {
  background: var(--kubectl-accent-strong);
  border-color: var(--kubectl-accent-strong);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(9, 105, 218, 0.3);
}

.kubectl-builder-btn-ghost {
  background: var(--kubectl-input-bg);
  border-color: var(--kubectl-input-border);
  color: var(--kubectl-text-main);
}

.kubectl-builder-btn-ghost:hover {
  border-color: var(--kubectl-accent);
  background: var(--kubectl-accent-soft);
}

.kubectl-builder-btn-icon {
  font-size: 14px;
}

.kubectl-builder-command-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 12px;
  margin-bottom: 4px;
}

.kubectl-builder-command-preview-header span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--kubectl-text-muted);
  font-weight: 600;
}

.kubectl-builder-badge-disclaimer {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px dashed var(--kubectl-warning);
  background: rgba(191, 135, 0, 0.05);
  color: var(--kubectl-warning);
  font-size: 11px;
  line-height: 1.5;
}

.kubectl-builder-badge-disclaimer strong {
  color: var(--kubectl-warning);
  font-weight: 600;
}

.kubectl-builder-nl-section {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--kubectl-fieldset-bg);
  border: 1px solid var(--kubectl-input-border);
}

.kubectl-builder-nl-section.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.kubectl-builder-nl-hint {
  font-size: 11px;
  color: var(--kubectl-text-muted);
  margin-bottom: 8px;
  line-height: 1.6;
}

.kubectl-builder-nl-result {
  margin-top: 8px;
  font-size: 11px;
  color: var(--kubectl-text-muted);
  padding: 8px;
  background: var(--kubectl-input-bg);
  border-radius: 6px;
  border: 1px solid var(--kubectl-input-border);
}

.kubectl-builder-nl-result strong {
  color: var(--kubectl-text-main);
  font-weight: 600;
}

.kubectl-builder-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--kubectl-input-border);
  background: var(--kubectl-input-bg);
  color: var(--kubectl-text-muted);
  margin-left: 6px;
  font-weight: 500;
}

.kubectl-builder-tag-pill span {
  font-size: 10px;
}

.kubectl-builder-tag-pill-op {
  border-color: var(--kubectl-accent);
  background: var(--kubectl-accent-soft);
  color: var(--kubectl-accent-strong);
  font-weight: 600;
}

.kubectl-builder-danger-text {
  color: var(--kubectl-danger);
  font-weight: 600;
}

.kubectl-builder-selector-hint {
  margin-top: 4px;
  font-size: 11px;
  color: var(--kubectl-text-muted);
  line-height: 1.4;
}

@media (max-width: 540px) {
  .kubectl-builder-page {
    padding: 0 12px 12px;
  }

  .kubectl-builder-card {
    padding: 14px;
  }

  .kubectl-builder-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .kubectl-builder-pill-toggle {
    width: 100%;
  }

  .kubectl-builder-pill-toggle span {
    display: block;
    line-height: 1.4;
  }

  .kubectl-builder-btn-row {
    flex-direction: column;
    align-items: stretch;
  }

  .kubectl-builder-btn {
    width: 100%;
    white-space: normal;
  }
}
