/* One-page vertical layout: Historical (top) -> Live + Spot -> Arbitrage */

.page {
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  box-sizing: border-box;
  /* Prevent horizontal page scroll when the browser is zoomed in: the
     effective viewport drops below 1500px and any wide child (table, modal
     header) would otherwise push the page off-screen to the left. */
  overflow-x: clip;
  min-width: 0;
}

html, body {
  overflow-x: clip;
}

.arb-muted-empty{
  padding: 8px 10px;
}

.arb-muted-empty.arb-muted-empty-compact{
  padding: 6px 2px;
}

.arb-empty-cell{
  text-align: center;
  padding: 14px 12px;
}

.arb-empty-cell.arb-empty-cell-tree{
  padding: 10px 12px;
}

.arb-empty-cell.arb-empty-cell-roomy{
  padding: 18px 14px;
}

/* Reuse .card from main.css but keep spacing tighter */
.card {
  margin-bottom: 0;
}

/* Remove the extra outer frames around non-table blocks.
   IMPORTANT: our main tables (Historical / Live / Spot / Arbitrage) use
   .arb-card and should keep the normal card background, otherwise elements
   like pagination render on the raw body background (looks "black"). */
.page > .card:not(.arb-card){
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

/* Hide section titles/subtitles above tool blocks */
.page .section-head{
  display: none;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-title-main {
  font-weight: 900;
  font-size: 16px;
}

.section-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

/* Exchange label with icon */
.ex-with-icon{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  line-height: 1;
}

.ex-icon{
  width: clamp(11px, 1.1vw, 14px);
  height: clamp(11px, 1.1vw, 14px);
  border-radius: 6px;
  object-fit: contain;
  /* No "frames" around icons */
  background: transparent;
  border: none;
}

.ex-icon.is-sm{ width: clamp(10px, 1vw, 12px); height: clamp(10px, 1vw, 12px); border-radius: 5px; }
.ex-icon.is-md{ width: clamp(12px, 1.2vw, 16px); height: clamp(12px, 1.2vw, 16px); border-radius: 7px; }
.ex-icon.is-lg{ width: clamp(15px, 1.5vw, 19px); height: clamp(15px, 1.5vw, 19px); border-radius: 8px; }

/* Exchange pills (used by Live + Historical tables) */
.ex-pill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 3px 10px;
  /* Match arbitrage pills (less rounded ends) */
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.02);
  white-space: nowrap;
  line-height: 1;
  font-size: clamp(8px, 0.85vw, 10px);
}

.ex-pill-gold{
  background: rgba(251,191,36,0.10);
  /* Requested: exchange name should be white, while capsule stays gold */
  color: rgba(255,255,255,0.92);
  border-color: rgba(251,191,36,0.24);
}

/* Full-width exchange capsules for Live + Historical tables */
#liveTable td.lt-ex .ex-pill,
#histTable td.ht-ex .ex-pill{
  display: flex;
  width: 100%;
  box-sizing: border-box;
  justify-content: flex-start;
}

/* Coin label text (coin icons disabled; exchange icons stay enabled) */
.coin-with-icon{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
  white-space: nowrap;
}

.coin-desc-coinwrap{
  min-width: 0;
}

.coin-desc-coinwrap .coin-txt{
  color: #f2e3c2;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.coin-desc-coin-btn{
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 999px;
  flex: 0 0 auto;
}

.coin-desc-coin-btn:hover .coin-ico-wrap{
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.18);
}

.coin-desc-coin-btn:focus-visible{
  outline: 2px solid rgba(90,200,250,0.55);
  outline-offset: 2px;
}

.coin-ico-wrap{
  position: relative;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
}

/* ------------------------------------------------------------------
   Small "blur flash" when live values change (requested 0.5s effect)
   Used by Arbitrage + Live tables.
-------------------------------------------------------------------*/

@keyframes ui-blur-flash {
  0% { filter: blur(2px); opacity: 0.65; }
  100% { filter: blur(0px); opacity: 1; }
}

.ui-blur-flash{
  animation: ui-blur-flash 0.5s ease-out;
  will-change: filter, opacity;
}

.coin-ico-wrap.is-md{ width: 18px; height: 18px; }

/* Bigger coin icons inside the 3 main tables */
.coin-ico-wrap.is-lg{ width: 22px; height: 22px; }

/* Requested: 50% larger than the previous 22px table icon size */
.coin-ico-wrap.is-xl{ width: 33px; height: 33px; }

.coin-icon{
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
  background: transparent;
  border: none;
}

.coin-ico-wrap,
.coin-icon{
  display: none !important;
}

.coin-icon.is-md{ width: 18px; height: 18px; }

.coin-icon.is-lg{ width: 22px; height: 22px; }

.coin-icon.is-xl{ width: 33px; height: 33px; }

.coin-ico-fallback{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: rgba(255,255,255,0.86);
}

.coin-ico-wrap.is-lg .coin-ico-fallback{ font-size: 10px; }

.coin-ico-wrap.is-xl .coin-ico-fallback{ font-size: 13px; }


/* Clock icon + countdown text (Arbitrage + Live tables) */
.time-with-icon{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.time-ico{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  color: rgba(255,255,255,0.70);
}

.time-ico svg{
  width: 14px;
  height: 14px;
  display: block;
}

.time-txt{
  font-variant-numeric: tabular-nums;
}

.th-with-ico{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.th-with-ico .time-ico svg{
  width: 13px;
  height: 13px;
}

.coin-txt{
  font-weight: inherit;
  /* Slight birch tint for coin names */
  color: rgba(200, 255, 230, 0.92);
}


/* Select with an exchange icon */
.select-with-icon{
  position: relative;
  width: 100%;
}

.select-with-icon > img.ex-icon{
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  margin: 0;
  z-index: 2;
}

.select-with-icon > select{
  padding-left: 36px;
}

/* Custom exchange dropdown (icons in list) */
.select-with-icon.is-custom-select > .ex-select-trigger{
  width: 100%;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel-3);
  color: var(--text);
  box-sizing: border-box;
  font-size: 14px;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.select-with-icon.is-custom-select > .ex-select-trigger:focus{
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
}

.ex-select-trigger-main{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.ex-select-trigger-icon{
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

.ex-select-trigger.is-no-icon .ex-select-trigger-icon{
  display: none;
}

.ex-select-label{
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ex-select-chevron{
  opacity: 0.75;
  flex: 0 0 auto;
}

.ex-select-menu{
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px;
  z-index: 50;
  max-height: 260px;
  overflow: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.55);
}

.ex-select-menu.is-split{
  padding: 8px;
}

.ex-select-top{
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.ex-select-split{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}

.ex-select-col{
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.ex-select-col-title{
  padding: 2px 4px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.6px;
  color: var(--muted);
  text-transform: uppercase;
}

.ex-select-item{
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.ex-select-item:hover{
  background: rgba(255,255,255,0.04);
}

.ex-select-item[data-selected="1"]{
  background: rgba(240,185,11,0.10);
}

.ex-select-item:disabled{
  opacity: 0.4;
  cursor: not-allowed;
}

.ex-select-item-text{
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 520px){
  .ex-select-split{
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .page { padding: 10px; }
}

.is-ui-locked{
  pointer-events: none !important;
  user-select: none;
}

.table-wrap.is-table-interaction-locked{
  pointer-events: none;
}
