/* ==========================================================================
   All Tokens Market Overview — Page Styles
   Dark theme matching DeltaStrike (#09090b background)
   ========================================================================== */

/* ===== CSS Custom Properties ===== */
:root {
  --all-tokens-page-background: #09090b;
  --all-tokens-page-foreground: #fafafa;
  --all-tokens-muted-foreground: #a1a1aa;
  --all-tokens-border-color: #27272a;
  --all-tokens-border-color-subtle: #1c1c1e;
  --all-tokens-card-background: #09090b;
  --all-tokens-hover-background: rgba(255, 255, 255, 0.03);
  --all-tokens-positive-color: #22c55e;
  --all-tokens-negative-color: #ef4444;
  --all-tokens-positive-flash-color: rgba(34, 197, 94, 0.25);
  --all-tokens-negative-flash-color: rgba(239, 68, 68, 0.25);
  --all-tokens-input-background: #18181b;
  --all-tokens-input-border: #3f3f46;
  --all-tokens-input-focus-ring: rgba(59, 130, 246, 0.5);
  --all-tokens-radius: 0.375rem;
  --all-tokens-radius-large: 0.5rem;
  --all-tokens-connection-dot-connected: #22c55e;
  --all-tokens-connection-dot-disconnected: #ef4444;
  --all-tokens-connection-dot-connecting: #eab308;
  --all-tokens-tab-active-background: #3b82f6;
  --all-tokens-tab-inactive-background: #18181b;
  --all-tokens-tab-disabled-foreground: #52525b;
}

/* ===== Global Reset / Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--all-tokens-page-background);
  color: var(--all-tokens-page-foreground);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Page Container ===== */
.all-tokens-market-overview-page-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 72px 24px 48px; /* 72px top to clear fixed navbar (56px height + 16px gap) */
}

/* ===== Header Bar ===== */
.all-tokens-market-overview-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.all-tokens-market-overview-header-bar-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.all-tokens-market-overview-page-title {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--all-tokens-page-foreground);
}

.all-tokens-market-overview-subtitle-label {
  font-size: 0.8125rem;
  color: var(--all-tokens-muted-foreground);
}

.all-tokens-market-overview-header-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ===== Symbol Search Input ===== */
.all-tokens-market-overview-symbol-search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.all-tokens-market-overview-search-icon {
  position: absolute;
  left: 10px;
  width: 16px;
  height: 16px;
  color: var(--all-tokens-muted-foreground);
  pointer-events: none;
}

.all-tokens-market-overview-symbol-search-input {
  width: 260px;
  padding: 8px 12px 8px 34px;
  font-size: 0.8125rem;
  font-family: inherit;
  color: var(--all-tokens-page-foreground);
  background-color: var(--all-tokens-input-background);
  border: 1px solid var(--all-tokens-input-border);
  border-radius: var(--all-tokens-radius);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.all-tokens-market-overview-symbol-search-input::placeholder {
  color: var(--all-tokens-muted-foreground);
}

.all-tokens-market-overview-symbol-search-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px var(--all-tokens-input-focus-ring);
}

/* ===== Market Type Filter Tabs ===== */
.all-tokens-market-overview-market-type-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.all-tokens-market-overview-market-type-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  font-size: 0.8125rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--all-tokens-muted-foreground);
  background-color: var(--all-tokens-tab-inactive-background);
  border: 1px solid var(--all-tokens-border-color);
  border-radius: var(--all-tokens-radius);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.all-tokens-market-overview-market-type-tab:hover:not(:disabled) {
  color: var(--all-tokens-page-foreground);
  border-color: var(--all-tokens-input-border);
}

.all-tokens-market-overview-market-type-tab-active {
  color: #fff;
  background-color: var(--all-tokens-tab-active-background);
  border-color: var(--all-tokens-tab-active-background);
}

.all-tokens-market-overview-market-type-tab-active:hover {
  color: #fff;
}

.all-tokens-market-overview-market-type-tab-disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.all-tokens-market-overview-coming-soon-badge {
  display: inline-block;
  padding: 1px 6px;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--all-tokens-tab-disabled-foreground);
  background-color: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
}

/* ===== Quote Asset Filter Tabs ===== */
.all-tokens-market-overview-quote-asset-filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--all-tokens-border-color) transparent;
  padding-bottom: 2px; /* prevent scrollbar from overlapping content */
}

.all-tokens-market-overview-quote-asset-filter-bar::-webkit-scrollbar {
  height: 4px;
}

.all-tokens-market-overview-quote-asset-filter-bar::-webkit-scrollbar-track {
  background: transparent;
}

.all-tokens-market-overview-quote-asset-filter-bar::-webkit-scrollbar-thumb {
  background-color: var(--all-tokens-border-color);
  border-radius: 2px;
}

.all-tokens-market-overview-quote-asset-tab {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--all-tokens-muted-foreground);
  background-color: var(--all-tokens-tab-inactive-background);
  border: 1px solid var(--all-tokens-border-color);
  border-radius: var(--all-tokens-radius);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.all-tokens-market-overview-quote-asset-tab:hover {
  color: var(--all-tokens-page-foreground);
  border-color: var(--all-tokens-input-border);
}

.all-tokens-market-overview-quote-asset-tab-active {
  color: #fff;
  background-color: var(--all-tokens-tab-active-background);
  border-color: var(--all-tokens-tab-active-background);
}

.all-tokens-market-overview-quote-asset-tab-active:hover {
  color: #fff;
}

.all-tokens-market-overview-quote-asset-tab-symbol-count-badge {
  display: inline-block;
  margin-left: 5px;
  padding: 0 5px;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--all-tokens-muted-foreground);
  background-color: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  line-height: 1.5;
}

.all-tokens-market-overview-quote-asset-tab-active .all-tokens-market-overview-quote-asset-tab-symbol-count-badge {
  color: rgba(255, 255, 255, 0.7);
  background-color: rgba(255, 255, 255, 0.15);
}

/* ===== Stats Bar ===== */
.all-tokens-market-overview-stats-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  margin-bottom: 8px;
  font-size: 0.75rem;
  color: var(--all-tokens-muted-foreground);
}

.all-tokens-market-overview-connection-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.all-tokens-market-overview-connection-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--all-tokens-connection-dot-connecting);
  transition: background-color 0.3s ease;
}

.all-tokens-market-overview-connection-status-dot-connected {
  background-color: var(--all-tokens-connection-dot-connected);
}

.all-tokens-market-overview-connection-status-dot-disconnected {
  background-color: var(--all-tokens-connection-dot-disconnected);
}

.all-tokens-market-overview-stats-separator {
  color: #3f3f46;
}

/* ===== Table Scroll Container ===== */
.all-tokens-market-overview-table-scroll-container {
  position: relative;
  overflow-x: auto;
  border: 1px solid var(--all-tokens-border-color);
  border-radius: var(--all-tokens-radius-large);
  background-color: var(--all-tokens-card-background);
  min-height: 400px;
}

/* ===== Initial Loading Overlay ===== */
.all-tokens-market-overview-initial-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background-color: var(--all-tokens-card-background);
  z-index: 3;
  color: var(--all-tokens-muted-foreground);
  font-size: 0.8125rem;
  transition: opacity 0.4s ease;
  min-height: 200px;
}

.all-tokens-market-overview-initial-loading-overlay-hidden {
  opacity: 0;
  pointer-events: none;
}

.all-tokens-market-overview-initial-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--all-tokens-border-color);
  border-top-color: var(--all-tokens-page-foreground);
  border-radius: 50%;
  animation: all-tokens-market-overview-loading-spinner-rotation 0.8s linear infinite;
}

@keyframes all-tokens-market-overview-loading-spinner-rotation {
  to {
    transform: rotate(360deg);
  }
}

/* ===== Table ===== */
.all-tokens-market-overview-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 1180px; /* Force horizontal scroll on narrow screens — wider for 9 columns with funding rate */
}

/* ===== Table Header ===== */
.all-tokens-market-overview-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: var(--all-tokens-card-background);
}

.all-tokens-market-overview-table-header-cell {
  padding: 10px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--all-tokens-muted-foreground);
  text-align: left;
  border-bottom: 1px solid var(--all-tokens-border-color);
  white-space: nowrap;
  user-select: none;
}

.all-tokens-market-overview-table-header-cell-numeric {
  text-align: right;
}

.all-tokens-market-overview-table-header-cell-sortable {
  cursor: pointer;
  transition: color 0.15s ease;
}

.all-tokens-market-overview-table-header-cell-sortable:hover {
  color: var(--all-tokens-page-foreground);
}

.all-tokens-market-overview-table-header-cell-sorted-ascending,
.all-tokens-market-overview-table-header-cell-sorted-descending {
  color: var(--all-tokens-page-foreground);
}

.all-tokens-market-overview-sort-direction-arrow {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.7rem;
  opacity: 0.5;
}

.all-tokens-market-overview-table-header-cell-sorted-ascending .all-tokens-market-overview-sort-direction-arrow,
.all-tokens-market-overview-table-header-cell-sorted-descending .all-tokens-market-overview-sort-direction-arrow {
  opacity: 1;
}

/* Column widths — 9 columns (with funding rate) */
.all-tokens-market-overview-table-header-cell:nth-child(1) { width: 10%; }  /* Symbol */
.all-tokens-market-overview-table-header-cell:nth-child(2) { width: 10%; }  /* Last Price */
.all-tokens-market-overview-table-header-cell:nth-child(3) { width: 11%; }  /* 24h Change % */
.all-tokens-market-overview-table-header-cell:nth-child(4) { width: 10%; }  /* Funding Rate */
.all-tokens-market-overview-table-header-cell:nth-child(5) { width: 10%; }  /* Last Qty (coin) */
.all-tokens-market-overview-table-header-cell:nth-child(6) { width: 10%; }  /* 24h Qty (coin) */
.all-tokens-market-overview-table-header-cell:nth-child(7) { width: 13%; }  /* 24h Volume (USDT) */
.all-tokens-market-overview-table-header-cell:nth-child(8) { width: 9%; }   /* 24h Trades */
.all-tokens-market-overview-table-header-cell:nth-child(9) { width: 17%; }  /* 24h High / Low */

/* ===== Column Header Tooltip ===== */
.all-tokens-market-overview-table-header-cell-with-tooltip {
  position: relative;
}

.all-tokens-market-overview-column-header-tooltip {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  width: 280px;
  padding: 8px 12px;
  margin-top: 4px;
  font-size: 0.6875rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  line-height: 1.5;
  color: var(--all-tokens-page-foreground);
  background-color: #27272a;
  border: 1px solid var(--all-tokens-input-border);
  border-radius: var(--all-tokens-radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  white-space: normal;
  pointer-events: none;
}

.all-tokens-market-overview-table-header-cell-with-tooltip:hover .all-tokens-market-overview-column-header-tooltip {
  display: block;
}

/* ===== Table Body Rows ===== */
.all-tokens-market-overview-table tbody tr {
  border-bottom: 1px solid var(--all-tokens-border-color-subtle);
  transition: background-color 0.1s ease;
}

.all-tokens-market-overview-table tbody tr:hover {
  background-color: var(--all-tokens-hover-background);
}

.all-tokens-market-overview-table tbody tr:last-child {
  border-bottom: none;
}

/* ===== Table Cells ===== */
.all-tokens-market-overview-table-data-cell {
  padding: 8px 14px;
  font-size: 0.8125rem;
  color: var(--all-tokens-page-foreground);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.all-tokens-market-overview-table-data-cell-numeric {
  text-align: right;
  font-family: 'Roboto Mono', 'SF Mono', 'Fira Code', monospace;
  font-size: 0.78125rem;
}

.all-tokens-market-overview-table-data-cell-symbol {
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ===== High / Low Combined Cell ===== */
.all-tokens-market-overview-table-data-cell-high-low-combined {
  font-size: 0.71875rem;
}

.all-tokens-market-overview-high-low-high-value {
  color: var(--all-tokens-positive-color);
}

.all-tokens-market-overview-high-low-low-value {
  color: var(--all-tokens-negative-color);
}

.all-tokens-market-overview-high-low-separator {
  color: var(--all-tokens-muted-foreground);
  opacity: 0.5;
}

/* ===== Price Change Color Coding ===== */
.all-tokens-market-overview-price-change-positive {
  color: var(--all-tokens-positive-color);
}

.all-tokens-market-overview-price-change-negative {
  color: var(--all-tokens-negative-color);
}

.all-tokens-market-overview-price-change-neutral {
  color: var(--all-tokens-muted-foreground);
}

/* ===== Funding Rate Color Coding =====
   Convention: positive funding rate = longs pay shorts = bearish pressure = RED
               negative funding rate = shorts pay longs = bullish pressure = GREEN
   This is intentionally REVERSED from price-change coloring. ===== */
.all-tokens-market-overview-funding-rate-positive {
  color: var(--all-tokens-negative-color); /* positive rate is red: cost to longs */
}

.all-tokens-market-overview-funding-rate-negative {
  color: var(--all-tokens-positive-color); /* negative rate is green: cost to shorts */
}

.all-tokens-market-overview-funding-rate-not-available {
  color: var(--all-tokens-muted-foreground);
  opacity: 0.5;
}

/* ===== Funding Rate Next-Event Countdown ===== */
.all-tokens-market-overview-funding-rate-next-event-countdown {
  display: block;
  font-size: 0.625rem;
  color: var(--all-tokens-muted-foreground);
  opacity: 0.7;
  margin-top: 1px;
  font-family: 'Roboto Mono', 'SF Mono', 'Fira Code', monospace;
  white-space: nowrap;
}

/* ===== Price Flash Animation ===== */
.all-tokens-market-overview-price-flash-up {
  will-change: background-color;
  animation: all-tokens-flash-green 0.6s ease-out;
}

.all-tokens-market-overview-price-flash-down {
  will-change: background-color;
  animation: all-tokens-flash-red 0.6s ease-out;
}

@keyframes all-tokens-flash-green {
  0% {
    background-color: var(--all-tokens-positive-flash-color);
  }
  100% {
    background-color: transparent;
  }
}

@keyframes all-tokens-flash-red {
  0% {
    background-color: var(--all-tokens-negative-flash-color);
  }
  100% {
    background-color: transparent;
  }
}

/* ===== Empty State ===== */
.all-tokens-market-overview-empty-state-message {
  padding: 48px 24px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--all-tokens-muted-foreground);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .all-tokens-market-overview-page-container {
    padding: 68px 12px 32px;
  }

  .all-tokens-market-overview-header-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .all-tokens-market-overview-header-bar-right {
    width: 100%;
  }

  .all-tokens-market-overview-symbol-search-input {
    width: 100%;
  }

  .all-tokens-market-overview-stats-bar {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .all-tokens-market-overview-page-title {
    font-size: 1.125rem;
  }

  .all-tokens-market-overview-table-data-cell {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  .all-tokens-market-overview-table-data-cell-numeric {
    font-size: 0.71875rem;
  }

  .all-tokens-market-overview-table-header-cell {
    padding: 8px 10px;
    font-size: 0.6875rem;
  }
}
