/*
 * PSC Creator window — admin chrome + inside-window styling.
 * Mirrors static/admin/css/workflow_canvas_window.css for parity.
 */

:root {
  --pcw-navy:        #1a1a2e;
  --pcw-navy-deep:   #0d0d18;
  --pcw-gold:        #c29954;
  --pcw-gold-light:  #f5eedd;
  --pcw-text:        #2d2d3a;
  --pcw-text-muted:  #6c757d;
  --pcw-tier-red:    #DC2626;
  --pcw-surface:     #ffffff;
  --pcw-surface-inset: #f0f2f5;
  --pcw-border:      #e2e4e8;
  --pcw-radius-sm:   6px;
  --pcw-hit:         44px;
}

/* Mount host inside .kb-popup-modal */
.psc-creator-window-host {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--pcw-surface-inset);
}

/* Loading state */
.psc-creator-loading {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 40px;
}
.psc-creator-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--pcw-border);
  border-top-color: var(--pcw-navy);
  border-radius: 50%;
  animation: pcw-spin 0.8s linear infinite;
}
.psc-creator-loading-text {
  color: var(--pcw-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}
@keyframes pcw-spin {
  to { transform: rotate(360deg); }
}

/* Error state */
.psc-creator-error {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px;
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}
.psc-creator-error-icon {
  font-size: 2.4rem; color: var(--pcw-tier-red); line-height: 1;
}
.psc-creator-error-title {
  font-size: 1rem; font-weight: 700; color: var(--pcw-tier-red);
}
.psc-creator-error-detail {
  font-size: 0.85rem; color: var(--pcw-text-muted); word-break: break-word;
}
.psc-creator-error-retry {
  margin-top: 8px;
  min-height: var(--pcw-hit);
  padding: 8px 22px;
  background: var(--pcw-navy);
  color: var(--pcw-gold-light);
  border: none;
  border-radius: var(--pcw-radius-sm);
  font-family: inherit; font-weight: 700; font-size: 0.85rem;
  cursor: pointer;
}
.psc-creator-error-retry:hover { background: var(--pcw-navy-deep); }
.psc-creator-error-retry:focus-visible {
  outline: 3px solid var(--pcw-gold); outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .psc-creator-spinner { animation: none; border-top-color: var(--pcw-gold); }
}
