/* Initial loading screen - shows before React loads */
#initial-loader {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  z-index: 9999;
}

#initial-loader .content {
  text-align: center;
}

#initial-loader .map-container {
  width: 320px;
  height: 320px;
  margin: 0 auto 2rem;
}

#initial-loader h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 2rem;
}

#initial-loader .dots::after {
  content: '...';
  display: inline-block;
  width: 1.5em;
  text-align: left;
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

#initial-loader .progress-bar {
  width: 192px;
  height: 4px;
  background: #e2e8f0;
  border-radius: 9999px;
  margin: 0 auto;
  overflow: hidden;
}

#initial-loader .progress-fill {
  height: 100%;
  background: #8b5cf6;
  border-radius: 9999px;
  animation: progress 3s ease-in-out infinite;
}

@keyframes draw-route {
  to { stroke-dashoffset: 0; }
}

@keyframes draw-polygon {
  to { stroke-dashoffset: 0; }
}

@keyframes fade-in-markers {
  0%, 50% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes progress {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(0); }
}

.animate-draw-route {
  animation: draw-route 2s ease-in-out infinite;
}

.animate-draw-polygon {
  animation: draw-polygon 1.5s ease-in-out 0.5s infinite;
}

.animate-draw-polygon-delayed {
  animation: draw-polygon 1.5s ease-in-out 1.5s infinite;
}

.animate-fade-in-markers {
  animation: fade-in-markers 2s ease-in-out infinite;
}

/* Hide HTML loader when React root has content */
#root:not(:empty) ~ #initial-loader {
  display: none;
}
