@import url('../../assets/css/neo-coins-design-system.css');

/* Block wrapper: inherit full size and width of parent container */
.wp-block-neo-coins-trending-list {
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
}

/* Baseline: no space between items when itemSpacing is 0 (same as New Listed) */
.wp-block-neo-coins-trending-list .neo-trending-list-item {
  margin-bottom: 0;
}

/* Trending List: most voted last week, highest to lowest. Logo (with chain) | name + symbol | votes right */
.neo-trending-list-wrapper.neo-trending-list-vertical {
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  background-color: var(--neo-trending-bg, #ffffff);
  color: var(--neo-trending-text, #111827);
  border-radius: 12px;
  border: 1px solid var(--neo-list-border-color, #e5e7eb);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.neo-trending-list-wrapper.neo-trending-list-vertical .neo-trending-list-container {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0;
  width: 100%;
  max-width: 100%;
  flex: 1;
  min-height: 0;
  transition: opacity 0.25s ease;
}

.neo-trending-list-item {
  display: grid;
  grid-template-columns: var(--neo-trending-logo, 40px) 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: none;
  position: relative;
  transition: background-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

/* Edge-shaded separator (fades at left/right) */
.neo-trending-list-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--neo-list-separator-color, #e5e7eb) 15%,
    var(--neo-list-separator-color, #e5e7eb) 85%,
    transparent
  );
  pointer-events: none;
}

.neo-trending-list-item:hover {
  background-color: var(--neo-hover-bg, var(--neo-trending-hover, rgba(255, 243, 224, 0.6)));
  transform: scale(var(--neo-hover-scale, 1.005));
}
.neo-trending-list-item:hover .neo-trending-list-name,
.neo-trending-list-item:hover .neo-trending-list-symbol,
.neo-trending-list-item:hover .neo-trending-list-votes-num {
  color: var(--neo-hover-text, var(--neo-trending-accent, #ff6b35));
}

/* Logo with chain in corner */
.neo-trending-list-logo-wrap {
  position: relative;
  flex-shrink: 0;
  width: var(--neo-trending-logo, 40px);
  height: var(--neo-trending-logo, 40px);
}

.neo-trending-list-logo {
  width: 100%;
  height: 100%;
  border-radius: var(--neo-trending-icon-radius, 50%);
  overflow: hidden;
  background-color: var(--neo-token-logo-bg, #f3f4f6);
}

.neo-trending-list-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.neo-trending-list-logo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--neo-trending-logo, 40px) * 0.45);
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  background: linear-gradient(135deg, #e5e7eb, #f3f4f6);
}

.neo-trending-list-chain {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: var(--neo-chain-size, calc(var(--neo-trending-logo, 40px) * 0.45));
  height: var(--neo-chain-size, calc(var(--neo-trending-logo, 40px) * 0.45));
  border-radius: var(--neo-chain-radius, 50%);
  overflow: hidden;
  border: 2px solid var(--neo-trending-chain-color, var(--neo-trending-bg, #fff));
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--neo-chain-bg, #fff);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.neo-trending-list-chain img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.neo-trending-list-chain span {
  font-size: 50%;
  line-height: 1;
  color: #f59e0b;
}

.neo-trending-list-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.neo-trending-list-name {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--neo-trending-text, #111827);
}

.neo-trending-list-symbol {
  font-size: 12px;
  color: var(--neo-trending-text, #111827);
  opacity: 0.85;
  margin: 0;
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* Vote count on the right (one line: e.g. "3 votes") */
.neo-trending-list-votes {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  color: var(--neo-trending-votes, #6b7280);
  font-size: 13px;
  font-weight: 600;
}

.neo-trending-list-votes-num {
  line-height: 1.2;
}

.neo-trending-list-votes-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.85;
}

.neo-trending-list-link {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  text-decoration: none;
  z-index: 1;
}

@media (max-width: 768px) {
  .neo-trending-list-item {
    gap: 10px;
    padding: 12px;
  }

  .neo-trending-list-name {
    font-size: 13px;
  }

  .neo-trending-list-symbol {
    font-size: 11px;
  }

  .neo-trending-list-votes {
    font-size: 12px;
  }

  .neo-trending-list-votes-label {
    font-size: 9px;
  }
}

@media (max-width: 480px) {
  .neo-trending-list-item {
    grid-template-columns: var(--neo-trending-logo, 40px) 1fr auto;
    gap: 8px;
    padding: 10px 12px;
  }

  .neo-trending-list-name {
    font-size: 12px;
  }

  .neo-trending-list-symbol {
    font-size: 11px;
  }
}

/* Pagination dots (same as presale live, max 5 pages) */
.neo-list-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  flex-wrap: wrap;
}

/* Hide pagination dots during preload phase */
.neo-list-with-pagination.neo-preload-items .neo-list-pagination {
  visibility: hidden;
}

.neo-list-pagination .neo-list-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: var(--neo-list-pagination-inactive, rgba(0, 0, 0, 0.2));
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
}

.neo-list-pagination .neo-list-dot:hover {
  background: var(--neo-list-pagination-hover, rgba(0, 0, 0, 0.35));
}

.neo-list-pagination .neo-list-dot.active {
  background: var(--neo-list-pagination-color, var(--neo-trending-accent, #ff6b35));
  transform: scale(1.2);
}

/* When New Listed and Trending List share a row (e.g. core/columns), equal width and stretched height */
.wp-block-columns:has(.wp-block-neo-coins-new-listed):has(.wp-block-neo-coins-trending-list) {
  align-items: stretch;
}
.wp-block-columns:has(.wp-block-neo-coins-new-listed):has(.wp-block-neo-coins-trending-list) .wp-block-column {
  flex: 1 1 0%;
  min-width: 0;
}
.wp-block-columns:has(.wp-block-neo-coins-new-listed):has(.wp-block-neo-coins-trending-list) .wp-block-column > .wp-block-neo-coins-new-listed,
.wp-block-columns:has(.wp-block-neo-coins-new-listed):has(.wp-block-neo-coins-trending-list) .wp-block-column > .wp-block-neo-coins-trending-list {
  height: 100%;
  min-height: 0;
}
