/**
 * GloriaMundo Enhancement Feature Styles
 *
 * Governor Pane, visual diffs, ghost nodes, and chain of thought display.
 */

/* ============================================================================
   GOVERNOR PANE
   ============================================================================ */

#governor-pane {
  width: 320px;
  min-width: 280px;
  max-width: 400px;
  height: 100%;
  background: #1a1a2e;
  border-left: 1px solid #2d2d44;
  display: flex;
  flex-direction: column;
  color: #e5e7eb;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

#governor-pane.hidden {
  display: none;
}

/* Resize handle */
#governor-pane::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  cursor: ew-resize;
  z-index: 10;
}

#governor-pane::before:hover {
  background: rgba(59, 130, 246, 0.3);
}

.governor-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* ============================================================================
   HEADER
   ============================================================================ */

.governor-header {
  padding: 16px;
  border-bottom: 1px solid #2d2d44;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.governor-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.status-badge {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: capitalize;
  font-weight: 500;
}

/* ============================================================================
   SUMMARY STATS
   ============================================================================ */

.enhancement-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 16px;
  background: #16162a;
  flex-shrink: 0;
}

.enhancement-summary .stat {
  text-align: center;
}

.enhancement-summary .number {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.enhancement-summary .label {
  font-size: 10px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================================================
   CHECKLIST
   ============================================================================ */

.enhancement-checklist {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  scrollbar-width: thin;
  scrollbar-color: #4b5563 transparent;
}

.enhancement-checklist::-webkit-scrollbar {
  width: 6px;
}

.enhancement-checklist::-webkit-scrollbar-track {
  background: transparent;
}

.enhancement-checklist::-webkit-scrollbar-thumb {
  background: #4b5563;
  border-radius: 3px;
}

.enhancement-checklist h4 {
  margin: 0 0 12px;
  font-size: 12px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: #16162a;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.checklist-item:hover {
  background: #1e1e38;
}

.checklist-item.selected {
  background: #1e1e38;
  border-color: #3b82f6;
}

/* Custom checkbox */
.checkbox-wrapper {
  position: relative;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.checkbox-wrapper input {
  opacity: 0;
  width: 100%;
  height: 100%;
  position: absolute;
  cursor: pointer;
  margin: 0;
}

.checkbox-wrapper .checkmark {
  position: absolute;
  top: 0;
  left: 0;
  width: 18px;
  height: 18px;
  background: #2d2d44;
  border-radius: 4px;
  border: 1px solid #4b5563;
  transition: all 0.2s;
  pointer-events: none;
  /* KEY FIX: Allow click to pass through to input */
}

.checkbox-wrapper input:focus-visible + .checkmark {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

.checkbox-wrapper input:checked+.checkmark {
  background: #3b82f6;
  border-color: #3b82f6;
}

.checkbox-wrapper input:checked+.checkmark::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Plan content */
.plan-content {
  flex: 1;
  min-width: 0;
}

.plan-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.risk-indicator {
  font-size: 12px;
  line-height: 1;
}

.plan-description {
  font-size: 13px;
  color: #e5e7eb;
  line-height: 1.4;
}

.plan-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: #9ca3af;
}

.plan-meta .impact {
  color: #22c55e;
}

/* Expand button */
.expand-btn {
  width: 24px;
  height: 24px;
  border: none;
  background: #2d2d44;
  color: #9ca3af;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.expand-btn:hover {
  background: #3b82f6;
  color: #fff;
}

.no-plans {
  color: #9ca3af;
  font-size: 13px;
  text-align: center;
  padding: 24px;
}

/* ============================================================================
   CHAIN OF THOUGHT
   ============================================================================ */

.chain-of-thought {
  padding: 16px;
  background: #16162a;
  border-top: 1px solid #2d2d44;
  flex-shrink: 0;
  max-height: 200px;
  overflow-y: auto;
}

.cot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.cot-header h4 {
  margin: 0;
  font-size: 13px;
  color: #fff;
  font-weight: 500;
}

.close-cot-btn {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.2s;
}

.close-cot-btn:hover {
  background: #2d2d44;
  color: #fff;
}

.cot-content {
  margin-bottom: 12px;
}

.cot-content p {
  margin: 0;
  font-size: 13px;
  color: #d1d5db;
  line-height: 1.6;
}

.cot-meta {
  display: flex;
  gap: 16px;
  font-size: 11px;
}

.enhancement-type {
  color: #9ca3af;
  text-transform: capitalize;
}

.risk-level {
  font-weight: 500;
  text-transform: capitalize;
}

/* ============================================================================
   ACTIONS
   ============================================================================ */

.governor-actions {
  padding: 16px;
  border-top: 1px solid #2d2d44;
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-primary {
  flex: 1;
  padding: 12px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover:not(:disabled) {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.97);
  box-shadow: none;
}

.btn-primary:disabled,
.btn-primary.disabled {
  background: #4b5563;
  cursor: not-allowed;
  opacity: 0.7;
}

.btn-secondary {
  padding: 12px 16px;
  background: transparent;
  color: #9ca3af;
  border: 1px solid #4b5563;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-secondary:hover:not(:disabled) {
  background: #2d2d44;
  color: #e5e7eb;
  border-color: #6b7280;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(75, 85, 99, 0.3);
}

.btn-secondary:active:not(:disabled) {
  transform: scale(0.97);
  box-shadow: none;
}

/* Virtual Run Button */
.btn-virtual-run {
  padding: 12px 16px;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-virtual-run::before {
  content: '';
  font-size: 14px;
}

.btn-virtual-run:hover {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-virtual-run:active {
  transform: translateY(0);
}

/* ============================================================================
   VERIFICATION STATUS
   ============================================================================ */

.verification-status {
  padding: 12px 16px;
  font-size: 13px;
  flex-shrink: 0;
}

.verification-status.success {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.verification-status.error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.verification-status span {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================================================
   LOADING STATE
   ============================================================================ */

.governor-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  gap: 24px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #2d2d44;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-steps {
  text-align: center;
}

.loading-steps p {
  margin: 8px 0;
  font-size: 13px;
  color: #6b7280;
  transition: all 0.3s;
}

.loading-steps p.active {
  color: #e5e7eb;
  font-weight: 500;
}

.loading-steps p.complete {
  color: #22c55e;
}

.loading-steps p.complete::before {
  content: '✓ ';
}

/* ============================================================================
   EMPTY STATE
   ============================================================================ */

.governor-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.governor-empty h3 {
  margin: 0 0 12px;
  font-size: 16px;
  color: #fff;
}

.governor-empty p {
  margin: 0;
  font-size: 13px;
  color: #9ca3af;
  max-width: 240px;
  line-height: 1.5;
}

/* ============================================================================
   DIFF BADGES (X6 Canvas Overlay)
   ============================================================================ */

.diff-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  color: white;
  z-index: 100;
  pointer-events: none;
  animation: badge-pop 0.3s ease;
}

@keyframes badge-pop {
  0% {
    transform: scale(0);
    opacity: 0;
  }

  70% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ============================================================================
   PLAN HIGHLIGHT (X6 Node)
   ============================================================================ */

.plan-highlighted {
  animation: pulse-highlight 1.5s ease infinite;
}

@keyframes pulse-highlight {

  0%,
  100% {
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.5));
  }

  50% {
    filter: drop-shadow(0 0 16px rgba(59, 130, 246, 0.8));
  }
}

/* ============================================================================
   ENHANCE BUTTON (Toolbar)
   ============================================================================ */

.enhance-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.enhance-btn:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.enhance-btn:active {
  transform: translateY(0);
}

.enhance-btn .icon {
  font-size: 14px;
}

.enhance-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Mode selector dropdown */
.enhance-mode-selector {
  position: relative;
}

.enhance-mode-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #1a1a2e;
  border: 1px solid #2d2d44;
  border-radius: 8px;
  overflow: hidden;
  z-index: 100;
  min-width: 200px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.enhance-mode-dropdown.hidden {
  display: none;
}

.enhance-mode-option {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s;
}

.enhance-mode-option:hover {
  background: #2d2d44;
}

.enhance-mode-option .mode-name {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 4px;
}

.enhance-mode-option .mode-desc {
  font-size: 11px;
  color: #9ca3af;
}

.enhance-mode-option .mode-cost {
  font-size: 11px;
  color: #6b7280;
  margin-top: 4px;
}

/* Mode icons */
.mode-icon-iron::before {
  content: '⚙️';
  margin-right: 6px;
}

.mode-icon-gold::before {
  content: '⚡';
  margin-right: 6px;
}

.mode-icon-diamond::before {
  content: '💎';
  margin-right: 6px;
}

/* ============================================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================================ */

@media (max-width: 768px) {
  #governor-pane {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  #governor-pane:not(.hidden) {
    transform: translateX(0);
  }

  .governor-header {
    padding: 12px 16px;
  }

  .enhancement-summary {
    padding: 12px;
    gap: 8px;
  }

  .enhancement-summary .number {
    font-size: 20px;
  }

  .checklist-item {
    padding: 10px;
  }

  .governor-actions {
    padding: 12px 16px;
  }
}

/* ============================================================================
   PROPERTY DIFF VIEW (Modal)
   ============================================================================ */

.property-diff-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.property-diff-modal.hidden {
  display: none;
}

.property-diff-content {
  background: #1a1a2e;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.property-diff-header {
  padding: 16px;
  border-bottom: 1px solid #2d2d44;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.property-diff-header h3 {
  margin: 0;
  font-size: 16px;
  color: #fff;
}

.property-diff-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.property-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #2d2d44;
}

.property-row:last-child {
  border-bottom: none;
}

.property-label {
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.property-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: #e5e7eb;
  background: #16162a;
  padding: 8px;
  border-radius: 4px;
  overflow-x: auto;
}

.property-value.added {
  background: rgba(34, 197, 94, 0.1);
  border-left: 3px solid #22c55e;
}

.property-value.removed {
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid #ef4444;
  text-decoration: line-through;
}

.property-value.changed {
  background: rgba(245, 158, 11, 0.1);
  border-left: 3px solid #f59e0b;
}

/* ============================================================================
   ERROR STATES
   ============================================================================ */

.governor-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 16px;
}

.governor-error .error-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: rgba(245, 158, 11, 0.15);
  border-radius: 50%;
  color: #f59e0b;
}

.governor-error .error-icon-red {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.governor-error h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}

.governor-error p {
  margin: 0;
  font-size: 13px;
  color: #9ca3af;
  max-width: 280px;
  line-height: 1.5;
}

.error-details {
  width: 100%;
  max-width: 240px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0;
}

.error-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  color: #9ca3af;
}

.error-row span:last-child {
  color: #e5e7eb;
  font-weight: 500;
}

.error-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.btn-add-credits {
  padding: 10px 20px;
  background: #22c55e;
  color: #000;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-add-credits:hover {
  background: #16a34a;
}

.btn-retry {
  padding: 10px 20px;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-retry:hover {
  background: #2563eb;
}

.btn-dismiss {
  padding: 10px 20px;
  background: transparent;
  color: #9ca3af;
  border: 1px solid #4b5563;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-dismiss:hover {
  background: #2d2d44;
  color: #e5e7eb;
}

/* ============================================================================
   IMPROVED LOADING STATE
   ============================================================================ */

.spinner-svg {
  width: 100%;
  height: 100%;
  animation: spin 2s linear infinite;
}

.spinner-path {
  stroke: #3b82f6;
  stroke-linecap: round;
  animation: dash 1.5s ease-in-out infinite;
}

@keyframes dash {
  0% {
    stroke-dasharray: 1, 150;
    stroke-dashoffset: 0;
  }

  50% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -35;
  }

  100% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -124;
  }
}

.loading-steps .step-icon {
  margin-right: 8px;
  font-size: 12px;
}

.loading-steps p.completed {
  color: #22c55e;
}

.loading-steps p.completed .step-icon {
  color: #22c55e;
}

.loading-steps p.active {
  color: #3b82f6;
  font-weight: 500;
}

.loading-steps p.active .step-icon {
  color: #3b82f6;
}

.loading-tip {
  font-size: 12px;
  color: #6b7280;
  margin-top: 8px;
}

/* ============================================================================
   BILLING COST DISPLAY IN GOVERNOR PANE
   ============================================================================ */

.enhancement-billing-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  margin-top: 12px;
  font-size: 13px;
  color: #9ca3af;
}

.enhancement-billing-info .cost-value {
  color: #f59e0b;
  font-weight: 500;
}

.enhancement-billing-info .free-badge {
  padding: 2px 6px;
  background: rgba(34, 197, 94, 0.15);
  border-radius: 4px;
  color: #22c55e;
  font-size: 11px;
  font-weight: 500;
}

/* ============================================================================
   NEW UX IMPROVEMENTS (Dec 2025)
   ============================================================================ */

/* Collapsible Sections */
.enhancement-section {
  border-bottom: 1px solid #2d2d44;
}

.enhancement-section-header {
  padding: 12px 16px;
  background: #1a1a2e;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}

.enhancement-section-header:hover {
  background: #2d2d44;
}

.enhancement-section-header h4 {
  margin: 0;
  font-size: 13px;
  color: #e5e7eb;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-icon {
  font-size: 14px;
}

.toggle-icon {
  font-size: 10px;
  color: #9ca3af;
  transition: transform 0.2s;
}

.enhancement-section-content {
  background: #16162a;
  padding: 0;
  max-height: 300px;
  overflow-y: auto;
  transition: max-height 0.3s ease-out;
}

.enhancement-section-content.hidden {
  display: none;
}

/* Critique List */
.critique-list {
  display: flex;
  flex-direction: column;
}

.critique-item {
  padding: 12px 16px;
  border-bottom: 1px solid #2d2d44;
}

.critique-item:last-child {
  border-bottom: none;
}

.critique-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.critique-category {
  font-size: 10px;
  text-transform: uppercase;
  color: #9ca3af;
  letter-spacing: 0.5px;
}

.severity-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.severity-badge.critical {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.severity-badge.warning {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.severity-badge.info {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.critique-message {
  margin: 0 0 8px 0;
  font-size: 13px;
  color: #e5e7eb;
  line-height: 1.4;
}

.critique-fix {
  font-size: 12px;
  color: #9ca3af;
  background: #1a1a2e;
  padding: 8px;
  border-radius: 4px;
  border-left: 2px solid #3b82f6;
}

.fix-label {
  font-weight: 600;
  color: #3b82f6;
}

/* Auto-Applied List */
.auto-applied-list {
  padding: 8px 16px;
}

.auto-applied-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #2d2d44;
}

.auto-applied-item:last-child {
  border-bottom: none;
}

.check-icon {
  color: #22c55e;
  font-weight: bold;
  font-size: 14px;
  margin-top: 2px;
}

.auto-applied-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.auto-applied-desc {
  font-size: 13px;
  color: #e5e7eb;
}

.auto-applied-meta {
  font-size: 11px;
  color: #9ca3af;
}

/* Rich Plan Items */
.checklist-header {
  padding: 0 4px;
  margin-bottom: 8px !important;
}

.risk-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.plan-nodes-count {
  font-size: 11px;
  color: #9ca3af;
  margin-left: auto;
}

.plan-description-rich {
  font-size: 13px;
  color: #fff;
  line-height: 1.4;
  margin-bottom: 6px;
  font-weight: 500;
}

.plan-impact {
  font-size: 11px;
  color: #22c55e;
  font-style: italic;
}


.no-items {
  padding: 16px;
  text-align: center;
  color: #6b7280;
  font-size: 13px;
}

/* ============================================================================
   UNIFIED LIST STYLES (Jan 2026 Refactor)
   ============================================================================ */

.unified-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 12px;
}

.enhancement-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: #1e1e30;
  border-radius: 8px;
  border: 1px solid #2d2d44;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
}

.enhancement-item:hover {
  background: #25253a;
  border-color: #3b82f6;
}

.enhancement-item.selected {
  background: #25253a;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}

/* Applied State (Auto-applied) */
.enhancement-item.applied {
  background: #16162a;
  border-color: #2d2d44;
  opacity: 0.85;
}

.enhancement-item.applied .plan-description-rich {
  color: #9ca3af;
  /* Greyed out text */
  text-decoration: line-through;
  text-decoration-color: #4b5563;
}

.enhancement-item.applied:hover {
  border-color: #4b5563;
  /* Darker hover for applied items */
  cursor: default;
}

/* Pending State */
.enhancement-item.pending {
  border-left: 3px solid transparent;
}

.enhancement-item.pending:hover {
  border-left-color: #3b82f6;
}

.plan-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.plan-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.status-note {
  font-size: 10px;
  color: #22c55e;
  /* Green for success/applied */
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nodes-count {
  font-size: 10px;
  color: #6b7280;
  background: rgba(107, 114, 128, 0.1);
  padding: 2px 6px;
  border-radius: 10px;
}

.affected-nodes-list {
  font-size: 10px;
  color: #6b7280;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Auto-fix badge in issues header */
.auto-fix-badge {
  font-size: 10px;
  padding: 2px 6px;
  margin-left: 8px;
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border-radius: 10px;
  font-weight: 500;
}

/* Plan affects section */
.plan-affects {
  font-size: 11px;
  color: #6b7280;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.plan-affects .affects-label {
  color: #9ca3af;
  font-weight: 500;
  margin-right: 4px;
}

.affected-node {
  display: inline-block;
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
  padding: 1px 4px;
  border-radius: 3px;
  margin: 0 2px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
}

/* Adjust Checkbox for Applied Items */
.enhancement-item.applied .checkbox-wrapper input:checked~.checkmark {
  background-color: #4b5563;
  /* Grey background for checked applied items */
  border-color: #4b5563;
}

.enhancement-item.applied .checkbox-wrapper input:checked~.checkmark:after {
  display: block;
  /* Show checkmark */
}

/* ============================================================================
   WORKFLOW COMMAND CENTER - Rationalized Button Layout
   Two groups: Refine (left) and Execute (right)
   ============================================================================ */

.workflow-command-center {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(31, 41, 55, 0.95);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  gap: 12px;
}

.workflow-command-center.hidden {
  display: none;
}

/* Workflow Command Center - Stacked Two-Row Layout */
.workflow-actions {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  background: rgba(31, 41, 55, 0.95);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  gap: 8px;
  flex-shrink: 0;
}

.workflow-actions.hidden {
  display: none;
}

/* Command groups - stacked rows */
.cmd-group {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

/* Top row: Refinement actions - left aligned with separator */
.cmd-group.refinement {
  justify-content: flex-start;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

/* Bottom row: Execution actions - right aligned */
.cmd-group.execution {
  justify-content: flex-end;
}

/* Command buttons - base style */
.cmd-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

/* Icon-only buttons (Reroll) */
.cmd-btn.icon-only {
  width: 36px;
  padding: 0;
  font-size: 16px;
}

/* Ghost button - subtle (Reroll, Edit) */
.cmd-btn.ghost {
  background: transparent;
  color: #9ca3af;
  border-color: rgba(255, 255, 255, 0.1);
}

.cmd-btn.ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

/* Accent button - Enhance (purple) */
.cmd-btn.accent {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
}

.cmd-btn.accent:hover:not(:disabled) {
  background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Secondary button - Simulate */
.cmd-btn.secondary {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.3);
}

.cmd-btn.secondary:hover:not(:disabled) {
  background: rgba(59, 130, 246, 0.25);
}

/* Primary button - Deploy */
.cmd-btn.primary {
  background: #3b82f6;
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cmd-btn.primary:hover:not(:disabled) {
  background: #2563eb;
}

.cmd-btn.primary:disabled {
  background: #374151;
  color: #6b7280;
  cursor: not-allowed;
}

/* Legacy workflow-btn support - maps to cmd-btn */
.workflow-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.workflow-btn .btn-icon {
  font-size: 14px;
}

.workflow-btn.icon-only {
  width: 36px;
  padding: 0;
}

.workflow-btn:disabled {
  cursor: not-allowed;
}

.workflow-btn.btn-secondary {
  background: transparent;
  color: #9ca3af;
  border-color: rgba(255, 255, 255, 0.1);
}

.workflow-btn.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.workflow-btn.btn-accent {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
}

.workflow-btn.btn-accent:hover:not(:disabled) {
  background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
}

.workflow-btn.btn-outline {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.3);
}

.workflow-btn.btn-outline:hover:not(:disabled) {
  background: rgba(59, 130, 246, 0.25);
}

.workflow-btn.btn-primary {
  background: #3b82f6;
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.workflow-btn.btn-primary:hover:not(:disabled) {
  background: #2563eb;
}

.workflow-btn.btn-primary:disabled {
  background: #374151;
  color: #6b7280;
}

/* Connection warning */
.connection-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 6px;
  color: #fbbf24;
  font-size: 13px;
  margin-top: 4px;
  flex-shrink: 0;
}

.connection-warning.hidden {
  display: none;
}

.connection-warning .warning-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.connection-warning .warning-text {
  line-height: 1.4;
}

/* Mobile responsive */
@media (max-width: 480px) {
  .workflow-command-center,
  .workflow-actions {
    padding: 8px 10px;
    gap: 6px;
  }

  .cmd-group {
    width: 100%;
  }

  /* On very narrow screens, center both rows */
  .cmd-group.refinement,
  .cmd-group.execution {
    justify-content: center;
  }

  .cmd-btn,
  .workflow-btn {
    min-height: 44px;
    font-size: 12px;
    padding: 0 10px;
  }

  .cmd-btn.icon-only,
  .workflow-btn.icon-only {
    flex: 0 0 44px;
  }

  .header-actions {
    flex-direction: column;
    gap: 8px;
  }

  .header-actions .workflow-btn {
    width: 100%;
  }

  .connection-warning {
    font-size: 12px;
    padding: 8px 10px;
  }
}

/* ============================================================================
   IMAGE TOGGLE - AI Image Generation for Social Media Workflows
   ============================================================================ */

.image-toggle-container {
  margin-top: 12px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 12px;
  flex-shrink: 0;
}

.image-toggle-container.hidden {
  display: none;
}

.image-toggle-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.image-toggle-icon {
  font-size: 18px;
}

.image-toggle-title {
  font-size: 13px;
  font-weight: 600;
  color: #e5e7eb;
}

/* Platform badges */
.platform-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.platform-badge-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  font-size: 11px;
  color: #d1d5db;
  font-weight: 500;
}

/* Radio toggle options */
.image-toggle-options {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

/* Three-option grid layout */
.image-toggle-options.three-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  min-width: 280px;
}

.image-toggle-option {
  flex: 1;
  cursor: pointer;
}

.image-toggle-option input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.image-toggle-option .option-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  background: rgba(0, 0, 0, 0.2);
  border: 2px solid transparent;
  border-radius: 10px;
  transition: all 0.2s ease;
  gap: 4px;
}

/* Option icon (emoji) */
.option-icon {
  font-size: 20px;
  line-height: 1;
}

.image-toggle-option input[type="radio"]:focus-visible + .option-content {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

.image-toggle-option input[type="radio"]:checked + .option-content {
  background: rgba(139, 92, 246, 0.15);
  border-color: #8b5cf6;
}

.image-toggle-option:hover .option-content {
  background: rgba(255, 255, 255, 0.05);
}

.image-toggle-option input[type="radio"]:checked + .option-content:hover {
  background: rgba(139, 92, 246, 0.2);
}

/* Ultra option special styling */
.image-toggle-option input[type="radio"][value="ultra"]:checked + .option-content {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.2) 0%, rgba(192, 132, 252, 0.2) 100%);
  border-color: #a855f7;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

.option-label {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.option-price {
  font-size: 11px;
  color: #9ca3af;
  font-weight: 500;
}

.option-price.free {
  color: #10b981;
}

.option-price.premium {
  color: #c084fc;
}

.image-toggle-option input[type="radio"]:checked + .option-content .option-price {
  color: #a78bfa;
}

.image-toggle-option input[type="radio"]:checked + .option-content .option-price.free {
  color: #34d399;
}

.image-toggle-option input[type="radio"]:checked + .option-content .option-price.premium {
  color: #d8b4fe;
}

/* Details section */
.image-toggle-details {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.image-toggle-details.hidden {
  display: none;
}

.cost-breakdown {
  font-size: 12px;
  color: #a78bfa;
  margin-bottom: 4px;
}

.quality-note {
  font-size: 11px;
  color: #9ca3af;
  font-style: italic;
  margin-bottom: 4px;
}

.image-note {
  font-size: 10px;
  color: #6b7280;
}

/* Info line (legacy, but keep for backwards compat) */
.image-toggle-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
  color: #6b7280;
}

.image-info-separator {
  color: #4b5563;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .image-toggle-container {
    padding: 12px;
    margin-top: 10px;
  }

  .image-toggle-options {
    gap: 6px;
  }

  .image-toggle-options.three-options {
    grid-template-columns: repeat(3, 1fr);
    min-width: auto;
  }

  .image-toggle-option .option-content {
    padding: 10px 4px;
    gap: 2px;
  }

  .option-icon {
    font-size: 18px;
  }

  .option-label {
    font-size: 10px;
  }

  .option-price {
    font-size: 10px;
  }
}

/* Very narrow screens - stack vertically */
@media (max-width: 320px) {
  .image-toggle-options.three-options {
    grid-template-columns: 1fr;
  }

  .image-toggle-option .option-content {
    flex-direction: row;
    justify-content: space-between;
    padding: 10px 12px;
  }

  .option-icon {
    order: 0;
  }

  .option-label {
    order: 1;
    flex: 1;
    text-align: left;
    margin-left: 8px;
  }

  .option-price {
    order: 2;
  }
}