/* ============================================================
   Product mockups ("screenshots" with fake data).
   Faithful to the real DCMS admin UI: dark slate sidebar,
   airy light content, blue primary actions. The AI Editor is
   its own dark IDE surface. Mockup palettes are FIXED (they do
   not follow the site theme) so they read as authentic product
   screenshots in both light and dark mode.
   All internal sizing is in em; scale a whole mockup by setting
   font-size on .shot.
   ============================================================ */

@layer mockups {

/* Browser-style frame around every mockup */
.shot {
  font-size: clamp(8.5px, 0.5px + 1.05vw, 13px);
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}
.shot-bar {
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.8em 1.1em;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.shot-bar i { width: 0.85em; height: 0.85em; border-radius: 50%; background: var(--border-strong); }
.shot-bar i:nth-child(1) { background: #E4584B; }
.shot-bar i:nth-child(2) { background: #E0A72E; }
.shot-bar i:nth-child(3) { background: #37B36B; }
.shot-url {
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 0.5em;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-faint);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 0.3em 1.2em;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shot-url .lock { color: var(--success-ink); }

/* ---------- Admin app shell (fixed palette) ---------- */
.mk-app {
  display: grid;
  grid-template-columns: 15em 1fr;
  min-height: 30em;
  background: #f1f5f9;
  color: #1e293b;
  font-family: var(--font-sans);
  font-size: 1em;
  line-height: 1.45;
  text-align: left;
}

.mk-side {
  background: #0f172a;
  color: #cbd5e1;
  padding: 1.1em 0.9em;
  display: flex;
  flex-direction: column;
  gap: 0.2em;
}
.mk-side-brand {
  display: flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.2em 0.6em 1em;
}
.mk-side-brand img { width: 2.2em; height: 2.2em; }
.mk-side-brand b { color: #f1f5f9; font-size: 1.05em; display: block; line-height: 1.15; }
.mk-side-brand small { color: #64748b; font-size: 0.72em; display: block; }
.mk-nav a {
  display: flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.55em 0.7em;
  border-radius: 0.5em;
  color: #cbd5e1;
  font-size: 0.92em;
  text-decoration: none;
}
.mk-nav a svg { width: 1.15em; height: 1.15em; flex: none; opacity: 0.85; }
.mk-nav a.on { background: #334155; color: #f1f5f9; }
.mk-nav a:hover { background: #1e293b; text-decoration: none; }
.mk-side-stats { margin-top: auto; padding: 0.8em 0.6em 0.2em; display: grid; gap: 0.65em; }
.mk-stat { font-size: 0.72em; color: #94a3b8; }
.mk-stat .row { display: flex; justify-content: space-between; margin-bottom: 0.3em; }
.mk-stat .track { height: 0.45em; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.mk-stat .fill {
  height: 100%;
  border-radius: 999px;
  background: #22c55e;
  width: 0;
  transition: width 1.2s var(--ease-out);
}
.mk-stat .fill.warn { background: #f59e0b; }
.in .mk-stat .fill, .shot.static .mk-stat .fill { width: var(--w, 40%); }

.mk-main { padding: 1.4em 1.6em; min-width: 0; }
.mk-h1 {
  display: flex;
  align-items: center;
  gap: 1em;
  margin-bottom: 1.1em;
}
.mk-h1 b { font-size: 1.3em; font-weight: 700; color: #0f172a; }
.mk-h1 .mk-btn { margin-left: auto; }

.mk-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  background: #3b82f6;
  color: #fff;
  font-size: 0.85em;
  font-weight: 600;
  padding: 0.55em 1.1em;
  border-radius: 0.55em;
  white-space: nowrap;
}
.mk-btn.ghost { background: #fff; color: #334155; box-shadow: inset 0 0 0 1px #e2e8f0; }
.mk-btn.danger { background: #fff; color: #dc2626; box-shadow: inset 0 0 0 1px #fecaca; }
.mk-btn.green { background: #16a34a; }

.mk-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.8em;
  padding: 1.1em 1.2em;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.mk-grid { display: grid; gap: 1em; }
.mk-grid.c2 { grid-template-columns: 1fr 1fr; }
.mk-grid.c3 { grid-template-columns: 1fr 1fr 1fr; }

.mk-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.72em;
  font-weight: 600;
  padding: 0.25em 0.75em;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
}
.mk-badge .d { width: 0.55em; height: 0.55em; border-radius: 50%; background: currentColor; }
.mk-badge.ok { background: #dcfce7; color: #15803d; }
.mk-badge.blue { background: #dbeafe; color: #1d4ed8; }
.mk-badge.warn { background: #fef3c7; color: #b45309; }
.mk-badge.err { background: #fee2e2; color: #b91c1c; }

.mk-table { width: 100%; border-collapse: collapse; font-size: 0.88em; }
.mk-table th {
  text-align: left;
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  background: #f8fafc;
  padding: 0.7em 1em;
  border-bottom: 1px solid #e2e8f0;
}
.mk-table td { padding: 0.75em 1em; border-bottom: 1px solid #f1f5f9; color: #334155; }
.mk-table tr:last-child td { border-bottom: 0; }
.mk-table .mono { font-family: var(--font-mono); font-size: 0.9em; color: #475569; }

.mk-meter { display: flex; align-items: center; gap: 0.6em; font-size: 0.78em; color: #64748b; }
.mk-meter .track { flex: 1; height: 0.5em; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.mk-meter .fill { height: 100%; border-radius: 999px; background: #3b82f6; width: 0; transition: width 1.2s var(--ease-out); }
.mk-meter .fill.green { background: #22c55e; }
.mk-meter .fill.amber { background: #f59e0b; }
.in .mk-meter .fill, .shot.static .mk-meter .fill { width: var(--w, 50%); }

.mk-input {
  display: flex;
  align-items: center;
  gap: 0.6em;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 0.55em;
  padding: 0.55em 0.9em;
  font-size: 0.88em;
  color: #334155;
}
.mk-input.mono { font-family: var(--font-mono); font-size: 0.82em; }
.mk-input .ph { color: #94a3b8; }
.mk-label { font-size: 0.72em; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: #64748b; margin: 0.9em 0 0.35em; }
.mk-label:first-child { margin-top: 0; }

/* Dark log stream (deploy output, terminals inside the app) */
.mk-log {
  background: #0f172a;
  border-radius: 0.7em;
  padding: 1em 1.2em;
  font-family: var(--font-mono);
  font-size: 0.8em;
  line-height: 1.8;
  color: #cbd5e1;
  overflow: hidden;
}
.mk-log .l { display: block; opacity: 0; transform: translateY(4px); transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out); }
.mk-log .l.on, .shot.static .mk-log .l { opacity: 1; transform: none; }
.mk-log .ok { color: #4ade80; }
.mk-log .dim { color: #64748b; }
.mk-log .amber { color: #fbbf24; }
.mk-log .blue { color: #60a5fa; }

/* Progress steps (wizards, validation modals) */
.mk-steps { display: grid; gap: 0.55em; }
.mk-step { display: flex; align-items: center; gap: 0.7em; font-size: 0.88em; color: #334155; }
.mk-step .ic {
  width: 1.5em;
  height: 1.5em;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  background: #dcfce7;
  color: #15803d;
  font-size: 0.8em;
  font-weight: 700;
}
.mk-step.pend .ic { background: #f1f5f9; color: #94a3b8; }
.mk-step.run .ic { background: #dbeafe; color: #1d4ed8; }
.mk-step.run .ic::after {
  content: '';
  width: 0.7em;
  height: 0.7em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: mk-spin 0.9s linear infinite;
}
@keyframes mk-spin { to { transform: rotate(360deg); } }

/* ---------- AI Editor dark IDE shell (fixed palette) ---------- */
.mk-ide {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  min-height: 30em;
  background: #0b1118;
  color: #d7e0ea;
  font-size: 1em;
  text-align: left;
}
.mk-ide-chat { padding: 1.2em; display: flex; flex-direction: column; gap: 0.9em; border-right: 1px solid #1c2735; min-width: 0; }
.mk-msg {
  max-width: 92%;
  border-radius: 0.9em;
  padding: 0.8em 1em;
  font-size: 0.88em;
  line-height: 1.55;
  background: #0f1724;
  border: 1px solid #1c2735;
}
.mk-msg.user { align-self: flex-end; background: #1a2332; border-color: #26344a; color: #e8eef6; }
.mk-msg .who { display: block; font-size: 0.72em; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #5b8dd6; margin-bottom: 0.35em; }
.mk-msg.user .who { color: #94a3b8; }
.mk-diff {
  font-family: var(--font-mono);
  font-size: 0.78em;
  background: #0a0f16;
  border: 1px solid #1c2735;
  border-radius: 0.6em;
  padding: 0.7em 0.9em;
  margin-top: 0.6em;
  line-height: 1.7;
  overflow-x: auto;
}
.mk-diff .add { color: #4ade80; }
.mk-diff .del { color: #f87171; }
.mk-diff .ctx { color: #64748b; }
.mk-ide-tools { display: flex; gap: 0.5em; flex-wrap: wrap; }
.mk-tool {
  font-size: 0.72em;
  font-weight: 600;
  color: #9fb2c8;
  background: #0f1724;
  border: 1px solid #1c2735;
  border-radius: 999px;
  padding: 0.35em 0.9em;
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
}
.mk-tool.on { color: #fbbf24; border-color: #4a3a15; background: #1a1508; }
.mk-ide-input {
  margin-top: auto;
  background: #0f1724;
  border: 1px solid #26344a;
  border-radius: 0.8em;
  padding: 0.8em 1em;
  font-size: 0.85em;
  color: #7a8ca0;
  display: flex;
  align-items: center;
  gap: 0.6em;
}
.mk-ide-preview { padding: 1.2em; display: flex; flex-direction: column; gap: 0.8em; min-width: 0; }
.mk-device-tabs { display: flex; gap: 0.4em; }
.mk-device-tabs span {
  font-size: 0.72em;
  font-weight: 600;
  padding: 0.35em 0.9em;
  border-radius: 999px;
  color: #7a8ca0;
  background: #0f1724;
  border: 1px solid #1c2735;
}
.mk-device-tabs span.on { color: #0b1118; background: #d7e0ea; border-color: #d7e0ea; }
.mk-viewport {
  flex: 1;
  background: #fff;
  border-radius: 0.7em;
  overflow: hidden;
  border: 1px solid #1c2735;
  color: #1e293b;
  display: flex;
  flex-direction: column;
}

/* ---------- Charts (SVG helpers) ---------- */
.mk-chart { width: 100%; height: auto; display: block; }
.mk-chart .grid-line { stroke: #e2e8f0; stroke-width: 1; }
.mk-chart .series {
  fill: none;
  stroke: #3b82f6;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
}
.in .mk-chart .series, .shot.static .mk-chart .series { animation: mk-draw 1.6s var(--ease-out) forwards 0.2s; }
.mk-chart .area { fill: url(#mkAreaFill); opacity: 0; transition: opacity 0.9s var(--ease-out) 0.9s; }
.in .mk-chart .area, .shot.static .mk-chart .area { opacity: 1; }
.mk-chart .bar { fill: #3b82f6; transform: scaleY(0); transform-origin: bottom; transition: transform 0.8s var(--ease-spring); }
.in .mk-chart .bar, .shot.static .mk-chart .bar { transform: scaleY(1); }
@keyframes mk-draw { to { stroke-dashoffset: 0; } }

/* Mobile: shells collapse to single column */
@media (max-width: 700px) {
  .mk-app { grid-template-columns: 1fr; }
  .mk-side { flex-direction: row; align-items: center; overflow-x: auto; gap: 0.6em; padding: 0.8em; }
  .mk-side-stats, .mk-side-brand small { display: none; }
  .mk-nav { display: flex; gap: 0.2em; }
  .mk-nav a { white-space: nowrap; }
  .mk-ide { grid-template-columns: 1fr; }
  .mk-ide-chat { border-right: 0; border-bottom: 1px solid #1c2735; }
  .mk-grid.c2, .mk-grid.c3 { grid-template-columns: 1fr; }
}

}
