/* ============================================
   TRADE / MARKETPLACE PAGE
   ============================================ */

.trade-page {
  padding-top: 70px;
}

.trade-main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.nav-links a.active {
  color: var(--accent);
}

/* ----- TOOLBAR ----- */
.market-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.t-chip {
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  transition: all 0.15s ease;
}

.t-chip:hover { color: var(--text); border-color: var(--text-dim); }

.t-chip-active {
  background: var(--text);
  color: #000;
  border-color: var(--text);
}

.toolbar-right {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.quick-buy {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line-2);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 12px;
}

.qb-icon {
  color: var(--accent);
  font-size: 14px;
}

.qb-label {
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-size: 11px;
}

.quick-buy input {
  width: 80px;
  background: transparent;
  border: none;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  text-align: right;
  outline: none;
}

.quick-buy input::-webkit-outer-spin-button,
.quick-buy input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qb-unit {
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line-2);
  border-radius: 2px;
  min-width: 260px;
}

.search-icon {
  color: var(--text-muted);
  font-size: 14px;
}

.search-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  outline: none;
}

.search-wrap input::placeholder {
  color: var(--text-muted);
}

/* ----- BIG TABLE ----- */
.big-table-wrap {
  border: 1px solid var(--line);
  background: var(--bg);
}

.big-table {
  width: 100%;
}

.big-head,
.big-row {
  display: grid;
  grid-template-columns:
    minmax(220px, 1.6fr)   /* token */
    70px                   /* age */
    minmax(110px, 1fr)     /* mkt cap */
    minmax(90px, 1fr)      /* holders */
    80px                   /* 1h */
    80px                   /* 6h */
    80px                   /* 24h */
    minmax(110px, 1fr)     /* 24h vol */
    minmax(110px, 1fr)     /* volume */
    minmax(140px, 1.1fr)   /* minted progress */
    110px;                 /* action */
  gap: 12px;
  padding: 14px 20px;
  align-items: center;
  font-family: var(--mono);
  font-size: 12px;
}

.big-head {
  border-bottom: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  position: sticky;
  top: 70px;
  background: var(--bg);
  z-index: 5;
}

.big-row {
  border-bottom: 1px solid var(--line);
  transition: background 0.12s ease;
  cursor: pointer;
}

.big-row:last-child { border-bottom: none; }
.big-row:hover { background: var(--bg-elev); }

.token-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.token-icon {
  width: 32px;
  height: 32px;
  background: var(--bg-elev);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
}

.token-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.token-ticker {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.token-addr {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.dual-line {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dual-line .primary { color: var(--text); }
.dual-line .secondary { color: var(--text-muted); font-size: 10px; }

.change-pos { color: var(--green); }
.change-neg { color: var(--red); }
.change-flat { color: var(--text-muted); }

.minted-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.minted-bar-track {
  height: 3px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}

.minted-bar-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.4s ease;
}

.minted-bar-fill.done { background: var(--green); }

.minted-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
}

.row-action {
  padding: 7px 14px;
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  border-radius: 2px;
  transition: all 0.12s ease;
  width: 100%;
}

.row-action:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.row-action.row-action-buy {
  background: rgba(244, 183, 40, 0.08);
  border-color: rgba(244, 183, 40, 0.4);
  color: var(--accent);
}

.row-action.row-action-buy:hover {
  background: var(--accent);
  color: #000;
}

.table-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
}

.legend {
  display: flex;
  gap: 18px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.legend-dot.live { background: var(--accent); }
.legend-dot.done { background: var(--green); }

/* ----- DEDICATED MINT PAGE GRID ----- */
.mint-page-grid-wrap {
  margin-top: 8px;
}

.mint-grid-page .mint-card {
  background: var(--bg);
}

/* ----- RESPONSIVE ----- */
@media (max-width: 1300px) {
  .big-head,
  .big-row {
    grid-template-columns:
      minmax(200px, 1.5fr)
      minmax(100px, 1fr)
      minmax(80px, 1fr)
      80px
      80px
      minmax(100px, 1fr)
      minmax(130px, 1fr)
      100px;
  }
  .big-head > div:nth-child(2),
  .big-head > div:nth-child(5),
  .big-head > div:nth-child(9),
  .big-row > div:nth-child(2),
  .big-row > div:nth-child(5),
  .big-row > div:nth-child(9) {
    display: none;
  }
}

@media (max-width: 980px) {
  .trade-main { padding: 24px 16px 60px; }
  .market-toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-right { flex-direction: column; align-items: stretch; }
  .search-wrap { min-width: 0; }
  .big-head,
  .big-row {
    grid-template-columns:
      minmax(160px, 1.4fr)
      minmax(80px, 1fr)
      80px
      minmax(120px, 1fr)
      90px;
    font-size: 11px;
  }
  .big-head > div:nth-child(2),
  .big-head > div:nth-child(4),
  .big-head > div:nth-child(5),
  .big-head > div:nth-child(7),
  .big-head > div:nth-child(8),
  .big-row > div:nth-child(2),
  .big-row > div:nth-child(4),
  .big-row > div:nth-child(5),
  .big-row > div:nth-child(7),
  .big-row > div:nth-child(8) {
    display: none;
  }
}
