/* ==========================================================================
   MealBridge Live Donation Tracking Styles
   Prominent countdown hero, 7-stage chain-of-custody timeline, GPS telemetry,
   interactive demo simulation controls
   ========================================================================== */

.tracking-page {
  padding: 30px 0 60px;
  max-width: 1100px;
  margin: 0 auto;
}

/* Top Navigation & Pitch Controls */
.tracking-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.tracking-title-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tracking-id-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tracking-heading {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-charcoal-dark);
}

.demo-controls-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #F8FAFC;
  border: 1px dashed #CBD5E1;
  padding: 6px 14px;
  border-radius: var(--radius-full);
}

.demo-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: #64748B;
  letter-spacing: 0.05em;
}

/* Hero Telemetry & Giant Countdown Display */
.tracking-telemetry-hero {
  background-color: #121316;
  color: #FFFFFF;
  border-radius: var(--radius-xl);
  padding: 36px 40px;
  margin-bottom: 30px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 36px;
  align-items: center;
  box-shadow: var(--shadow-lg);
}

.hero-countdown-block {
  display: flex;
  flex-direction: column;
}

.countdown-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #9CA3AF;
  margin-bottom: 8px;
}

.countdown-large-display {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 4.2rem);
  font-weight: 800;
  line-height: 1;
  color: #FFFFFF;
  margin-bottom: 10px;
}

.time-digit {
  background-color: #27272A;
  padding: 4px 10px;
  border-radius: 10px;
  letter-spacing: -0.02em;
}

.time-sep {
  color: #71717A;
  margin: 0 -2px;
}

.countdown-sub {
  font-size: 0.82rem;
  color: #A1A1AA;
}

/* Status Summary Box inside Hero */
.hero-status-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  background-color: rgba(255, 255, 255, 0.05);
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-stat {
  display: flex;
  flex-direction: column;
}

.s-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: #9CA3AF;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.s-val {
  font-size: 1rem;
  font-weight: 600;
  color: #F4F4F5;
}

/* Two Column Content Layout */
.tracking-content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.card-subtitle {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-charcoal-dark);
  margin-bottom: 24px;
}

/* 7-Stage Chronological Timeline */
.tracking-timeline-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 30px;
  box-shadow: var(--shadow-sm);
}

.timeline-stepper-vertical {
  display: flex;
  flex-direction: column;
}

.timeline-row {
  display: flex;
  gap: 16px;
  position: relative;
}

.timeline-indicator-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timeline-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
  z-index: 2;
  transition: all 0.2s ease;
}

.timeline-line {
  width: 2px;
  flex: 1;
  min-height: 36px;
  background-color: var(--border-subtle);
  margin: 4px 0;
}

/* Timeline State Colors */
.timeline-row.completed .timeline-dot {
  background-color: var(--primary-green);
  color: #FFFFFF;
}

.timeline-row.completed .timeline-line {
  background-color: var(--primary-green);
}

.timeline-row.active .timeline-dot {
  background-color: var(--primary-green-light);
  border: 2px solid var(--primary-green);
  color: var(--primary-green);
  box-shadow: 0 0 0 4px var(--primary-green-light);
}

.timeline-row.future .timeline-dot {
  background-color: var(--bg-subtle);
  color: var(--text-subtle);
  border: 1.5px solid var(--border-strong);
}

.timeline-info-col {
  padding-bottom: 28px;
  flex: 1;
}

.timeline-step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.timeline-step-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-charcoal-dark);
}

.timeline-row.active .timeline-step-name {
  color: var(--primary-green);
}

.timeline-time {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--primary-green);
  background-color: var(--primary-green-light);
  padding: 2px 8px;
  border-radius: 4px;
}

.timeline-step-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* Right Side Column */
.tracking-side-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Driver Profile Card */
.driver-profile-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.driver-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.driver-avatar-box {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background-color: var(--primary-green-light);
  border: 1px solid var(--primary-green-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.driver-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-charcoal-dark);
}

.driver-plate {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-charcoal);
}

.driver-cert {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.driver-phone-cta {
  margin-left: auto;
}

.temp-sensor-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background-color: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: var(--radius-md);
}

.sensor-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background-color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sensor-title {
  font-size: 0.72rem;
  font-weight: 800;
  color: #166534;
  letter-spacing: 0.03em;
}

.sensor-value {
  font-size: 0.86rem;
  color: #14532D;
}

/* Route Map Card */
.route-map-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.route-map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.route-map-header h4 {
  font-size: 1rem;
  font-weight: 800;
}

.route-radar-wrapper {
  background-color: #F8FAFC;
  border-radius: var(--radius-lg);
  border: 1px solid #E2E8F0;
  overflow: hidden;
  height: 200px;
}

.route-svg {
  width: 100%;
  height: 100%;
}

/* Shelter Detail Card */
.shelter-detail-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.shelter-detail-card h4 {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 2px;
}

.shelter-contact-row {
  display: flex;
  gap: 20px;
  font-size: 0.84rem;
  color: var(--text-charcoal);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

/* Responsive */
@media (max-width: 900px) {
  .tracking-telemetry-hero {
    grid-template-columns: 1fr;
  }
  .tracking-content-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Real-Time Telemetry & Synchronization Styling
   ========================================================================== */

.realtime-live-tag {
  background-color: rgba(16, 185, 129, 0.2);
  color: #10B981;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  margin-left: 8px;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.realtime-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #F0FDF4;
  border: 1px solid #DCFCE7;
  color: #166534;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.btn-active-sim {
  background-color: #059669 !important;
  color: #FFFFFF !important;
  box-shadow: 0 0 14px rgba(5, 150, 105, 0.5) !important;
  animation: rtPulseGlow 1.8s infinite ease-in-out;
}

@keyframes rtPulseGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(5, 150, 105, 0.3); }
  50% { box-shadow: 0 0 16px rgba(5, 150, 105, 0.7); }
}

.realtime-pulse-active {
  box-shadow: 0 0 12px #10B981 !important;
  border-color: #10B981 !important;
  transition: all 0.2s ease;
}

.anim-pulse-ring {
  transform-origin: center;
  animation: pulseRingAnim 2s infinite ease-out;
}

@keyframes pulseRingAnim {
  0% { r: 12px; opacity: 0.7; }
  50% { r: 22px; opacity: 0.25; }
  100% { r: 26px; opacity: 0; }
}

/* Global Real-Time Floating Toast */
.realtime-toast-card {
  position: relative;
  background-color: #18181B;
  color: #F4F4F5;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  margin-bottom: 10px;
  overflow: hidden;
  animation: rtToastFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  min-width: 320px;
  max-width: 420px;
}

.rt-toast-glow {
  padding: 12px 14px;
}

.rt-toast-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.rt-toast-icon-wrap {
  position: relative;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.rt-pulse-ping {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: inherit;
  animation: rtPing 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
  opacity: 0.75;
}

@keyframes rtPing {
  75%, 100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

.rt-toast-text {
  flex: 1;
}

.rt-toast-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: #FFFFFF;
  line-height: 1.3;
}

.rt-toast-desc {
  font-size: 0.78rem;
  color: #D4D4D8;
  margin-top: 2px;
  line-height: 1.4;
}

.rt-toast-close {
  background: none;
  border: none;
  color: #A1A1AA;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.rt-toast-close:hover {
  color: #FFFFFF;
}

@keyframes rtToastFadeIn {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes rtToastFadeOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-12px) scale(0.96);
  }
}
