/* Trading floor styles — extends theme.css */

/* ── Nav tabs ── */
.nav-tab {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 4px 12px;
  border-radius: 8px;
  transition: all 0.15s;
}
.nav-tab:hover { color: var(--fg); }
.nav-tab.active {
  color: var(--accent);
  background: var(--accent-dim);
}

/* ── Top bar ── */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 48px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}

.balance-display {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.balance-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--fg-muted);
}
.balance-amount {
  font-family: 'Sora', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
}

/* Portfolio stats */
.portfolio-stats {
  display: flex;
  gap: 16px;
}
.stat-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 20px;
  min-width: 140px;
}
.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--fg-muted);
}
.stat-value {
  font-family: 'Sora', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--fg);
}

/* ── Page layout ── */
.page-container {
  padding: 32px 48px;
  max-width: 1200px;
}

/* ── Market section ── */
.market-section {
  margin-bottom: 40px;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}
.section-title {
  font-family: 'Sora', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--fg);
}
.section-count {
  font-size: 12px;
  color: var(--fg-muted);
}

/* ── Market table ── */
.market-table {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.market-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr 80px;
  gap: 0;
  padding: 14px 20px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.market-row:last-child { border-bottom: none; }
.market-row:hover { background: rgba(255,255,255,0.02); }

.market-row-head {
  background: var(--bg-2);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--fg-muted);
  font-weight: 600;
  padding: 10px 20px;
}

/* Row content */
.row-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.player-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--fg);
}
.player-team {
  font-size: 12px;
  color: var(--fg-muted);
}

.row-price {
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--fg);
}

.row-change { font-size: 13px; font-weight: 600; }
.row-change.green { color: var(--green); }
.row-change.red { color: var(--red); }
.row-change.muted { color: var(--fg-muted); }

.row-target {
  font-size: 12px;
  color: var(--fg-muted);
}

.row-qty {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}
.row-value {
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}
.row-pnl { font-size: 13px; font-weight: 600; }
.row-pnl.green { color: var(--green); }
.row-pnl.red { color: var(--red); }

/* ── Trade buttons ── */
.trade-btns {
  display: flex;
  gap: 6px;
}
.trade-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}
.buy-btn {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green);
}
.buy-btn:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.3);
  transform: scale(1.05);
}
.buy-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.sell-btn {
  background: rgba(240, 69, 58, 0.15);
  color: var(--red);
}
.sell-btn:hover {
  background: rgba(240, 69, 58, 0.3);
  transform: scale(1.05);
}

/* ── Modal ── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal.hidden { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-box {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  width: 380px;
  max-width: 90vw;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-header h3 {
  font-family: 'Sora', sans-serif;
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--fg-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.modal-close:hover { background: var(--bg-2); color: var(--fg); }

.modal-asset {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--fg-muted);
}
.modal-price {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  color: var(--fg);
  font-size: 18px;
}

.qty-row {
  margin-bottom: 16px;
}
.qty-row label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--fg-muted);
  margin-bottom: 8px;
}
.qty-controls {
  display: flex;
  align-items: center;
  gap: 0;
  width: fit-content;
}
.qty-btn {
  width: 40px;
  height: 40px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--fg);
  font-size: 18px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.1s;
}
.qty-btn:hover { background: var(--border); }
.qty-btn:first-child { border-radius: 8px 0 0 8px; }
.qty-btn:last-child { border-radius: 0 8px 8px 0; }
#qty-input, #sell-qty-input {
  width: 70px;
  height: 40px;
  text-align: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: none;
  border-right: none;
  color: var(--fg);
  font-family: 'Sora', sans-serif;
  font-size: 16px;
  font-weight: 600;
  outline: none;
}
#qty-input:focus, #sell-qty-input:focus { border-color: var(--accent); }

.total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--fg-muted);
}
.total-amount {
  font-family: 'Sora', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--fg);
}

/* ── Buttons ── */
.btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  font-family: 'Sora', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-buy {
  background: var(--green);
  color: #000;
}
.btn-buy:hover:not(:disabled) {
  background: #0fd989;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}
.btn-buy:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-sell {
  background: var(--red);
  color: #fff;
}
.btn-sell:hover:not(:disabled) {
  background: #f25550;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(240, 69, 58, 0.3);
}
.btn-sell:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Error ── */
.modal-error {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(240, 69, 58, 0.1);
  border: 1px solid rgba(240, 69, 58, 0.3);
  border-radius: 8px;
  font-size: 13px;
  color: var(--red);
  text-align: center;
}

/* ── Empty state ── */
.empty-state {
  padding: 32px 20px;
  text-align: center;
  color: var(--fg-muted);
  font-size: 14px;
}

/* ── Transaction rows ── */
#tx-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tx-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
}
.tx-side {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 4px;
}
.buy-tag { background: rgba(16,185,129,0.15); color: var(--green); }
.sell-tag { background: rgba(240,69,58,0.15); color: var(--red); }
.tx-name { flex: 1; font-size: 14px; font-weight: 500; color: var(--fg); }
.tx-qty { font-size: 13px; color: var(--fg-muted); }
.tx-price { font-size: 13px; color: var(--fg-muted); }
.tx-total { font-family: 'Sora', sans-serif; font-size: 14px; font-weight: 600; }
.tx-date { font-size: 12px; color: var(--fg-muted); }

/* Stat color helpers */
.stat-value.green { color: var(--green); }
.stat-value.red { color: var(--red); }

/* Holding row hover */
.holding-row:hover { background: rgba(255,255,255,0.02); }