/* market.css — Hyperinals Marketplace */

.container { max-width: 1200px; }

/* ── Page header ── */
.market-header { margin-bottom: 32px; }
.market-header .eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--green); text-transform: uppercase; margin-bottom: 10px; }
.market-header h1 { font-size: 40px; font-weight: 800; letter-spacing: -.03em; color: var(--text); margin-bottom: 10px; }
.market-header p  { font-size: 16px; color: var(--text-2); }

/* ── Stats row ── */
.stats-row  { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }
.stat-card  {
  background: rgba(255,255,255,.03); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px 22px; flex: 1; min-width: 140px;
  transition: border-color .2s;
}
.stat-card:hover { border-color: var(--border-g); }
.stat-label { font-size: 11px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.stat-value { font-size: 24px; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.stat-value span { font-size: 14px; font-weight: 500; color: var(--text-2); }

/* ── Toolbar ── */
.market-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 20px;
}
.toolbar-left  { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar-right { display: flex; gap: 8px; align-items: center; }

.filter-select {
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  color: var(--text); font-family: inherit; font-size: 13px;
  padding: 8px 12px; border-radius: 9px; cursor: pointer; outline: none;
  transition: border-color .2s;
}
.filter-select:hover, .filter-select:focus { border-color: var(--border-g); }
.filter-select option { background: #111; }

.sort-btn {
  padding: 8px 14px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-2); border-radius: 9px; cursor: pointer;
  font-family: inherit; transition: all .2s; letter-spacing: .02em;
}
.sort-btn:hover:not(.active) { border-color: var(--border-g); color: var(--text); }
.sort-btn.active { background: var(--green); color: #000; border-color: var(--green); }

.btn-list {
  padding: 10px 22px; background: var(--green); color: #000;
  font-size: 14px; font-weight: 700; border: none; border-radius: 10px;
  cursor: pointer; font-family: inherit; letter-spacing: .02em;
  box-shadow: 0 0 18px rgba(138,244,220,.25); transition: all .2s;
  display: flex; align-items: center; gap: 6px;
}
.btn-list:hover { background: #1aff97; box-shadow: 0 0 28px rgba(138,244,220,.45); transform: translateY(-1px); }
.btn-list:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── View toggle ── */
.view-toggle { display: flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.view-btn {
  padding: 8px 12px; background: transparent; border: none;
  color: var(--text-2); cursor: pointer; font-size: 16px;
  transition: all .2s; line-height: 1;
}
.view-btn.active { background: rgba(138,244,220,.1); color: var(--green); }

/* ── Listings grid ── */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.listings-grid.list-view { grid-template-columns: 1fr; }

/* ── Listing card ── */
.listing-card {
  background: rgba(255,255,255,.03); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden; transition: all .25s;
  display: flex; flex-direction: column;
}
.listing-card:hover {
  border-color: rgba(138,244,220,.25);
  box-shadow: 0 0 30px rgba(138,244,220,.06);
  transform: translateY(-2px);
}

.listing-card-head {
  padding: 20px 20px 16px;
  background: linear-gradient(135deg, rgba(138,244,220,.06) 0%, rgba(124,58,237,.04) 100%);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.tick-badge {
  font-size: 22px; font-weight: 900; color: var(--green);
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.listing-op-badge {
  font-size: 10px; font-weight: 700; padding: 3px 8px;
  border-radius: 6px; letter-spacing: .06em; text-transform: uppercase;
  background: rgba(138,244,220,.12); color: var(--green); border: 1px solid rgba(138,244,220,.2);
}

.listing-card-body { padding: 16px 20px; flex: 1; display: flex; flex-direction: column; gap: 10px; }

.listing-row { display: flex; justify-content: space-between; align-items: center; }
.listing-lbl { font-size: 11px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; }
.listing-val { font-size: 14px; font-weight: 600; color: var(--text); }
.listing-val.green { color: var(--green); }
.listing-val.small { font-size: 12px; color: var(--text-2); font-weight: 500; }

.listing-divider { height: 1px; background: var(--border); margin: 2px 0; }

.listing-price-big {
  font-size: 26px; font-weight: 800; color: var(--green);
  letter-spacing: -.02em; line-height: 1.1;
}
.listing-price-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }

.listing-card-foot {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 8px;
}
.btn-buy {
  flex: 1; padding: 11px; background: var(--green); color: #000;
  font-size: 14px; font-weight: 700; border: none; border-radius: 9px;
  cursor: pointer; font-family: inherit; transition: all .2s; letter-spacing: .02em;
}
.btn-buy:hover { background: #1aff97; box-shadow: 0 0 20px rgba(138,244,220,.35); }
.btn-buy:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }

.btn-delist {
  padding: 11px 14px; background: rgba(255,255,255,.04); color: var(--text-2);
  font-size: 13px; font-weight: 600; border: 1px solid var(--border);
  border-radius: 9px; cursor: pointer; font-family: inherit; transition: all .2s;
}
.btn-delist:hover { border-color: #ff4d4d; color: #ff4d4d; background: rgba(255,77,77,.06); }

/* List-view card override */
.listings-grid.list-view .listing-card { flex-direction: row; align-items: stretch; }
.listings-grid.list-view .listing-card-head { width: 120px; flex-direction: column; justify-content: center; border-bottom: none; border-right: 1px solid var(--border); flex-shrink: 0; }
.listings-grid.list-view .listing-card-body { flex-direction: row; align-items: center; gap: 24px; flex-wrap: wrap; }
.listings-grid.list-view .listing-row { flex-direction: column; align-items: flex-start; gap: 2px; }
.listings-grid.list-view .listing-divider { display: none; }
.listings-grid.list-view .listing-price-big { font-size: 20px; }
.listings-grid.list-view .listing-card-foot { width: 160px; flex-shrink: 0; flex-direction: column; border-top: none; border-left: 1px solid var(--border); }

/* ── Empty state ── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center; padding: 80px 24px;
  background: rgba(255,255,255,.02); border: 1px dashed rgba(255,255,255,.08);
  border-radius: 20px;
}
.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: .4; }
.empty-state h3 { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.empty-state p  { font-size: 15px; color: var(--text-2); max-width: 380px; margin: 0 auto 24px; }

/* ── Coming Soon banner ── */
.coming-soon-banner {
  background: linear-gradient(135deg, rgba(124,58,237,.12), rgba(138,244,220,.07));
  border: 1px solid rgba(138,244,220,.18);
  border-radius: 14px; padding: 14px 20px;
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 24px; font-size: 14px; color: var(--text-2);
}
.coming-soon-badge {
  background: rgba(168,85,247,.2); color: #c084fc;
  border: 1px solid rgba(168,85,247,.3);
  font-size: 10px; font-weight: 700; letter-spacing: .1em;
  padding: 3px 10px; border-radius: 20px; white-space: nowrap;
}

/* ── Pagination ── */
.pagination { display: flex; gap: 6px; margin-top: 28px; justify-content: center; flex-wrap: wrap; }
.page-btn   { padding: 7px 16px; font-size: 13px; border: 1px solid var(--border); background: transparent; color: var(--text-2); border-radius: 9px; cursor: pointer; font-family: inherit; transition: all .2s; }
.page-btn:hover { border-color: var(--border-g); color: var(--green); }
.page-btn.active { background: var(--green); color: #000; border-color: var(--green); font-weight: 700; }
.page-btn:disabled { opacity: .3; cursor: not-allowed; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.7); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
  padding: 24px;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box {
  background: #111; border: 1px solid rgba(138,244,220,.15);
  border-radius: 20px; width: 100%; max-width: 440px;
  box-shadow: 0 24px 80px rgba(0,0,0,.7);
  transform: translateY(16px); transition: transform .25s;
}
.modal-overlay.open .modal-box { transform: translateY(0); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-title  { font-size: 17px; font-weight: 700; color: var(--text); }
.modal-close  {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255,255,255,.06); border: 1px solid var(--border);
  color: var(--text-2); font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.modal-close:hover { background: rgba(255,77,77,.1); border-color: #ff4d4d; color: #ff4d4d; }
.modal-body   { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; }

.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; }
.form-input {
  width: 100%; padding: 12px 14px; background: rgba(255,255,255,.05);
  border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-family: inherit; font-size: 14px; outline: none;
  transition: border-color .2s;
}
.form-input:focus { border-color: rgba(138,244,220,.4); }
.form-hint { font-size: 11px; color: var(--text-2); }

.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

.preview-box {
  background: rgba(138,244,220,.05); border: 1px solid rgba(138,244,220,.15);
  border-radius: 10px; padding: 14px; font-size: 13px;
}
.preview-row { display: flex; justify-content: space-between; padding: 4px 0; }
.preview-key { color: var(--text-2); }
.preview-val { color: var(--green); font-weight: 600; }
.preview-total { border-top: 1px solid rgba(138,244,220,.15); margin-top: 8px; padding-top: 10px; }
.preview-total .preview-val { font-size: 16px; font-weight: 800; }

.btn-cancel {
  flex: 1; padding: 12px; background: rgba(255,255,255,.04);
  border: 1px solid var(--border); color: var(--text-2);
  font-size: 14px; font-weight: 600; border-radius: 10px;
  cursor: pointer; font-family: inherit; transition: all .2s;
}
.btn-cancel:hover { border-color: var(--border-g); color: var(--text); }
.btn-submit {
  flex: 2; padding: 12px; background: var(--green); color: #000;
  font-size: 14px; font-weight: 700; border: none; border-radius: 10px;
  cursor: pointer; font-family: inherit; transition: all .2s;
  box-shadow: 0 0 16px rgba(138,244,220,.2);
}
.btn-submit:hover { background: #1aff97; box-shadow: 0 0 24px rgba(138,244,220,.4); }
.btn-submit:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .market-header h1 { font-size: 30px; }
  .stats-row { display: grid; grid-template-columns: 1fr 1fr; }
  .market-toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-left, .toolbar-right { justify-content: space-between; }
  .listings-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .listings-grid.list-view .listing-card { flex-direction: column; }
  .listings-grid.list-view .listing-card-head { width: 100%; flex-direction: row; border-right: none; border-bottom: 1px solid var(--border); }
  .listings-grid.list-view .listing-card-body { flex-direction: row; }
  .listings-grid.list-view .listing-card-foot { width: 100%; flex-direction: row; border-left: none; border-top: 1px solid var(--border); }
}
@media (max-width: 480px) {
  .listings-grid { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; }
}
