/* Homepage live-demo widget. Loaded only by Areas/Marketing/Pages/Index.cshtml. */

[x-cloak] { display: none !important; }

.demo-widget {
  background: #fff;
  border: 1px solid var(--pa-line, #e4e4e7);
  border-radius: 16px;
  box-shadow: 0 12px 32px -16px rgba(15, 23, 42, .12), 0 2px 4px rgba(15, 23, 42, .04);
  overflow: hidden;
  position: relative;
}

/* ─── Idle state ─── */

.demo-idle {
  padding: 1.5rem;
}

.demo-idle-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.demo-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: #2563eb;
}

.demo-eyebrow .ops-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, .6);
  animation: demo-pulse 1.8s ease-in-out infinite;
}

@keyframes demo-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); }
  50%      { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

.demo-helper {
  font-size: .8rem;
}

.demo-prompt {
  font-size: .95rem;
  color: var(--pa-ink, #18181b);
  font-weight: 600;
}

.demo-chip-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

@media (max-width: 540px) {
  .demo-chip-grid { grid-template-columns: 1fr; }
}

.demo-chip {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1rem;
  border: 1px solid var(--pa-line, #e4e4e7);
  border-radius: 12px;
  background: #fafafa;
  text-align: left;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, background-color .12s ease, box-shadow .12s ease;
  width: 100%;
}

.demo-chip:hover {
  border-color: #2563eb;
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px -8px rgba(37, 99, 235, .35);
}

.demo-chip:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.demo-chip:disabled {
  cursor: not-allowed;
  opacity: .5;
  transform: none;
  box-shadow: none;
}

.demo-chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(37, 99, 235, .08);
  color: #2563eb;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.demo-chip-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.demo-chip-label {
  font-weight: 700;
  font-size: .9rem;
  color: var(--pa-ink, #18181b);
}

.demo-chip-desc {
  font-size: .75rem;
  color: var(--pa-muted, #71717a);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.demo-chip-arrow {
  color: var(--pa-muted, #71717a);
  font-size: .85rem;
  flex-shrink: 0;
  transition: transform .12s ease, color .12s ease;
}

.demo-chip:hover .demo-chip-arrow {
  color: #2563eb;
  transform: translateX(3px);
}

.demo-alert {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  font-size: .85rem;
  padding: .75rem 1rem;
  border-radius: 10px;
  margin-top: 1rem;
}

.demo-alert-warning {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde68a;
}

.demo-alert-warning a { color: #713f12; }

.demo-alert-muted {
  background: #f4f4f5;
  color: #3f3f46;
  border: 1px solid #e4e4e7;
}

.demo-alert-danger {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.demo-alert-danger a { color: #7f1d1d; }

/* ─── Running / result state ─── */

.demo-running {
  display: flex;
  flex-direction: column;
}

.demo-running-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1.25rem;
  border-bottom: 1px solid var(--pa-line, #e4e4e7);
  background: #fafafa;
  font-size: .85rem;
}

.demo-running-status .demo-running-label {
  color: #2563eb;
  font-weight: 600;
}

.demo-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(37, 99, 235, .25);
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: demo-spin .8s linear infinite;
}

@keyframes demo-spin {
  to { transform: rotate(360deg); }
}

.dot-anim::after {
  display: inline-block;
  animation: demo-dots 1.4s infinite steps(4, end);
  content: '';
}

@keyframes demo-dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%, 100% { content: '...'; }
}

.demo-panes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

@media (max-width: 768px) {
  .demo-panes { grid-template-columns: 1fr; }
}

.demo-pane {
  min-height: 320px;
  max-height: 480px;
  overflow: auto;
}

.demo-pane-doc {
  background: #f4f4f5;
  display: flex;
  padding: 0;
  border-right: 1px solid var(--pa-line, #e4e4e7);
  /* The iframe is greedy — let the pane itself constrain height instead. */
  overflow: hidden;
}

@media (max-width: 768px) {
  .demo-pane-doc {
    border-right: none;
    border-bottom: 1px solid var(--pa-line, #e4e4e7);
  }
}

.demo-doc-iframe {
  width: 100%;
  height: 100%;
  min-height: 320px;
  border: 0;
  background: #fff;
  display: block;
}

.demo-doc-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 3rem 1rem;
  color: var(--pa-muted, #71717a);
  font-size: .9rem;
  width: 100%;
  height: 100%;
}

.demo-doc-placeholder i {
  font-size: 3rem;
  opacity: .4;
}

.demo-pane-json {
  background: #0d0e10;
  color: #e4e4e7;
  display: flex;
  flex-direction: column;
}

.demo-json-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .65rem 1rem;
  border-bottom: 1px solid #1f2024;
  background: #0a0b0d;
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.demo-json-prefix {
  color: #60a5fa;
  font-weight: 700;
}

.demo-json-source {
  font-size: .7rem;
  text-transform: none;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.demo-json-body {
  flex: 1;
  overflow: auto;
  padding: 1rem 1.25rem;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .8rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.demo-json-body .k { color: #93c5fd; }
.demo-json-body .s { color: #86efac; }
.demo-json-body .n { color: #fbbf24; }
.demo-json-body .c { color: #6b7280; }
.demo-json-placeholder { color: #6b7280; font-style: italic; }

.demo-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .85rem 1rem;
  background: linear-gradient(to right, rgba(37, 99, 235, .14), rgba(37, 99, 235, .04));
  color: #93c5fd;
  font-size: .85rem;
  border-top: 1px solid #1f2024;
  text-decoration: none;
  transition: background-color .15s ease;
}

.demo-cta:hover {
  background: rgba(37, 99, 235, .22);
  color: #fff;
}
