/* =========================================================
   N1N Marketplace + AI Product Card Factory Pack
   Drop this file into /assets/product-card-factory.css
   ========================================================= */
:root {
  --pcf-bg: #050609;
  --pcf-bg-2: #0b0e13;
  --pcf-panel: rgba(255,255,255,.055);
  --pcf-panel-2: rgba(255,255,255,.085);
  --pcf-line: rgba(255,255,255,.12);
  --pcf-line-soft: rgba(255,255,255,.075);
  --pcf-text: #f7f4ec;
  --pcf-muted: #aeb6c2;
  --pcf-soft: #747f8e;
  --pcf-cyan: #36d4d8;
  --pcf-emerald: #51d48d;
  --pcf-violet: #8f7cff;
  --pcf-gold: #dfb56d;
  --pcf-danger: #ff7474;
  --pcf-radius: 18px;
  --pcf-shadow: 0 28px 90px rgba(0,0,0,.42);
  --pcf-max: 1280px;
}

.n1n-marketplace-teaser,
.n1n-marketplace-page,
.pcf-page {
  color: var(--pcf-text);
}

.n1n-marketplace-teaser {
  position: relative;
  padding: 96px 0;
  border-top: 1px solid var(--pcf-line-soft);
  border-bottom: 1px solid var(--pcf-line-soft);
  overflow: hidden;
  background:
    radial-gradient(circle at 16% 12%, rgba(54,212,216,.18), transparent 34%),
    radial-gradient(circle at 82% 8%, rgba(143,124,255,.16), transparent 32%),
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012)),
    #06080c;
}
.n1n-marketplace-teaser::before,
.n1n-marketplace-page::before,
.pcf-page::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.58), transparent 78%);
}
.n1n-marketplace-inner,
.market-shell,
.pcf-shell {
  position: relative;
  z-index: 2;
  width: min(var(--pcf-max), calc(100% - 40px));
  margin: 0 auto;
}
.n1n-marketplace-grid {
  display: grid;
  grid-template-columns: .92fr 1.08fr;
  gap: 24px;
  align-items: center;
}
.n1n-marketplace-copy .section-kicker,
.market-kicker,
.pcf-kicker {
  margin: 0 0 12px;
  color: var(--pcf-gold);
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.n1n-marketplace-copy h2,
.market-hero h1,
.pcf-hero h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  line-height: .96;
  font-weight: 950;
  letter-spacing: -.04em;
}
.n1n-marketplace-copy p,
.market-hero p,
.pcf-hero p {
  max-width: 700px;
  margin: 22px 0 0;
  color: var(--pcf-muted);
  font-size: 1.08rem;
}
.n1n-marketplace-actions,
.market-actions,
.pcf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}
.n1n-product-spotlight,
.market-card.featured,
.pcf-panel.hot {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(81,212,141,.42);
  background:
    linear-gradient(145deg, rgba(81,212,141,.13), rgba(54,212,216,.075) 45%, rgba(143,124,255,.08)),
    rgba(255,255,255,.05);
  box-shadow: 0 28px 100px rgba(81,212,141,.11), inset 0 1px 0 rgba(255,255,255,.12);
}
.n1n-product-spotlight::before,
.market-card.featured::before,
.pcf-panel.hot::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -80%;
  width: 70%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.16), transparent);
  transform: rotate(18deg);
  animation: pcfShine 5.8s ease-in-out infinite;
}
.n1n-product-spotlight {
  min-height: 420px;
  padding: 24px;
  border-radius: var(--pcf-radius);
}
.n1n-product-spotlight > * { position: relative; z-index: 2; }
.pcf-badge-row { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 18px; }
.pcf-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  color: #dfffee;
  background: rgba(255,255,255,.055);
  font-size: .78rem;
  font-weight: 900;
  white-space: nowrap;
}
.pcf-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pcf-emerald); box-shadow: 0 0 16px rgba(81,212,141,.7); }
.pcf-mini-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 22px 0;
}
.pcf-mini-slide {
  aspect-ratio: 3/4;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 35%, rgba(255,255,255,.34), transparent 24%),
    linear-gradient(145deg, rgba(223,181,109,.26), rgba(54,212,216,.12) 44%, rgba(143,124,255,.16)),
    #0a0e14;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 18px 34px rgba(0,0,0,.2);
  position: relative;
  overflow: hidden;
}
.pcf-mini-slide:nth-child(2) { transform: translateY(18px); background: radial-gradient(circle at 60% 34%, rgba(81,212,141,.34), transparent 26%), linear-gradient(145deg, rgba(81,212,141,.2), rgba(5,6,9,.4)), #0a0e14; }
.pcf-mini-slide:nth-child(3) { background: radial-gradient(circle at 45% 38%, rgba(54,212,216,.32), transparent 25%), linear-gradient(145deg, rgba(143,124,255,.2), rgba(5,6,9,.4)), #0a0e14; }
.pcf-mini-slide::after { content: ""; position: absolute; inset: auto 12px 14px; height: 9px; border-radius: 99px; background: linear-gradient(90deg, var(--pcf-emerald), var(--pcf-cyan)); opacity: .9; }
.pcf-mini-slide::before { content: ""; position: absolute; left: 14px; right: 14px; top: 16px; height: 7px; border-radius: 99px; background: rgba(255,255,255,.26); box-shadow: 0 16px 0 rgba(255,255,255,.16), 0 32px 0 rgba(255,255,255,.12); }
.pcf-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; border: 1px solid var(--pcf-line-soft); border-radius: var(--pcf-radius); overflow: hidden; background: var(--pcf-line-soft); }
.pcf-stat { padding: 14px; background: rgba(5,6,9,.66); }
.pcf-stat strong { display: block; color: var(--pcf-text); font-size: 1.35rem; line-height: 1; }
.pcf-stat span { display: block; margin-top: 7px; color: var(--pcf-muted); font-size: .78rem; }

.market-body, .pcf-body {
  min-height: 100vh;
  margin: 0;
  color: var(--pcf-text);
  font-family: Inter, Manrope, "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at 15% 0%, rgba(54,212,216,.18), transparent 28%),
    radial-gradient(circle at 80% 8%, rgba(143,124,255,.16), transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,.02), transparent 340px),
    var(--pcf-bg);
}
.market-header, .pcf-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--pcf-line-soft);
  background: rgba(5,6,9,.82);
  backdrop-filter: blur(18px);
}
.market-header-inner, .pcf-header-inner {
  width: min(var(--pcf-max), calc(100% - 40px));
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 auto;
}
.pcf-brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; font-weight: 950; }
.pcf-brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.18); border-radius: var(--pcf-radius); background: linear-gradient(145deg, rgba(54,212,216,.14), rgba(223,181,109,.12)); }
.pcf-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pcf-nav a { min-height: 40px; display: inline-flex; align-items: center; padding: 10px 13px; border: 1px solid var(--pcf-line-soft); border-radius: var(--pcf-radius); color: #dbe2ea; text-decoration: none; background: rgba(255,255,255,.04); transition: .18s ease; }
.pcf-nav a:hover { transform: translateY(-2px); border-color: rgba(81,212,141,.34); color: #fff; }
.market-hero, .pcf-hero { position: relative; padding: 78px 0 42px; overflow: hidden; }
.market-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 28px 0 90px; }
.market-card { position: relative; min-height: 330px; display: flex; flex-direction: column; padding: 24px; border: 1px solid var(--pcf-line-soft); border-radius: var(--pcf-radius); background: var(--pcf-panel); overflow: hidden; box-shadow: inset 0 1px 0 rgba(255,255,255,.05); transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.market-card:hover { transform: translateY(-5px); border-color: rgba(81,212,141,.34); background: var(--pcf-panel-2); }
.market-card > * { position: relative; z-index: 2; }
.market-card-icon { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 20px; border: 1px solid rgba(255,255,255,.14); border-radius: var(--pcf-radius); background: rgba(255,255,255,.055); color: var(--pcf-cyan); }
.market-card h2 { margin: 0; font-size: 1.45rem; line-height: 1.12; }
.market-card p { margin: 13px 0 0; color: var(--pcf-muted); }
.market-card ul { display: grid; gap: 8px; margin: 20px 0 24px; padding: 0; list-style: none; color: #d7dee6; font-size: .94rem; }
.market-card li { display: flex; gap: 9px; }
.market-card li::before { content: ""; width: 7px; height: 7px; margin-top: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--pcf-emerald); }
.market-card .pcf-btn { margin-top: auto; }

.pcf-btn, .pcf-btn-secondary, .pcf-btn-ghost {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: var(--pcf-radius);
  padding: 12px 18px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, opacity .16s ease;
  cursor: pointer;
}
.pcf-btn:hover, .pcf-btn-secondary:hover, .pcf-btn-ghost:hover { transform: translateY(-2px); }
.pcf-btn { color: #07100f; background: linear-gradient(135deg, #f1d49d, #66e6b1 48%, #48cbd1); box-shadow: 0 16px 45px rgba(81,212,141,.22); }
.pcf-btn-secondary { color: var(--pcf-text); border-color: var(--pcf-line); background: rgba(255,255,255,.065); }
.pcf-btn-ghost { color: #eef2f7; border-color: var(--pcf-line-soft); background: rgba(255,255,255,.035); }
.pcf-btn[disabled], .pcf-btn-secondary[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

.pcf-app-grid { display: grid; grid-template-columns: 470px minmax(0, 1fr); gap: 22px; align-items: start; padding: 24px 0 86px; }
.pcf-panel { border: 1px solid var(--pcf-line-soft); border-radius: var(--pcf-radius); background: var(--pcf-panel); box-shadow: var(--pcf-shadow); overflow: hidden; }
.pcf-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--pcf-line-soft); background: rgba(255,255,255,.035); }
.pcf-panel-head h2 { margin: 0; font-size: 1.25rem; line-height: 1.15; }
.pcf-panel-head span { display: block; margin-top: 6px; color: var(--pcf-muted); font-size: .9rem; }
.pcf-mode { padding: 7px 10px; border: 1px solid rgba(81,212,141,.28); border-radius: 999px; color: #bbffd9; background: rgba(81,212,141,.09); font-size: .78rem; font-weight: 900; white-space: nowrap; }
.pcf-form { display: grid; gap: 14px; padding: 22px; }
.pcf-field { display: grid; gap: 8px; }
.pcf-label { color: #dfe5ed; font-size: .9rem; font-weight: 850; }
.pcf-input, .pcf-select, .pcf-textarea { width: 100%; min-height: 48px; border: 1px solid var(--pcf-line-soft); border-radius: var(--pcf-radius); padding: 12px 13px; color: var(--pcf-text); background: rgba(255,255,255,.055); outline: none; transition: .16s ease; }
.pcf-textarea { min-height: 112px; resize: vertical; line-height: 1.45; }
.pcf-textarea.compact { min-height: 88px; }
.pcf-input:focus, .pcf-select:focus, .pcf-textarea:focus { border-color: rgba(81,212,141,.52); background: rgba(255,255,255,.075); }
.pcf-select option { background: #111721; color: var(--pcf-text); }
.pcf-upload { position: relative; display: grid; place-items: center; min-height: 210px; padding: 18px; border: 1px dashed rgba(81,212,141,.38); border-radius: var(--pcf-radius); background: rgba(81,212,141,.055); text-align: center; overflow: hidden; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.pcf-upload:hover, .pcf-upload.is-dragging { border-color: rgba(81,212,141,.82); background: rgba(81,212,141,.11); }
.pcf-upload.is-dragging { transform: scale(.99); }
.pcf-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.pcf-upload img { max-width: 100%; max-height: 210px; object-fit: contain; position: relative; z-index: 2; filter: drop-shadow(0 18px 28px rgba(0,0,0,.4)); }
.pcf-upload-placeholder { color: var(--pcf-muted); }
.pcf-upload-placeholder strong { display: block; color: var(--pcf-text); margin-bottom: 6px; }
.pcf-hint { color: var(--pcf-soft); font-size: .76rem; line-height: 1.4; }
.pcf-quality-note { min-height: 34px; padding: 9px 11px; border: 1px solid rgba(81,212,141,.16); border-radius: 10px; color: #cfe9dd; background: rgba(81,212,141,.055); }
.pcf-inline-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pcf-cost { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; border: 1px solid var(--pcf-line-soft); border-radius: var(--pcf-radius); overflow: hidden; background: var(--pcf-line-soft); }
.pcf-cost div { padding: 13px; background: rgba(5,6,9,.56); }
.pcf-cost strong { display: block; color: var(--pcf-gold); font-size: 1.08rem; }
.pcf-cost span { display: block; margin-top: 5px; color: var(--pcf-muted); font-size: .78rem; }
.pcf-status { min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid var(--pcf-line-soft); border-radius: var(--pcf-radius); color: #dbe2ea; background: rgba(255,255,255,.04); font-size: .92rem; }
.pcf-status .spinner { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.18); border-top-color: var(--pcf-emerald); border-radius: 50%; animation: pcfSpin .8s linear infinite; display: none; }
.pcf-status.loading .spinner { display: block; }
.pcf-results-wrap { padding: 22px; }
.pcf-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.pcf-toolbar h2 { margin: 0; font-size: 1.25rem; }
.pcf-results { width: min(100%, 680px); display: grid; grid-template-columns: 1fr; gap: 22px; margin: 0 auto; }
.pcf-card-result { border: 1px solid var(--pcf-line-soft); border-radius: var(--pcf-radius); background: rgba(255,255,255,.035); overflow: hidden; box-shadow: 0 24px 70px rgba(0,0,0,.28); }
.pcf-card-result canvas { width: 100%; aspect-ratio: 3 / 4; display: block; background: #10151d; }
.pcf-card-result-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px; border-top: 1px solid var(--pcf-line-soft); }
.pcf-card-result-foot strong { font-size: .84rem; }
.pcf-card-result-foot span { display: block; margin-top: 4px; color: var(--pcf-muted); font-size: .7rem; }
.pcf-small-link { color: #bff5de; background: none; border: 0; padding: 0; font-weight: 850; cursor: pointer; }
.pcf-empty { display: grid; place-items: center; min-height: 420px; padding: 30px; color: var(--pcf-muted); text-align: center; border: 1px dashed var(--pcf-line); border-radius: var(--pcf-radius); background: rgba(255,255,255,.025); }
.pcf-empty strong { display: block; color: var(--pcf-text); margin-bottom: 9px; font-size: 1.2rem; }
.pcf-spec-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 0 0 30px; }
.pcf-spec { padding: 18px; border: 1px solid var(--pcf-line-soft); border-radius: var(--pcf-radius); background: rgba(255,255,255,.04); }
.pcf-spec strong { display: block; margin-bottom: 7px; color: var(--pcf-text); }
.pcf-spec span { color: var(--pcf-muted); font-size: .9rem; }
.pcf-toolbar-note { display: block; margin-top: 6px; color: var(--pcf-muted); font-size: .82rem; }
.pcf-status.is-warning { border-color: rgba(223,181,109,.35); color: #f5dfb8; background: rgba(223,181,109,.08); }
.pcf-status.is-success { border-color: rgba(81,212,141,.28); color: #d9ffea; background: rgba(81,212,141,.075); }
.pcf-history-section { width: 100%; margin-bottom: 86px; }
.pcf-history-section[hidden] { display: none; }
.pcf-history { display: grid; gap: 24px; padding: 22px; }
.pcf-history-group { border: 1px solid var(--pcf-line-soft); border-radius: var(--pcf-radius); background: rgba(255,255,255,.025); overflow: hidden; }
.pcf-history-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--pcf-line-soft); background: rgba(255,255,255,.025); }
.pcf-history-head strong { display: block; color: var(--pcf-text); }
.pcf-history-head span { display: block; margin-top: 5px; color: var(--pcf-muted); font-size: .8rem; }
.pcf-history-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 320px)); justify-content: center; gap: 18px; padding: 18px; }
.pcf-card-result.is-history { box-shadow: 0 14px 38px rgba(0,0,0,.22); }

@keyframes pcfShine { 0%, 58% { transform: translateX(-30%) rotate(18deg); opacity: 0; } 66% { opacity: 1; } 88%, 100% { transform: translateX(320%) rotate(18deg); opacity: 0; } }
@keyframes pcfSpin { to { transform: rotate(360deg); } }
@media (max-width: 1050px) {
  .n1n-marketplace-grid, .pcf-app-grid { grid-template-columns: 1fr; }
  .market-grid { grid-template-columns: repeat(2, 1fr); }
  .pcf-spec-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .pcf-results { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .n1n-marketplace-inner, .market-shell, .pcf-shell, .market-header-inner, .pcf-header-inner { width: min(100% - 28px, var(--pcf-max)); }
  .n1n-marketplace-teaser { padding: 72px 0; }
  .pcf-mini-preview, .pcf-stats, .pcf-cost, .market-grid, .pcf-results, .pcf-inline-grid, .pcf-spec-grid { grid-template-columns: 1fr; }
  .market-header-inner, .pcf-header-inner { align-items: flex-start; flex-direction: column; padding: 14px 0; }
  .pcf-nav { width: 100%; }
  .pcf-nav a, .pcf-actions a, .pcf-actions button, .market-actions a, .market-actions button, .n1n-marketplace-actions a { width: 100%; }
  .pcf-app-grid { padding-top: 6px; }
}


/* === Prompt field for AI card generation === */
.pcf-prompt-field {
  margin-top: 14px;
}

.pcf-prompt-textarea {
  min-height: 170px;
  resize: vertical;
  line-height: 1.45;
}

.pcf-help {
  display: block;
  margin-top: 7px;
  color: rgba(235,255,247,.58);
  font-size: 12px;
  line-height: 1.35;
}
