/*
 * universe-carousel.css — P6.4 live universe carousel
 *
 * A horizontal strip of ticker cards above the scanner panels. Each
 * card matches the dashboard metric-card footprint and the reference
 * design: ticker + % badge + price on the left, axis-less sparkline on
 * the right. Styled with Bootstrap/Phoenix CSS variables so it tracks
 * the active theme (light/dark). Behavior lives in
 * universe-carousel.js; this file is presentation only.
 */

/* ── Scroll track ──────────────────────────────────────────────────
   Horizontal, user-scrollable. NO scroll-behavior:smooth here — the
   rAF auto-scroll advances scrollLeft a fraction per frame and smooth
   behavior would fight it. The alert scroll-into-view uses an explicit
   smooth scrollTo() instead. */
.uc-track {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.75rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.25rem 0.25rem 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--bs-border-color) transparent;
}
.uc-track::-webkit-scrollbar {
  height: 6px;
}
.uc-track::-webkit-scrollbar-thumb {
  background: var(--bs-border-color);
  border-radius: 3px;
}

/* ── Card ──────────────────────────────────────────────────────────
   Fixed width ≈ a dashboard metric card; left info column + right
   sparkline column. The whole card is an anchor to the drill-down. */
.uc-card {
  flex: 0 0 auto;
  width: 250px;
  min-height: 92px;
  display: flex;
  align-items: stretch;
  gap: 0.6rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--bs-border-color-translucent, var(--bs-border-color));
  border-radius: 0.5rem;
  background: var(--bs-body-bg);
  /* Resting shadow so each card's boundary reads even while scrolling,
     no hover required. */
  box-shadow: 0 0.125rem 0.375rem rgba(0, 0, 0, 0.1);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.uc-card:hover {
  text-decoration: none;
  color: inherit;
  border-color: var(--bs-primary);
  /* More pronounced on hover. */
  box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}
/* Highlight a card an alert just scrolled into view (Phase 4). */
.uc-card.uc-alerted {
  border-color: var(--bs-warning);
  box-shadow: 0 0 0 0.15rem rgba(var(--bs-warning-rgb), 0.45);
}

/* Left column: ticker+badge on top, price below. */
.uc-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1 1 auto;
  min-width: 0;
}

.uc-card-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.uc-ticker {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--bs-body-emphasis-color, var(--bs-emphasis-color));
  letter-spacing: 0.01em;
  white-space: nowrap;
  /* Take natural width so the full ticker shows; the badge is pushed
     to the far right via margin-left:auto below. */
  flex: 0 0 auto;
}

/* ── % badge ───────────────────────────────────────────────────────
   green-subtle when up, red-subtle when down, neutral with no baseline.*/
.uc-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.12rem 0.4rem;
  border-radius: 0.35rem;
  white-space: nowrap;
  background: var(--bs-secondary-bg);
  color: var(--bs-secondary-color);
  /* Flush the % to the far right so the ticker gets the full left side. */
  flex: 0 0 auto;
  margin-left: auto;
}
.uc-up .uc-badge {
  background: var(--bs-success-bg-subtle);
  color: var(--bs-success-text-emphasis, var(--bs-success));
}
.uc-down .uc-badge {
  background: var(--bs-danger-bg-subtle);
  color: var(--bs-danger-text-emphasis, var(--bs-danger));
}

/* ── Price ─────────────────────────────────────────────────────────*/
.uc-price {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--bs-body-emphasis-color, var(--bs-emphasis-color));
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.uc-price-currency {
  font-size: 0.9rem;
  color: var(--bs-body-tertiary-color);
  margin-right: 1px;
}

/* ── Sparkline (right column) ──────────────────────────────────────
   Axis-less chart from ticker-chart.js sparkline mode. Fixed box so
   Chart.js (responsive, maintainAspectRatio:false) sizes to it. */
.uc-chart {
  flex: 0 0 92px;
  width: 92px;
  height: 52px;
  align-self: center;
  position: relative;
}
/* Let Chart.js (responsive, maintainAspectRatio:false) size the canvas
   to the fixed .uc-chart box above — don't force canvas dimensions or
   it fights the library's own sizing. */
.uc-canvas {
  display: block;
}

/* ── Play/pause control (lives in the card header) ─────────────────*/
.uc-toggle {
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
/* Two icons; CSS shows the right one per state. Done in CSS (not by
   swapping a className in JS) because Font Awesome's SVG-with-JS mode
   replaces the <span> with an <svg> at load, so a later className
   change wouldn't re-render — but the custom uc-icon-* class is copied
   onto the <svg>, so these selectors keep working. */
.uc-toggle .uc-icon-play {
  display: none;
}
.uc-toggle[data-uc-state='paused'] .uc-icon-pause {
  display: none;
}
.uc-toggle[data-uc-state='paused'] .uc-icon-play {
  display: inline-block;
}

/* ── Alert-sound toggle (P6.5, in the Live alerts panel header) ─────
   Same two-icon CSS-toggle trick keyed on [data-sound-state]. */
.alert-sound-toggle .snd-icon-off {
  display: none;
}
.alert-sound-toggle[data-sound-state='off'] .snd-icon-on {
  display: none;
}
.alert-sound-toggle[data-sound-state='off'] .snd-icon-off {
  display: inline-block;
}
