/* ═══════════════════════════════════════════════════════════
   THE TRUMP TRADE — prices.css
   Styles for live-prices.js injected elements:
     · #live-prices-strip  — horizontal scrollable price cards
     · #charts-section     — TradingView mini-chart grid
     · .live-badge         — pulsing LIVE indicator
═══════════════════════════════════════════════════════════ */

/* ─── Live Prices Strip — outer wrapper ─────────────────── */
.live-prices-strip-section {
  /* Span the full container width, outside the main-layout grid */
  background: var(--bg-3);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 14px 0 12px;
  margin-bottom: 0;
}

/* ─── Strip header row ───────────────────────────────────── */
.lps-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px 10px;
  max-width: 1280px;
  margin: 0 auto;
}

.lps-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.lps-refresh-label {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
}

/* ─── Scroll track — hides the scrollbar, stays scrollable  */
.lps-scroll-track {
  overflow-x: auto;
  overflow-y: visible;
  padding: 4px 24px 4px;
  /* Hide scrollbar across browsers */
  scrollbar-width: none;         /* Firefox */
  -ms-overflow-style: none;      /* IE/Edge */
}
.lps-scroll-track::-webkit-scrollbar {
  display: none;                 /* Chrome/Safari */
}

/* ─── Cards flex row ─────────────────────────────────────── */
.lps-cards {
  display: flex;
  gap: 10px;
  min-width: max-content;
}

/* ─── Individual price card ──────────────────────────────── */
.price-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  cursor: default;
  /* Subtle top border accent — overridden by modifier classes below */
  border-top: 2px solid var(--border-light);
}

.price-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

/* Up / down top-border modifier */
.price-card-up {
  border-top-color: var(--green);
}

.price-card-down {
  border-top-color: var(--danger);
}

/* Ticker symbol */
.pc-sym {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

/* Company name */
.pc-name {
  font-size: 10px;
  color: var(--text-3);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 108px;
  line-height: 1.3;
  margin-bottom: 4px;
}

/* Price */
.pc-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1;
}

/* Change % */
.pc-change {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.pc-change.up   { color: var(--green);  }
.pc-change.down { color: var(--danger); }

/* Empty / loading state */
.pc-price:empty::after,
.pc-change:empty::after {
  content: '—';
  color: var(--text-3);
}

/* ─── Live Badge ─────────────────────────────────────────── */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 200, 150, 0.10);
  border: 1px solid rgba(0, 200, 150, 0.30);
  border-radius: 99px;
  padding: 3px 10px 3px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 1px;
  flex-shrink: 0;
}

/* Pulsing dot inside the badge */
.live-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  animation: lps-pulse 2s ease-in-out infinite;
}

@keyframes lps-pulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(0, 200, 150, 0.5);
  }
  50% {
    opacity: 0.7;
    box-shadow: 0 0 0 4px rgba(0, 200, 150, 0);
  }
}

/* ─── Charts Section ─────────────────────────────────────── */
#charts-section {
  margin-bottom: 0; /* the outer .section already provides spacing */
}

/* 2-column grid on desktop, 1-column on mobile */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

/* Chart card wrapper */
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s;
}

.chart-card:hover {
  border-color: var(--border-light);
}

/* Label bar above each chart */
.chart-card-label {
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.3px;
}

/* TradingView container — let the widget control its own height */
.chart-card .tradingview-widget-container {
  flex: 1;
  min-height: 220px;
}

.chart-card .tradingview-widget-container__widget {
  height: 100%;
}

/* Lazy-load placeholder shown before TradingView script fires */
.chart-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  color: var(--text-4);
  font-size: 12px;
  font-style: italic;
}

/* ─── Responsive: strip on narrow screens ────────────────── */
@media (max-width: 480px) {
  .lps-header {
    padding: 0 16px 8px;
  }

  .lps-scroll-track {
    padding: 4px 16px 4px;
  }

  .price-card {
    min-width: 104px;
    padding: 8px 12px;
  }

  .pc-name {
    max-width: 90px;
  }
}
