/* Markets page — WEEX-style */

.mk-page {
  padding: 80px 0 72px;
  background: var(--bg-dark);
  min-height: calc(100vh - 64px);
}

/* Top page nav: Markets | Insights | Bubbles */
.mk-page-nav {
  display: flex;
  gap: 28px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0;
}

.mk-page-nav-link {
  color: var(--light-text);
  font-size: 16px;
  font-weight: 600;
  position: relative;
  padding: 0 0 14px;
  margin-bottom: -1px;
  background: none;
  border: none;
}

.mk-page-nav-link.active {
  color: var(--dark-text);
}

.mk-page-nav-link.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--primary-brown);
}

.mk-page-nav-link--muted {
  opacity: 0.45;
  cursor: default;
}

/* Snapshot cards */
.mk-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.mk-snapshot-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px 20px;
}

.mk-snapshot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.mk-snapshot-head h2 {
  font-size: 16px;
  font-weight: 700;
}

.mk-snapshot-more {
  color: var(--light-text);
  text-decoration: none;
  font-size: 13px;
}

.mk-snapshot-more:hover {
  color: var(--dark-text);
}

.mk-snapshot-list {
  display: flex;
  flex-direction: column;
}

.mk-snapshot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mk-snapshot-row:last-child {
  border-bottom: none;
}

.mk-snapshot-row:hover {
  opacity: 0.85;
}

.mk-snapshot-pair {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mk-snapshot-symbol {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}

.mk-snapshot-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.mk-snapshot-price {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark-text);
}

.mk-snapshot-meta .wx-market-change {
  font-size: 13px;
}

/* Main panel */
.mk-main-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
}

.mk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 20px 0;
}

.mk-type-tabs {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 14px;
  flex: 1;
  min-width: 0;
}

.mk-type-tab {
  background: none;
  border: none;
  color: var(--light-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 0 14px;
  margin-bottom: -15px;
  position: relative;
  white-space: nowrap;
}

.mk-type-tab.active {
  color: var(--dark-text);
}

.mk-type-tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--primary-brown);
}

.mk-search-wrap {
  position: relative;
  width: 220px;
  flex-shrink: 0;
  margin-bottom: 14px;
}

.mk-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--light-text);
  pointer-events: none;
}

.mk-search {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--pill-radius);
  color: var(--dark-text);
  font-size: 13px;
  padding: 9px 14px 9px 38px;
  outline: none;
}

.mk-search::placeholder {
  color: var(--light-text);
}

.mk-search:focus {
  border-color: rgba(245, 197, 24, 0.35);
}

/* Category pills */
.mk-category-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
}

.mk-category-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--light-text);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--pill-radius);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.mk-category-tab:hover {
  color: var(--dark-text);
}

.mk-category-tab.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--dark-text);
}

/* Table */
.mk-table-wrap {
  overflow-x: auto;
  padding: 0 20px;
}

.mk-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

.mk-table thead th {
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: var(--light-text);
  padding: 14px 10px 12px 0;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.mk-table thead th:last-child {
  width: 88px;
  text-align: right;
  padding-right: 0;
}

.mk-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.12s;
}

.mk-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.mk-table tbody td {
  padding: 16px 10px 16px 0;
  vertical-align: middle;
  font-size: 14px;
}

.mk-table tbody td:last-child {
  padding-right: 0;
}

.mk-table-pair {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.mk-table-pair-info {
  min-width: 0;
}

.mk-table-pair-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mk-table-pair-line strong {
  font-size: 14px;
  font-weight: 600;
}

.mk-price-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mk-price-main {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark-text);
}

.mk-price-sub {
  font-size: 12px;
  color: var(--light-text);
}

.mk-table-muted {
  color: var(--dark-text);
  font-size: 14px;
}

.mk-table-action {
  text-align: right;
}

.mk-trade-btn {
  display: inline-block;
  padding: 8px 20px;
  border-radius: var(--pill-radius);
  background: #ffffff;
  border: none;
  color: #111111;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.mk-trade-btn:hover {
  opacity: 0.88;
}

.mk-table-empty {
  padding: 48px 0;
  text-align: center;
}

/* Pagination */
.mk-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 20px;
  border-top: 1px solid var(--border-color);
}

.mk-page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--light-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mk-page-btn:hover:not(:disabled):not(.active) {
  background: rgba(255, 255, 255, 0.06);
  color: var(--dark-text);
}

.mk-page-btn.active {
  background: var(--btn-solid-bg, #fff);
  border-color: var(--btn-solid-bg, #fff);
  color: var(--btn-solid-text, #111);
}

.mk-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

@media (max-width: 1024px) {
  .mk-snapshot-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .mk-page {
    padding: 72px 0 48px;
  }

  .mk-toolbar {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px 0;
  }

  .mk-search-wrap {
    width: 100%;
    margin-bottom: 0;
  }

  .mk-type-tabs {
    gap: 14px;
    padding-bottom: 12px;
  }

  .mk-category-tabs {
    padding: 12px 16px;
  }

  .mk-table-wrap {
    padding: 0 16px;
  }

  .mk-table thead th:nth-child(4),
  .mk-table thead th:nth-child(5),
  .mk-table tbody td:nth-child(4),
  .mk-table tbody td:nth-child(5) {
    display: none;
  }

  .mk-pagination {
    padding: 16px;
  }
}
