/* ─────────────────────────────────────────────
   demo.css  —  AbleBlox Exchange demo page
   Serves: /static/css/demo.css
   ───────────────────────────────────────────── */

/* ── Layout ── */
.ex-wrap  { padding: 2rem 0; max-width: 1100px; margin: 0 auto; }

.ex-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.ex-logo { display: flex; align-items: center; gap: 12px; }

.ex-logo-mark {
  width: 36px;
  height: 36px;
  background: #e8f0fb;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #185fa5;
}

.ex-logo-name { font-size: 1rem;  font-weight: 600; color: #1a1a1a; }
.ex-logo-sub  { font-size: 0.7rem; color: #888; letter-spacing: 0.04em; }

.ex-badges { display: flex; align-items: center; gap: 8px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f2f2f0;
  border: 1px solid #e0e0dc;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.7rem;
  color: #555;
}

.badge-live { background: #eaf3de; border-color: #c0dd97; color: #3b6d11; }

.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #639922;
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

/* ── Stats bar ── */
.ex-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: #f7f7f5;
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

.stat-label { font-size: 0.68rem; color: #999; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.stat-value { font-size: 1.2rem; font-weight: 600; color: #1a1a1a; }
.stat-change { font-size: 0.7rem; margin-top: 2px; }
.stat-change.up    { color: #0f6e56; }
.stat-change.down  { color: #993c1d; }
.stat-change.muted { color: #aaa; }

/* ── Body grid ── */
.ex-body {
  display: grid;
  grid-template-columns: 1fr 290px;
  gap: 14px;
}

.ex-left, .ex-right { display: flex; flex-direction: column; gap: 14px; }

/* ── Panel ── */
.panel {
  background: #fff;
  border: 1px solid #e8e8e4;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  position: relative;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

/* ── Chart ── */
.chart-area { height: 130px; position: relative; margin-bottom: 0.5rem; }
#priceChart  { width: 100% !important; }

/* ── Order book ── */
.orderbook { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.ob-col-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: #aaa;
  margin-bottom: 4px;
  padding: 0 4px;
}

.ob-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: default;
  transition: background 0.12s;
}
.ob-row:hover { background: #f5f5f2; }

.bid-price { color: #0f6e56; font-weight: 600; }
.ask-price { color: #993c1d; font-weight: 600; }
.ob-qty    { color: #aaa; }

/* ── Trade history ── */
.trades-header {
  display: grid;
  grid-template-columns: 64px 1fr 1fr 1fr;
  font-size: 0.65rem;
  color: #aaa;
  padding: 0 4px;
  margin-bottom: 4px;
}

.trades-list { display: flex; flex-direction: column; gap: 3px; max-height: 130px; overflow-y: auto; }

.trades-empty { font-size: 0.75rem; color: #aaa; text-align: center; padding: 12px 0; }

.trade-item {
  display: grid;
  grid-template-columns: 64px 1fr 1fr 1fr;
  font-size: 0.7rem;
  align-items: center;
  padding: 3px 4px;
  border-radius: 4px;
}

.trade-item.buy-item  { background: rgba(15, 110, 86, 0.07); }
.trade-item.sell-item { background: rgba(153, 60, 29, 0.07); }

.t-time  { color: #aaa; }
.t-price.buy  { color: #0f6e56; font-weight: 600; }
.t-price.sell { color: #993c1d; font-weight: 600; }
.t-qty, .t-fee { color: #888; text-align: right; }

/* ── Order form ── */
.seg {
  display: flex;
  border: 1px solid #e0e0dc;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
}

.seg-btn {
  flex: 1;
  padding: 7px 0;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #888;
  transition: background 0.15s, color 0.15s;
}
.seg-btn:focus-visible { outline: 2px solid #185fa5; outline-offset: -2px; }
.seg-btn.active-buy  { background: #eaf3de; color: #3b6d11; }
.seg-btn.active-sell { background: #faece7; color: #993c1d; }

.form-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }

.form-field label { font-size: 0.68rem; color: #aaa; }

.form-field input,
.form-field select {
  width: 100%;
  padding: 7px 10px;
  font-size: 0.82rem;
  border: 1px solid #e0e0dc;
  border-radius: 8px;
  background: #fff;
  color: #1a1a1a;
  transition: border-color 0.15s;
}

.form-field input:focus,
.form-field select:focus {
  outline: none;
  border-color: #185fa5;
  box-shadow: 0 0 0 3px rgba(24, 95, 165, 0.12);
}

/* ── Cost breakdown ── */
.cost-breakdown {
  border-top: 1px solid #f0f0ec;
  padding-top: 8px;
  margin-bottom: 12px;
}

.cost-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #888;
  padding: 3px 0;
}

.cost-row span:last-child { font-weight: 600; color: #1a1a1a; }

.cost-total {
  border-top: 1px solid #f0f0ec;
  margin-top: 4px;
  padding-top: 6px;
  font-weight: 600;
  color: #1a1a1a;
}

/* ── Submit button ── */
.ex-btn {
  width: 100%;
  padding: 9px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

.ex-btn:hover  { opacity: 0.85; }
.ex-btn:active { transform: scale(0.98); }
.ex-btn:focus-visible { outline: 2px solid #185fa5; outline-offset: 2px; }

.ex-btn.buy  { background: #eaf3de; color: #3b6d11; border-color: #c0dd97; }
.ex-btn.sell { background: #faece7; color: #993c1d; border-color: #f5c4b3; }

/* ── Wallet ── */
.wallet { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }

.wallet-item {
  background: #f7f7f5;
  border-radius: 8px;
  padding: 8px 10px;
}

.wallet-label { font-size: 0.68rem; color: #aaa; margin-bottom: 2px; }
.wallet-val   { font-size: 0.95rem; font-weight: 600; color: #1a1a1a; }
.wallet-sub   { font-size: 0.68rem; color: #aaa; }

.fee-ticker {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f7f7f5;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.72rem;
  color: #888;
}

.revenue-val { font-size: 0.9rem; font-weight: 600; color: #0f6e56; }

/* ── Toast ── */
.toast {
  position: absolute;
  top: -36px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid #e0e0dc;
  border-radius: 8px;
  padding: 5px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
  white-space: nowrap;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.toast.show { opacity: 1; }

/* ── Responsive ── */
@media (max-width: 820px) {
  .ex-body  { grid-template-columns: 1fr; }
  .ex-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .ex-stats  { grid-template-columns: 1fr 1fr; }
  .ex-header { flex-direction: column; align-items: flex-start; gap: 8px; }
}
