/* ═══════════════════════════════════════════
   DEMO ENGINE — nw-demo-engine.css
   Подключать через: <link rel="stylesheet" href="nw-demo-engine.css" />
   @keyframes здесь безопасен — файл не парсится Razor
═══════════════════════════════════════════ */

/* ── Section wrapper ── */
.nw-demo-section {
  padding: 80px 0 100px;
  background: #f5f5f5;
}

/* ── Header ── */
.nw-demo-header {
  text-align: center;
  margin-bottom: 48px;
}
.nw-demo-kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #111;
  opacity: .45;
  margin-bottom: 16px;
}
.nw-demo-title {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 800;
  letter-spacing: -.03em;
  color: #111;
  margin: 0 0 14px;
  line-height: 1.05;
}
.nw-demo-subtitle {
  font-size: 17px;
  color: #444;
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Engine card ── */
.nw-engine-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 16px;
  overflow: hidden;
  max-width: 1080px;
  margin: 0 auto;
  box-shadow: 0 4px 40px rgba(0,0,0,.07);
}

/* ── Scenario tabs ── */
.nw-scenario-tabs {
  display: flex;
  border-bottom: 1px solid rgba(0,0,0,.08);
  background: #fafafa;
  overflow-x: auto;
  scrollbar-width: none;
}
.nw-scenario-tabs::-webkit-scrollbar { display: none; }
.nw-scenario-tab {
  flex: none;
  padding: 0 24px;
  height: 48px;
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  color: #111;
  opacity: .4;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: opacity .15s, border-color .15s;
  white-space: nowrap;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  user-select: none;
}
.nw-scenario-tab:hover { opacity: .75; }
.nw-scenario-tab.active {
  opacity: 1;
  border-bottom-color: #111;
}

/* ── Controls row ── */
.nw-controls-row {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(0,0,0,.07);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* URL input */
.nw-url-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f5f5f5;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 8px;
  padding: 0 14px;
  height: 40px;
  min-width: 200px;
  flex: 1;
  max-width: 280px;
}
.nw-url-icon {
  font-size: 13px;
  color: #999;
  flex-shrink: 0;
}
.nw-url-input {
  border: none;
  background: none;
  outline: none;
  font-size: 13px;
  font-family: 'Courier New', monospace;
  color: #333;
  width: 100%;
  font-weight: 600;
}

/* Preset buttons */
.nw-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.nw-preset-btn {
  height: 36px;
  padding: 0 14px;
  border: 1.5px solid rgba(0,0,0,.15);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #333;
  background: #fff;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  letter-spacing: .02em;
}
.nw-preset-btn:hover {
  border-color: #111;
  color: #111;
}
.nw-preset-btn.active {
  background: #111;
  border-color: #111;
  color: #fff;
}

/* Run button */
.nw-run-btn {
  height: 40px;
  padding: 0 22px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .03em;
  transition: background .15s, opacity .15s;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.nw-run-btn:hover { background: #333; }
.nw-run-btn.loading { opacity: .6; pointer-events: none; }
.nw-run-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: nwDemoSpin .6s linear infinite;
  display: none;
}
.nw-run-btn.loading .nw-run-spinner { display: block; }
.nw-run-btn.loading .nw-run-label { display: none; }

@keyframes nwDemoSpin {
  to { transform: rotate(360deg); }
}

/* ── Output area ── */
.nw-output-area {
  padding: 0;
}
.nw-output-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid rgba(0,0,0,.07);
}
@media (max-width: 767px) {
  .nw-output-cols { grid-template-columns: 1fr; }
}
.nw-output-col {
  padding: 0;
}
.nw-output-col + .nw-output-col {
  border-left: 1px solid rgba(0,0,0,.07);
}
@media (max-width: 767px) {
  .nw-output-col + .nw-output-col {
    border-left: none;
    border-top: 1px solid rgba(0,0,0,.07);
  }
}
.nw-output-colhead {
  padding: 12px 20px;
  border-bottom: 1px solid rgba(0,0,0,.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafafa;
}
.nw-output-collabel {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #888;
}
.nw-output-collabel.after { color: #111; }

/* Status badge */
.nw-status-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 4px;
  display: none;
}
.nw-status-badge.visible { display: inline-block; }
.badge-seo      { background: rgba(0,120,255,.1);  color: #0066cc; }
.badge-security { background: rgba(220,38,38,.1);   color: #dc2626; }
.badge-qa       { background: rgba(245,158,11,.1);  color: #d97706; }
.badge-ui       { background: rgba(124,58,237,.1);  color: #7c3aed; }
.badge-person   { background: rgba(5,150,105,.1);   color: #059669; }

/* Code block */
.nw-code-block {
  padding: 20px;
  font-family: 'Courier New', monospace;
  font-size: 12.5px;
  line-height: 1.75;
  color: #555;
  min-height: 200px;
  white-space: pre;
  overflow-x: auto;
  background: #fff;
}
.nw-output-col:last-child .nw-code-block {
  background: #fafffe;
}

/* Diff highlights */
.diff-add { background: rgba(22,163,74,.12); color: #15803d; display: block; margin: 0 -20px; padding: 0 20px; }
.diff-rem { background: rgba(220,38,38,.08); color: #b91c1c; display: block; margin: 0 -20px; padding: 0 20px; text-decoration: line-through; opacity: .7; }
.diff-chg { background: rgba(245,158,11,.1); color: #92400e; display: block; margin: 0 -20px; padding: 0 20px; }

/* Placeholder */
.nw-output-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  gap: 10px;
  color: #bbb;
  font-size: 13px;
}
.nw-output-placeholder-icon { font-size: 28px; }

/* ── Summary ── */
.nw-summary {
  padding: 24px;
  display: none;
  background: #fff;
}
.nw-summary.visible { display: block; }
.nw-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  background: rgba(0,0,0,.07);
  border: 1px solid rgba(0,0,0,.07);
  border-radius: 10px;
  overflow: hidden;
}
@media (max-width: 767px) {
  .nw-summary-grid { grid-template-columns: 1fr; }
}
.nw-summary-cell {
  background: #fff;
  padding: 20px 22px;
}
.nw-summary-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 10px;
}
.nw-summary-rule-name {
  font-size: 14px;
  font-weight: 700;
  color: #111;
  margin-bottom: 4px;
}
.nw-summary-rule-meta {
  font-size: 12px;
  color: #555;
  font-family: 'Courier New', monospace;
  line-height: 1.6;
  white-space: pre;
}
.nw-summary-changes {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.nw-summary-change {
  font-size: 13px;
  color: #222;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nw-summary-change::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #22c55e;
  border-radius: 50%;
  flex-shrink: 0;
}
.nw-summary-impact {
  font-size: 14px;
  color: #222;
  line-height: 1.6;
}

/* ── Rule logic expander ── */
.nw-rule-logic-wrap {
  border-top: 1px solid rgba(0,0,0,.07);
  background: #fafafa;
}
.nw-rule-logic-toggle {
  width: 100%;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: #666;
  letter-spacing: .04em;
  text-align: left;
  transition: color .15s;
}
.nw-rule-logic-toggle:hover { color: #111; }
.nw-rule-logic-arrow {
  margin-left: auto;
  font-size: 14px;
  transition: transform .2s;
}
.nw-rule-logic-toggle.open .nw-rule-logic-arrow { transform: rotate(180deg); }
.nw-rule-logic-body {
  display: none;
  padding: 0 24px 20px;
}
.nw-rule-logic-body.open { display: block; }
.nw-rule-logic-code {
  background: #111;
  color: #e5e7eb;
  border-radius: 8px;
  padding: 18px 20px;
  font-family: 'Courier New', monospace;
  font-size: 12.5px;
  line-height: 1.8;
  white-space: pre;
  overflow-x: auto;
}
.rl-key { color: #93c5fd; }
.rl-val { color: #86efac; }
.rl-str { color: #fde68a; }
.rl-cmt { color: #6b7280; }
