/* ── Highlights Component ────────────────────────────────────────────────── */
.highlights-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 12px;
}

.highlights-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.4px;
}

.highlights-title small {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 3px;
  letter-spacing: 0;
}

/* Toggle switch */
.highlights-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  transition: color .2s;
}

.highlights-toggle:hover { color: var(--text); }

.toggle-switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: var(--border2);
  border: 1px solid var(--border2);
  transition: background .25s, border-color .25s;
  cursor: pointer;
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), background .25s;
}

.toggle-switch input:checked ~ .toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-switch input:checked ~ .toggle-track .toggle-thumb {
  transform: translateX(18px);
  background: #fff;
}

/* Check icon inside thumb when ON */
.toggle-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpolyline points='2,6 5,9 10,3' fill='none' stroke='%235b6ef5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/8px no-repeat;
  opacity: 0;
  transition: opacity .2s;
}

.toggle-switch input:checked ~ .toggle-track .toggle-thumb::after {
  opacity: 1;
}

/* Highlights Grid */
.highlights-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 12px;
  margin-bottom: 24px;
  overflow: hidden;
  transition: max-height .4s cubic-bezier(.4,0,.2,1), opacity .35s ease, margin .35s ease;
  max-height: 1200px;
  opacity: 1;
  align-items: stretch;
}

.highlights-grid.hidden {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
  pointer-events: none;
}

/* Market cap card (left) */
.hl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color .2s;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  min-height: 0;
  flex: 1;        /* each card takes equal share of left col height */
}

.hl-card:hover { border-color: var(--border2); }

/* Text side */
.hl-card-text {
  flex: 1;
  min-width: 0;
}

.hl-card-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 6px;
}

.hl-card-value {
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hl-card-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
}

.hl-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}

.hl-badge.up   { color: var(--green); background: rgba(0,212,170,.12); }
.hl-badge.down { color: var(--red);   background: rgba(255,77,109,.12); }

/* Sparkline — right side of card */
.hl-sparkline {
  flex-shrink: 0;
  width: 100px;
  height: 36px;
  display: flex;
  align-items: center;
}

.hl-sparkline svg {
  display: block;
  width: 100px;
  height: 36px;
}

/* Trending / Top Gainers panels */
.hl-list-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: border-color .2s;
}

.hl-list-card:hover { border-color: var(--border2); }

.hl-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.hl-list-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.hl-list-more {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
  text-decoration: none;
  transition: color .2s;
  cursor: default;
}

.hl-list-more:hover { color: var(--accent); }

.hl-coin-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
  cursor: pointer;
  border-radius: 6px;
  padding-left: 4px;
  padding-right: 4px;
}

.hl-coin-row:last-child { border-bottom: none; }
.hl-coin-row:hover { background: rgba(91,110,245,.06); }

.hl-coin-img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.hl-coin-img-placeholder {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.hl-coin-name {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hl-coin-price {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

.hl-coin-pct {
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 700;
  min-width: 52px;
  text-align: right;
  white-space: nowrap;
}

.hl-coin-pct.up   { color: var(--green); }
.hl-coin-pct.down { color: var(--red); }

/* Loading skeleton */
.hl-skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--border2) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Right panel: 2 smaller cards stacked */
.hl-right-col {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
}

/* Responsive */
@media (max-width: 1100px) {
  .highlights-grid {
    grid-template-columns: 1fr 1fr;
  }
  .hl-right-col {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
  }
}

@media (max-width: 768px) {
  .highlights-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: start;
  }
  .hl-right-col {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
  }
  .hl-card {
    flex: none;         /* don't stretch on mobile, natural height */
  }
  .hl-list-card {
    align-self: auto;
  }
  .hl-card-value { font-size: 18px; }
  .highlights-title { font-size: 16px; }
}

@media (max-width: 480px) {
  .hl-right-col {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }
}
