/* Live alerts page — aligned with TradeChefPro (Montserrat, --tcp-primary / --tcp-secondary) */

/* Reduce layout thrash / paint when the poll updates the feed */
.live-trades-root {
  contain: layout style;
}

.live-trades-page {
  max-width: 44rem;
  margin-left: auto;
  margin-right: auto;
}

.live-trades-hero {
  margin-bottom: 1.75rem;
}

.live-trades-hero__title {
  font-weight: 700;
  color: #2d2f36;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.live-trades-hero__lead {
  font-size: 1rem;
  line-height: 1.55;
  color: #686b75;
  margin-bottom: 0;
  max-width: 36rem;
}

/* Guest CTA */
.live-trades-guest {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: linear-gradient(165deg, #f8fafc 0%, #fff 55%, #fff8f3 100%);
  border: 1px solid rgba(6, 139, 234, 0.12);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.live-trades-guest__icon {
  font-size: 3rem !important;
  color: #068bea;
  opacity: 0.85;
  display: block;
  margin: 0 auto 1rem;
}

.live-trades-guest__title {
  font-weight: 600;
  font-size: 1.15rem;
  color: #2d2f36;
  margin-bottom: 0.5rem;
}

.live-trades-guest__text {
  font-size: 0.95rem;
  color: #686b75;
  margin-bottom: 1.25rem;
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
}

.live-trades-guest__btn {
  border-radius: 8px;
  padding: 0.5rem 1.35rem;
  font-weight: 600;
  background: #fd8917;
  border-color: #fd8917;
}

.live-trades-guest__btn:hover {
  background: #e67a0f;
  border-color: #e67a0f;
  color: #fff;
}

/* Loading */
.live-trades-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  color: #686b75;
}

.live-trades-loading__spinner {
  width: 2.25rem;
  height: 2.25rem;
  border: 3px solid rgba(6, 139, 234, 0.2);
  border-top-color: #068bea;
  border-radius: 50%;
  animation: live-trades-spin 0.75s linear infinite;
  margin-bottom: 1rem;
}

@keyframes live-trades-spin {
  to {
    transform: rotate(360deg);
  }
}

.live-trades-loading__text {
  margin: 0;
  font-size: 0.95rem;
}

/* Error */
.live-trades-error {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  background: #fff5f5;
  border: 1px solid rgba(220, 53, 69, 0.25);
  border-radius: 10px;
  color: #721c24;
  font-size: 0.95rem;
}

.live-trades-error__icon {
  font-size: 1.5rem !important;
  flex-shrink: 0;
  opacity: 0.9;
}

/* Empty */
.live-trades-empty {
  text-align: center;
  padding: 2.5rem 1.25rem;
  background: #fafbfc;
  border: 1px dashed rgba(104, 107, 117, 0.35);
  border-radius: 12px;
}

.live-trades-empty__icon {
  font-size: 3rem !important;
  color: #c5c8ce;
  display: block;
  margin: 0 auto 0.75rem;
}

.live-trades-empty__title {
  font-weight: 600;
  color: #2d2f36;
  margin-bottom: 0.35rem;
}

.live-trades-empty__text {
  font-size: 0.9rem;
  color: #686b75;
  margin: 0 auto;
  max-width: 22rem;
  line-height: 1.5;
}

/* Feed */
.live-trades-legend {
  line-height: 1.45;
  margin-bottom: 1rem;
}

.live-trades-legend__stripe {
  display: inline-block;
  width: 6px;
  height: 1rem;
  border-radius: 2px;
  margin-right: 0.4rem;
  vertical-align: -0.15em;
}

.live-trades-legend__stripe--demo {
  background: linear-gradient(180deg, #2563eb, #7c3aed);
}

.live-trades-feed {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.live-alert-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 1.1rem 1.2rem 1rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  border-left: 4px solid transparent;
}

/* Entry ↔ exit pairs: same accent (cycles 8 colors) */
.live-alert-card--paired {
  border-left-width: 4px;
  border-left-style: solid;
}

.live-alert-card--slot-0 {
  border-left-color: #2563eb;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.07) 0%, #fff 12px);
}
.live-alert-card--slot-1 {
  border-left-color: #7c3aed;
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.07) 0%, #fff 12px);
}
.live-alert-card--slot-2 {
  border-left-color: #db2777;
  background: linear-gradient(90deg, rgba(219, 39, 119, 0.07) 0%, #fff 12px);
}
.live-alert-card--slot-3 {
  border-left-color: #ea580c;
  background: linear-gradient(90deg, rgba(234, 88, 12, 0.07) 0%, #fff 12px);
}
.live-alert-card--slot-4 {
  border-left-color: #059669;
  background: linear-gradient(90deg, rgba(5, 150, 105, 0.07) 0%, #fff 12px);
}
.live-alert-card--slot-5 {
  border-left-color: #0891b2;
  background: linear-gradient(90deg, rgba(8, 145, 178, 0.07) 0%, #fff 12px);
}
.live-alert-card--slot-6 {
  border-left-color: #ca8a04;
  background: linear-gradient(90deg, rgba(202, 138, 4, 0.07) 0%, #fff 12px);
}
.live-alert-card--slot-7 {
  border-left-color: #4f46e5;
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.07) 0%, #fff 12px);
}

.live-alert-card--orphan-exit {
  border-left: 4px dashed rgba(108, 117, 125, 0.65);
  background: #fafbfc;
}

.live-alert-card:hover {
  box-shadow: 0 6px 20px rgba(6, 139, 234, 0.08);
  border-color: rgba(6, 139, 234, 0.15);
}

.live-alert-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.live-alert-card__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.live-alert-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  border-radius: 6px;
  line-height: 1;
}

.live-alert-badge--entry {
  background: rgba(40, 167, 69, 0.12);
  color: #1e7e34;
}

.live-alert-badge--exit {
  background: rgba(220, 53, 69, 0.1);
  color: #c82333;
}

.live-alert-badge--adjust {
  background: rgba(6, 139, 234, 0.12);
  color: #0568b8;
}

.live-alert-badge--other {
  background: rgba(104, 107, 117, 0.12);
  color: #4a4d55;
}

.live-alert-ticker {
  font-size: 1.25rem;
  font-weight: 700;
  color: #2d2f36;
  letter-spacing: -0.03em;
}

.live-alert-card__time {
  font-size: 0.8rem;
  color: #868992;
  white-space: nowrap;
  flex-shrink: 0;
}

.live-alert-card__route {
  font-size: 0.82rem;
  color: #868992;
  margin: 0 0 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.live-alert-icon {
  font-size: 1rem !important;
  opacity: 0.65;
}

.live-alert-card__summary {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #3d4049;
  margin: 0 0 0.75rem;
}

/* Route line (Lambda discord_route_label — same idea as Discord webhook / channel name) */
.live-alert-discord-meta {
  font-size: 0.78rem;
  font-weight: 600;
  color: #068bea;
  margin: 0 0 0.35rem;
  letter-spacing: 0.02em;
}

/* Same copy Lambda sends to Discord (markdown **bold** rendered in JS) */
.live-alert-discord {
  font-size: 0.92rem;
  line-height: 1.55;
  color: #2d2f36;
  margin: 0 0 0.75rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.live-alert-discord strong {
  font-weight: 700;
  color: #1a1c22;
}

.live-alert-parse-error {
  color: #856404;
  background: rgba(255, 193, 7, 0.12);
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
}

.live-alert-details {
  border-top: 1px solid #eef0f3;
  padding-top: 0.65rem;
  margin-top: 0.25rem;
}

.live-alert-details__summary {
  font-size: 0.82rem;
  color: #068bea;
  cursor: pointer;
  list-style: none;
  font-weight: 500;
  outline: none;
}

.live-alert-details__summary::-webkit-details-marker {
  display: none;
}

.live-alert-details__summary::before {
  content: '▸ ';
  display: inline-block;
  transition: transform 0.15s ease;
}

.live-alert-details[open] .live-alert-details__summary::before {
  transform: rotate(90deg);
}

.live-alert-details__summary:hover {
  color: #fd8917;
}

.live-alert-pre {
  margin: 0.65rem 0 0;
  padding: 0.75rem;
  font-size: 0.72rem;
  line-height: 1.45;
  background: #f4f6f8;
  border-radius: 8px;
  max-height: 14rem;
  overflow: auto;
  border: 1px solid #e8eaed;
}

/* Footer strip */
.live-trades-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #eef0f3;
  font-size: 0.78rem;
  color: #a0a4ad;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.live-trades-footer__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #28a745;
  animation: live-trades-pulse 2s ease-in-out infinite;
}

@keyframes live-trades-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

@media (max-width: 576px) {
  .live-alert-card__top {
    flex-direction: column;
    align-items: flex-start;
  }

  .live-alert-card__time {
    align-self: flex-start;
    margin-top: 0.35rem;
  }
}
