/* ═══════════════════════════════════════════════════════════════
   REAL-TIME — toast notifications, connection indicator, flashes
   ═══════════════════════════════════════════════════════════════ */

/* Toast container — top-right stack */
#rt-toast-container {
  position: fixed;
  top: 56px;
  right: 16px;
  z-index: 950;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
  pointer-events: none;
}

.rt-toast {
  pointer-events: all;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--bg-card, #111820);
  border: 1px solid var(--border, #1E2A35);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: rt-slide-in 0.3s ease-out;
  transition: opacity 0.3s, transform 0.3s;
}
.rt-toast:hover {
  border-color: var(--text-muted, #3D5A70);
}

.rt-toast-urgent {
  border-left: 3px solid #FF3B5C;
}
.rt-toast-watch {
  border-left: 3px solid #FFD700;
}
.rt-toast-informational {
  border-left: 3px solid #00D4FF;
}

.rt-toast-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 6px;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}
.rt-toast-urgent .rt-toast-badge {
  background: rgba(255, 59, 92, 0.2);
  color: #FF3B5C;
}
.rt-toast-watch .rt-toast-badge {
  background: rgba(255, 215, 0, 0.15);
  color: #FFD700;
}
.rt-toast-informational .rt-toast-badge {
  background: rgba(0, 212, 255, 0.12);
  color: #00D4FF;
}

.rt-toast-body {
  flex: 1;
  min-width: 0;
}
.rt-toast-title {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary, #E8F0F7);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rt-toast-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--text-muted, #3D5A70);
  margin-top: 3px;
}

.rt-toast-close {
  background: none;
  border: none;
  color: var(--text-muted, #3D5A70);
  font-size: 16px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  flex-shrink: 0;
}
.rt-toast-close:hover {
  color: var(--text-primary, #E8F0F7);
}

@keyframes rt-slide-in {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Connection indicator dot */
.rt-indicator {
  display: none;
}
.rt-connected {
  background: #00FF8C;
  box-shadow: 0 0 6px rgba(0, 255, 140, 0.5);
}
.rt-disconnected {
  background: #FF3B5C;
  box-shadow: 0 0 6px rgba(255, 59, 92, 0.4);
  animation: rt-blink 1.5s infinite;
}

@keyframes rt-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}

/* Briefing button badge */
.rt-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #FF3B5C;
  color: #fff;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
.rt-badge-pulse {
  animation: rt-badge-pop 0.4s ease-out;
}
@keyframes rt-badge-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* Price flash on update */
.rt-flash {
  animation: rt-price-flash 0.6s ease-out;
}
@keyframes rt-price-flash {
  0%   { background: rgba(0, 212, 255, 0.25); }
  100% { background: transparent; }
}

/* Vessel marker pulse on live update */
.rt-vessel-pulse {
  animation: rt-marker-pulse 0.5s ease-out;
}
@keyframes rt-marker-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.4); }
  100% { box-shadow: 0 0 0 12px rgba(0, 212, 255, 0); }
}

/* Light theme */
[data-theme="light"] .rt-toast {
  background: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* Responsive */
@media (max-width: 640px) {
  #rt-toast-container {
    right: 8px;
    left: 8px;
    max-width: none;
  }
}
