/* Live Pulse Dashboard — "Hume Smart Home"-inspired styling.
   Scoped to .pulse-wrap and the live-viewers pill so it doesn't bleed
   into the rest of the app. */

:root {
  --pulse-bg: #0e1014;
  --pulse-card: #14171d;
  --pulse-card-2: #1a1e26;
  --pulse-border: #22262e;
  --pulse-text: #e8eaf0;
  --pulse-muted: #8b91a0;
  --pulse-accent: #f97316;
  --pulse-accent-soft: rgba(249, 115, 22, 0.18);
  --pulse-radius: 22px;
}

.pulse-wrap {
  color: var(--pulse-text);
}

.pulse-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1.4fr 1fr 1.4fr;
}

@media (max-width: 991px) {
  .pulse-grid { grid-template-columns: 1fr 1fr; }
  .pulse-card--ticker { grid-column: 1 / -1; }
}

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

.pulse-card {
  position: relative;
  background: var(--pulse-card);
  border: 1px solid var(--pulse-border);
  border-radius: var(--pulse-radius);
  padding: 20px 22px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.pulse-card__glow {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.22) 0%, transparent 70%);
  pointer-events: none;
  filter: blur(4px);
}

.pulse-card--streak .pulse-card__glow,
.pulse-card--ticker .pulse-card__glow {
  background: radial-gradient(circle, rgba(249, 115, 22, 0.14) 0%, transparent 70%);
}

.pulse-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.pulse-eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pulse-muted);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pulse-subtle {
  color: var(--pulse-muted);
  font-size: 0.88rem;
  position: relative;
  z-index: 1;
}

.pulse-bignum {
  font-size: 3.2rem;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 6px 0 2px;
  position: relative;
  z-index: 1;
}

.pulse-delta {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pulse-delta--up { color: var(--pulse-accent); background: var(--pulse-accent-soft); }
.pulse-delta--down { color: #f87171; background: rgba(248, 113, 113, 0.16); }
.pulse-delta--flat { color: var(--pulse-muted); background: rgba(139, 145, 160, 0.14); }

.pulse-spark {
  margin-top: 14px;
  position: relative;
  z-index: 1;
}
.pulse-spark svg {
  width: 100%;
  height: 48px;
  display: block;
  filter: drop-shadow(0 4px 10px rgba(249, 115, 22, 0.25));
}

.pulse-spark-axis {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--pulse-muted);
  margin-top: 4px;
}

/* Streak card */
.pulse-streak {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 14px 0 6px;
  position: relative;
  z-index: 1;
}
.pulse-streak__flame {
  font-size: 2rem;
  line-height: 1;
}
.pulse-streak__num {
  font-size: 3rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--pulse-text);
}
.pulse-streak__unit {
  font-size: 0.95rem;
  color: var(--pulse-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Ticker */
.pulse-livedot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pulse-accent);
  box-shadow: 0 0 0 0 var(--pulse-accent-soft);
  animation: pulseDot 1.8s ease-out infinite;
  display: inline-block;
}
@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(249, 115, 22, 0); }
  100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0); }
}

.pulse-ticker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 230px;
  overflow-y: auto;
  position: relative;
  z-index: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--pulse-border) transparent;
}
.pulse-ticker::-webkit-scrollbar { width: 6px; }
.pulse-ticker::-webkit-scrollbar-thumb { background: var(--pulse-border); border-radius: 3px; }

.pulse-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--pulse-card-2);
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--pulse-text);
  text-decoration: none;
  transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
  animation: pulseFadeIn 0.4s ease;
}
.pulse-row:hover {
  background: #1f242e;
  border-color: var(--pulse-border);
  color: var(--pulse-text);
  transform: translateX(2px);
}
@keyframes pulseFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.pulse-row__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(249, 115, 22, 0.12);
  color: var(--pulse-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.95rem;
}
.pulse-row__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.pulse-row__label {
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pulse-row__sub {
  font-size: 0.78rem;
  color: var(--pulse-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pulse-row__ago {
  font-size: 0.75rem;
  color: var(--pulse-muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.pulse-row--empty {
  background: transparent;
  border: 1px dashed var(--pulse-border);
  cursor: default;
}
.pulse-row--empty:hover { transform: none; background: transparent; }

/* Live-viewers pill — used on project cards/tables */
.pulse-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  background: var(--pulse-accent-soft);
  color: var(--pulse-accent);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}
.pulse-live-pill__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pulse-accent);
  box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.6);
  animation: pulseDot 1.8s ease-out infinite;
}

/* Milestone toast */
.pulse-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--pulse-card);
  border: 1px solid var(--pulse-accent);
  color: var(--pulse-text);
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 0.95rem;
  box-shadow: 0 12px 40px rgba(249, 115, 22, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 1080;
}
.pulse-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.pulse-toast i { color: var(--pulse-accent); margin-right: 8px; }

/* Confetti canvas sits above everything but doesn't catch clicks */
#pulse-confetti {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1090;
}
