/* ==========================================================================
   NovaHeaven — Live Investor Activity Feed
   Premium fintech social proof notifications
   ========================================================================== */

/* --- Container --- */
.investor-feed {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 950;
  width: min(380px, calc(100vw - 2rem));
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.investor-feed.is-hidden {
  opacity: 0;
  transform: translateY(20px);
  visibility: hidden;
}

.investor-feed.is-paused .investor-feed__panel {
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.25);
}

/* --- Panel --- */
.investor-feed__panel {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

/* --- Header --- */
.investor-feed__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
}

.investor-feed__live {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.investor-feed__pulse {
  width: 8px;
  height: 8px;
  background: #10B981;
  border-radius: 50%;
  animation: feedPulse 2s ease-in-out infinite;
}

@keyframes feedPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

.investor-feed__live-text {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #10B981;
}

.investor-feed__online {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex: 1;
  font-size: 0.75rem;
  color: #94A3B8;
  font-weight: 500;
}

.investor-feed__online svg { color: #64748B; flex-shrink: 0; }

#investor-online-count {
  color: #F8FAFC;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.investor-feed__controls {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}

.investor-feed__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: #94A3B8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all 0.2s ease;
}

.investor-feed__btn:hover {
  color: #F8FAFC;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(212, 175, 55, 0.3);
}

.investor-feed__btn.is-muted .icon-sound-on { display: none; }
.investor-feed__btn.is-muted .icon-sound-off { display: block !important; }

/* --- Notifications Area --- */
.investor-feed__notifications {
  position: relative;
  min-height: 88px;
  padding: 0.75rem;
}

.investor-feed__notifications:empty::after {
  content: 'Waiting for live activity…';
  display: block;
  text-align: center;
  font-size: 0.75rem;
  color: #64748B;
  padding: 1.5rem 1rem;
}

.investor-feed__notifications:not(:empty)::after {
  display: none;
}

/* --- Notification Card --- */
.investor-notification {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  animation: slideInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.investor-notification.is-exiting {
  animation: fadeOut 0.45s ease forwards;
}

/* --- Avatar --- */
.investor-notification__avatar {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #0F172A;
  letter-spacing: -0.02em;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

/* --- Content --- */
.investor-notification__content {
  flex: 1;
  min-width: 0;
}

.investor-notification__top {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.investor-notification__name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #F8FAFC;
}

.investor-notification__flag {
  font-size: 0.875rem;
  line-height: 1;
}

.investor-notification__verified {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.5625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #3B82F6;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  padding: 0.125rem 0.375rem;
  border-radius: 100px;
}

.investor-notification__verified svg {
  width: 10px;
  height: 10px;
}

.investor-notification__message {
  font-size: 0.8125rem;
  color: #94A3B8;
  line-height: 1.45;
  margin-bottom: 0.5rem;
}

.investor-notification__message strong {
  color: #F8FAFC;
  font-weight: 600;
}

.investor-notification__amount {
  font-weight: 700;
  animation: amountPulse 2s ease-in-out infinite;
}

.investor-notification__amount--deposit { color: #10B981; }
.investor-notification__amount--withdrawal { color: #D4AF37; }

/* --- Footer Row --- */
.investor-notification__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.investor-notification__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.5rem;
  border-radius: 100px;
}

.investor-notification__badge--deposit {
  color: #10B981;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.investor-notification__badge--withdrawal {
  color: #D4AF37;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.25);
}

.investor-notification__badge svg {
  width: 10px;
  height: 10px;
}

.investor-notification__time {
  font-size: 0.6875rem;
  color: #64748B;
  white-space: nowrap;
}

/* --- Reopen Button --- */
.investor-feed__reopen {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 950;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  color: #F8FAFC;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  transition: all 0.3s ease;
}

.investor-feed__reopen:hover {
  border-color: rgba(212, 175, 55, 0.4);
  transform: translateY(-2px);
}

.investor-feed__reopen-pulse {
  width: 8px;
  height: 8px;
  background: #10B981;
  border-radius: 50%;
  animation: feedPulse 2s ease-in-out infinite;
}

/* --- Keyframe Animations --- */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-12px) scale(0.96);
  }
}

@keyframes amountPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
  .investor-feed {
    bottom: 1rem;
    left: 1rem;
    width: min(340px, calc(100vw - 2rem));
  }

  .investor-feed__reopen {
    bottom: 1rem;
    left: 1rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.6875rem;
  }

  .investor-notification {
    padding: 0.75rem;
    gap: 0.625rem;
  }

  .investor-notification__avatar {
    width: 36px;
    height: 36px;
    font-size: 0.75rem;
  }

  .investor-notification__message {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .investor-feed {
    bottom: 0.75rem;
    left: 0.75rem;
    width: calc(100vw - 1.5rem);
  }

  .investor-feed__header {
    padding: 0.625rem 0.75rem;
  }

  .investor-feed__reopen {
    bottom: 0.75rem;
    left: 0.75rem;
  }
}

/* Avoid overlap with FAB on very small screens */
@media (max-width: 400px) {
  .investor-feed {
    bottom: 5.5rem;
  }

  .investor-feed__reopen {
    bottom: 5.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .investor-notification,
  .investor-notification.is-exiting {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .investor-feed__pulse,
  .investor-feed__reopen-pulse,
  .investor-notification__amount {
    animation: none;
  }

  .investor-feed {
    transition: none;
  }
}
