/* Overlay de carregamento compartilhado — "Carregando <tela>" / "Buscando voos".
   Visual portado do design "Modal Buscando Voos" (Claude Design); as cores
   hardcoded do mock foram mapeadas 1:1 pras variaveis de tema do MVT, entao
   funciona nos dois temas (dark e clean) sem nenhum data-theme especial-casado.
   Motor e API em loading-overlay.js. */

#mvt-loading,
#mvt-loading *,
#mvt-loading *::before,
#mvt-loading *::after { box-sizing: border-box; }

#mvt-loading {
  position: fixed; inset: 0; z-index: 9500;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(6, 7, 10, .72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .18s ease-out;
  font-family: 'Manrope', system-ui, sans-serif;
}
#mvt-loading.mvt-loading-on { opacity: 1; }

.mvt-loading-card {
  width: 460px; max-width: 100%;
  background: var(--bg-field);
  border: 1px solid var(--border-menu);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .45);
  display: flex; flex-direction: column; gap: 24px;
  animation: mvtLoadingFadeUp .22s ease-out both;
}

/* Linha de rota com aviaozinho voando */
.mvt-loading-route { display: flex; align-items: center; gap: 10px; }
.mvt-loading-dot {
  width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto;
  box-sizing: border-box;
}
.mvt-loading-dot.is-start { background: var(--acc); }
.mvt-loading-dot.is-end { background: var(--bg-page); border: 2px solid var(--border2); }
.mvt-loading-track {
  position: relative; flex: 1; height: 12px;
  display: flex; align-items: center;
}
.mvt-loading-track-base {
  position: absolute; left: 0; right: 0; height: 2px;
  background: var(--border2); border-radius: 2px;
}
.mvt-loading-track-trail {
  position: absolute; left: 0; height: 2px;
  background: var(--acc); border-radius: 2px;
  animation: mvtLoadingTrail 2.6s ease-in-out infinite;
}
.mvt-loading-plane {
  position: absolute; top: 0; width: 0; height: 0; margin-left: -7px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 14px solid var(--acc);
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--acc) 45%, transparent));
  animation: mvtLoadingFly 2.6s ease-in-out infinite;
}

.mvt-loading-title {
  font-size: 20px; font-weight: 800; color: var(--text);
}
.mvt-loading-step {
  margin-top: 6px;
  font-size: 14px; font-weight: 500; color: var(--text-muted);
}

.mvt-loading-bars { display: flex; flex-direction: column; gap: 10px; }
.mvt-loading-bar {
  height: 12px; border-radius: 6px;
  background: linear-gradient(90deg,
    var(--bg-card) 0%,
    color-mix(in srgb, var(--acc) 10%, var(--bg-card)) 50%,
    var(--bg-card) 100%);
  background-size: 320px 100%;
  animation: mvtLoadingShimmer 1.4s linear infinite;
}

.mvt-loading-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-top: 1px solid var(--border-card);
  padding-top: 18px;
  font-size: 13px; font-weight: 500; color: var(--text-muted);
}
.mvt-loading-foot strong { color: var(--acc); font-weight: 800; }
.mvt-loading-cancel {
  font-size: 13px; font-weight: 700; text-decoration: none;
  color: var(--acc); background: none; border: 0; padding: 0;
  cursor: pointer; font-family: inherit;
}
.mvt-loading-cancel:hover { opacity: .8; }

@keyframes mvtLoadingFadeUp {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
@keyframes mvtLoadingShimmer {
  0%   { background-position: -320px 0; }
  100% { background-position: 320px 0; }
}
@keyframes mvtLoadingFly {
  0%   { left: 0%; }
  100% { left: 100%; }
}
@keyframes mvtLoadingTrail {
  0%   { width: 0%; }
  100% { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  #mvt-loading { transition: none; }
  .mvt-loading-card { animation: none; }
  .mvt-loading-plane, .mvt-loading-track-trail, .mvt-loading-bar { animation: none; }
  .mvt-loading-track-trail { width: 55%; }
}
