/**
 * @file marketplace.css
 * @description Styles for the marketplace SPA view (.mk- scoped) — listing cards,
 *   browse/search forms, status badges, instance selector, and pagination.
 * @version-history
 *   v1.1.0 — 2026-06-02 — Phase 5: tokenize for dark mode (bare color literals → theme tokens)
 *   v1.2.0 — 2026-06-02 — Component unification (#4 buttons): remove .mk-btn* family;
 *     marketplace buttons use canonical theme.css .btn-primary / .btn-outline / .btn-sm.
 *   v1.3.0 — 2026-06-02 — Component unification (#5 inputs): remove .mk-form-input/
 *     -textarea/-select; fields use canonical .input-field (kept mk-form-group/-label/-grid).
 *   v1.4.0 — 2026-06-02 — Component unification (#6 stat cards): remove .mk-stat*;
 *     stats use canonical .stat-grid / .stat-card / .stat-card-value.accent / .stat-card-label.
 *   v1.5.0 — 2026-06-02 — Component unification (#19): tokenize .mk-alert-success/-error
 *     (hardcoded rgba/#ef4444 → --success/-danger -bg/-fg/-border) — dark-mode fix.
 *   v1.6.0 — 2026-06-02 — Component unification (#15 headers): tokenize .mk-page-title
 *     gradient (hardcoded #E8564A → var(--accent-deep)); now token-equivalent to
 *     canonical theme.css .page-title/.page-subtitle (candidates for future deletion).
 *   v1.7.0 — 2026-06-02 — Component unification (#18 category cards): remove .mk-category-card/
 *     -icon/-name/-count; tiles use canonical theme.css .category-card (kept .mk-categories-grid
 *     wrapper — 160px columns differ from hobbies' 200px). Removed hardcoded hover #E8564A and
 *     rgba(0,0,0,0.06) shadow (now tokenized in the canonical class) — dark-mode fix.
 *   v1.8.0 — 2026-06-02 — Component unification (#17 pagination): tokenize
 *     .mk-pagination a.active background (hardcoded rgba(232,86,74,0.06) →
 *     var(--accent-subtle)) — dark-mode fix. Markup left in place (scoped .mk-,
 *     prev/"Page X"/next shape); canonical Pagination/LoadMore added in theme.css.
 *   v1.9.0 — 2026-06-02 — Component unification (#16 tags): tokenize .mk-tag and
 *     .mk-price-badge (hardcoded rgba(232,86,74,0.06)/0.2 + #E8564A →
 *     var(--accent-subtle) / var(--accent-border) / var(--accent)) — dark-mode fix.
 *     Markup left as .mk-tag (rounded-20px pill, bespoke vs canonical .tag-pill).
 */

/* marketplace view — scoped under .mk- */
/* mk-page-title is token-equivalent to the canonical theme.css .page-title
   (candidate for future deletion → use .page-title). */
.mk-page-title {
  font-size: 1.8rem; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 8px;
}
.mk-page-subtitle { color: var(--text-dim); font-size: 1rem; margin-bottom: 32px; }
.mk-section-heading { font-size: 1.1rem; color: var(--text); margin-bottom: 16px; }

.mk-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 24px; margin-bottom: 16px;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.mk-card:hover { background: var(--bg-surface); border-color: #E8564A; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.mk-card-clickable { text-decoration: none; display: block; cursor: pointer; }
.mk-card-title { font-size: 1.1rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.mk-card-meta { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 8px; }
.mk-card-desc { color: var(--text); font-size: 0.9rem; line-height: 1.6; margin-bottom: 12px; }

.mk-listing-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.mk-listing-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

.mk-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.mk-tag {
  display: inline-block; padding: 4px 12px;
  background: var(--accent-subtle); border: 1px solid var(--accent-border);
  border-radius: 20px; font-size: 0.8rem; color: var(--accent); white-space: nowrap;
}

.mk-price-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 14px; background: var(--accent-subtle);
  border: 1px solid var(--accent-border); border-radius: 20px;
  font-size: 0.9rem; font-weight: 600; color: var(--accent);
}

.mk-status-badge {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;
}
.mk-status-active { background: var(--success-bg); border: 1px solid var(--success-border); color: var(--success-fg); }
.mk-status-sold { background: var(--info-bg); border: 1px solid var(--info-border); color: var(--info-fg); }
.mk-status-pending { background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--warn-fg); }
.mk-status-delivered { background: var(--success-bg); border: 1px solid var(--success-border); color: var(--success-fg); }
.mk-status-completed { background: var(--info-bg); border: 1px solid var(--info-border); color: var(--info-fg); }
.mk-status-delisted { background: var(--danger-bg); border: 1px solid var(--danger-border); color: var(--danger-fg); }

/* .mk-stat* removed — marketplace stats use canonical .stat-grid / .stat-card /
   .stat-card-value.accent / .stat-card-label. Unified 2026-06-02 (#6). */

/* Grid wrapper kept per-view: marketplace uses 160px min-width columns (hobbies 200px). */
.mk-categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 32px; }
/* .mk-category-card/-icon/-name/-count removed — marketplace category tiles use
   canonical theme.css .category-card / -icon / -name / -count. The former rules were
   token-equivalent (border-radius:16px === var(--radius)); the hover #E8564A and
   rgba(0,0,0,0.06) shadow are now tokenized (var(--accent)/var(--shadow-md)).
   Unified 2026-06-02 (#18). */

.mk-empty-state { text-align: center; padding: 48px 16px; }
.mk-empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.4; }
.mk-empty-text { color: var(--text-dim); font-size: 1rem; }

.mk-alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 0.9rem; }
.mk-alert-success { background: var(--success-bg); border: 1px solid var(--success-border); color: var(--success-fg); }
.mk-alert-error { background: var(--danger-bg); border: 1px solid var(--danger-border); color: var(--danger-fg); }
.mk-alert-info { background: var(--bg-surface); border: 1px solid var(--border); color: var(--text-dim); }

/* .mk-btn* removed — marketplace uses canonical theme.css .btn-primary / .btn-outline /
   .btn-sm (anchor-safe). Unified 2026-06-02 (#4 buttons). */

.mk-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mk-form-group { margin-bottom: 16px; }
.mk-form-label { display: block; font-size: 0.85rem; color: var(--text-dim); margin-bottom: 6px; font-weight: 500; }
/* .mk-form-input/-textarea/-select removed — marketplace form fields use canonical
   theme.css .input-field (tokenized, focus ring, var(--font)). Unified 2026-06-02 (#5). */

.mk-pagination { display: flex; gap: 8px; justify-content: center; margin-top: 24px; }
.mk-pagination a {
  padding: 8px 16px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); text-decoration: none; font-size: 0.85rem; cursor: pointer;
}
.mk-pagination a:hover { border-color: var(--accent); color: var(--accent); }
.mk-pagination a.active { border-color: var(--accent); color: var(--accent); background: var(--accent-subtle); }

.mk-stars { color: #eab308; font-size: 1.1rem; letter-spacing: 2px; }

.mk-nav { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.mk-nav a {
  color: var(--text-dim); text-decoration: none; font-size: 0.85rem;
  cursor: pointer; transition: color 0.2s; padding: 4px 8px; border-radius: 6px;
}
.mk-nav a:hover, .mk-nav a.active { color: var(--accent); }

/* Instance selector */
.mk-instance-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin: 24px 0; }
.mk-instance-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; cursor: pointer; transition: border-color 0.2s, transform 0.1s; }
.mk-instance-card:hover { border-color: var(--accent, #06b6d4); transform: translateY(-2px); }
.mk-instance-name { font-size: 1.2rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.mk-instance-meta { font-size: 0.85rem; color: var(--text-dim, #94a3b8); }
.mk-visibility-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 500; }
.mk-vis-public { background: var(--success-bg); color: var(--success-fg); }
.mk-vis-password { background: var(--warn-bg); color: var(--warn-fg); }
.mk-vis-invite { background: var(--info-bg); color: var(--info-fg); }
.mk-vis-group { background: var(--success-bg); color: var(--success-fg); }
.mk-back-link { cursor: pointer; color: var(--accent, #06b6d4); margin-bottom: 16px; display: inline-block; }

@media (max-width: 600px) {
  .mk-page-title { font-size: 1.4rem; }
  .mk-form-grid { grid-template-columns: 1fr; }
  .mk-categories-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .mk-instance-grid { grid-template-columns: 1fr; }
}
