/* ==========================================================================
   CSS das Animações Minimalistas de Padrões de Missão - MapeiaDrone
   ========================================================================== */

:root {
  --anim-speed: 6s;
}

/* Badges / Tags de Missão */
.mission-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-block;
}

.tag-2d { background: rgba(0, 242, 254, 0.12); color: var(--accent-cyan); border: 1px solid rgba(0, 242, 254, 0.3); }
.tag-3d { background: rgba(139, 92, 246, 0.12); color: var(--accent-purple); border: 1px solid rgba(139, 92, 246, 0.3); }
.tag-corridor { background: rgba(16, 185, 129, 0.12); color: var(--accent-green); border: 1px solid rgba(16, 185, 129, 0.3); }
.tag-orbit { background: rgba(245, 158, 11, 0.12); color: var(--accent-amber); border: 1px solid rgba(245, 158, 11, 0.3); }
.tag-helix { background: rgba(244, 63, 94, 0.12); color: var(--accent-rose); border: 1px solid rgba(244, 63, 94, 0.3); }
.tag-pano { background: rgba(59, 130, 246, 0.12); color: var(--accent-blue); border: 1px solid rgba(59, 130, 246, 0.3); }

/* Palco / Stage de Animação SVG */
.anim-stage-box {
  position: relative;
  width: 100%;
  height: 190px;
  background: var(--bg-canvas);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.anim-stage-box svg {
  width: 100%;
  height: 100%;
  display: block;
}

.grid-lines-guide {
  stroke: var(--border-subtle);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.drone-body-shape {
  filter: var(--drone-shadow);
}

/* 1. Ortomosaico */
.ortho-drone-anim {
  offset-path: path('M 50 45 L 290 45 C 315 45, 315 105, 290 105 L 50 105 C 25 105, 25 165, 50 165 L 290 165');
  offset-rotate: auto;
  animation: followOrthoLoop var(--anim-speed) ease-in-out infinite;
}
.ortho-trail-anim {
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: drawOrthoTrailLoop var(--anim-speed) ease-in-out infinite;
}
.ortho-fp-anim {
  opacity: 0;
  animation: showFootprintLoop var(--anim-speed) infinite;
}
.fp-d1 { animation-delay: 0.4s; }
.fp-d2 { animation-delay: 1.2s; }
.fp-d3 { animation-delay: 2.2s; }
.fp-d4 { animation-delay: 3.0s; }
.fp-d5 { animation-delay: 4.0s; }
.fp-d6 { animation-delay: 4.8s; }

@keyframes drawOrthoTrailLoop {
  0% { stroke-dashoffset: 900; }
  85% { stroke-dashoffset: 0; }
  92%, 100% { stroke-dashoffset: 0; }
}
@keyframes showFootprintLoop {
  0% { opacity: 0; transform: scale(0.8); }
  6% { opacity: 0.55; transform: scale(1); }
  88% { opacity: 0.55; }
  94%, 100% { opacity: 0; }
}
@keyframes followOrthoLoop {
  0% { offset-distance: 0%; opacity: 1; }
  85% { offset-distance: 100%; opacity: 1; }
  92%, 100% { offset-distance: 100%; opacity: 0; }
}

/* 2. Duplo Grid 3D */
.dgrid-drone-anim {
  animation: flyDoubleGridLoop var(--anim-speed) ease-in-out infinite;
}
.dgrid-trail-h-anim {
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: drawTrailHLoop var(--anim-speed) ease-in-out infinite;
}
.dgrid-trail-v-anim {
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: drawTrailVLoop var(--anim-speed) ease-in-out infinite;
}
.building-facet-anim {
  animation: pulseBuildingLoop var(--anim-speed) infinite;
}

@keyframes drawTrailHLoop {
  0% { stroke-dashoffset: 600; }
  44% { stroke-dashoffset: 0; }
  92%, 100% { stroke-dashoffset: 0; }
}
@keyframes drawTrailVLoop {
  0%, 46% { stroke-dashoffset: 600; }
  88% { stroke-dashoffset: 0; }
  92%, 100% { stroke-dashoffset: 0; }
}
@keyframes pulseBuildingLoop {
  0%, 100% { opacity: 0.5; }
  25% { opacity: 0.85; fill: rgba(0, 242, 254, 0.25); }
  70% { opacity: 1; fill: rgba(139, 92, 246, 0.35); }
}
@keyframes flyDoubleGridLoop {
  0% { transform: translate(50px, 60px) rotate(0deg); opacity: 1; }
  18% { transform: translate(290px, 60px) rotate(0deg); }
  22% { transform: translate(290px, 140px) rotate(90deg); }
  40% { transform: translate(50px, 140px) rotate(180deg); }
  45% { transform: translate(80px, 175px) rotate(-90deg); }
  62% { transform: translate(80px, 45px) rotate(-90deg); }
  68% { transform: translate(220px, 45px) rotate(0deg); }
  86% { transform: translate(220px, 175px) rotate(90deg); }
  92%, 100% { transform: translate(220px, 175px) rotate(90deg); opacity: 0; }
}

/* 3. Corredor */
.corridor-drone-anim {
  offset-path: path('M 25 150 C 95 150, 115 75, 185 75 C 255 75, 265 140, 315 140');
  offset-rotate: auto;
  animation: followCorridorLoop var(--anim-speed) ease-in-out infinite;
}
.corridor-trail-anim {
  stroke-dasharray: 450;
  stroke-dashoffset: 450;
  animation: drawCorridorTrailLoop var(--anim-speed) ease-in-out infinite;
}
.corridor-pulse-anim {
  animation: scanWaveLoop 2s linear infinite;
}
@keyframes scanWaveLoop {
  0% { r: 6px; opacity: 0.9; }
  100% { r: 28px; opacity: 0; }
}
@keyframes drawCorridorTrailLoop {
  0% { stroke-dashoffset: 450; }
  85% { stroke-dashoffset: 0; }
  92%, 100% { stroke-dashoffset: 0; }
}
@keyframes followCorridorLoop {
  0% { offset-distance: 0%; opacity: 1; }
  85% { offset-distance: 100%; opacity: 1; }
  92%, 100% { offset-distance: 100%; opacity: 0; }
}

/* 4. Órbita POI */
.orbit-system-anim {
  animation: rotateOrbitLoop var(--anim-speed) linear infinite;
  transform-origin: 170px 105px;
}
.poi-pulse-ring-anim {
  animation: pulseRingLoop 1.8s ease-out infinite;
  transform-origin: 170px 105px;
}
@keyframes pulseRingLoop {
  0% { r: 10px; opacity: 0.9; stroke-width: 2; }
  100% { r: 32px; opacity: 0; stroke-width: 0.5; }
}
@keyframes rotateOrbitLoop {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 5. Hélice Torre */
.helix-drone-anim {
  animation: flyHelixLoop var(--anim-speed) ease-in-out infinite;
}
.tower-glow-anim {
  animation: towerScanLoop 3s ease-in-out infinite alternate;
}
@keyframes towerScanLoop {
  0% { stroke: rgba(244, 63, 94, 0.4); }
  100% { stroke: rgba(244, 63, 94, 1); filter: drop-shadow(0 0 8px rgba(244, 63, 94, 0.6)); }
}
@keyframes flyHelixLoop {
  0% { transform: translate(85px, 160px) scale(0.9); }
  15% { transform: translate(170px, 178px) scale(1.15); }
  30% { transform: translate(255px, 155px) scale(0.9); }
  45% { transform: translate(170px, 115px) scale(0.8); }
  60% { transform: translate(90px, 95px) scale(0.9); }
  75% { transform: translate(170px, 70px) scale(1.1); }
  90% { transform: translate(245px, 50px) scale(0.85); }
  95%, 100% { transform: translate(85px, 160px) scale(0.9); }
}

/* 6. Panorama 360° */
.pano-drone-anim {
  transform-origin: 170px 105px;
  animation: rotatePanoYawLoop var(--anim-speed) steps(8, end) infinite;
}
.pano-cone-anim {
  transform-origin: 170px 105px;
  animation: sweepPanoConeLoop var(--anim-speed) linear infinite;
}
.pano-dot-anim {
  opacity: 0.2;
  animation: flashPanoDotLoop var(--anim-speed) infinite;
}
.pdot-d1 { animation-delay: 0.0s; }
.pdot-d2 { animation-delay: 0.75s; }
.pdot-d3 { animation-delay: 1.5s; }
.pdot-d4 { animation-delay: 2.25s; }
.pdot-d5 { animation-delay: 3.0s; }
.pdot-d6 { animation-delay: 3.75s; }
.pdot-d7 { animation-delay: 4.5s; }
.pdot-d8 { animation-delay: 5.25s; }

@keyframes rotatePanoYawLoop {
  0% { transform: rotate(0deg); }
  12.5% { transform: rotate(45deg); }
  25% { transform: rotate(90deg); }
  37.5% { transform: rotate(135deg); }
  50% { transform: rotate(180deg); }
  62.5% { transform: rotate(225deg); }
  75% { transform: rotate(270deg); }
  87.5% { transform: rotate(315deg); }
  100% { transform: rotate(360deg); }
}
@keyframes sweepPanoConeLoop {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes flashPanoDotLoop {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  4% { opacity: 1; fill: #ffffff; transform: scale(1.6); filter: drop-shadow(0 0 8px var(--accent-blue)); }
  15% { opacity: 0.75; fill: var(--accent-blue); transform: scale(1); }
  90% { opacity: 0.75; }
}

/* ==========================================================================
   ESTILOS DO MODAL DE GUIA EXPANDIDO
   ========================================================================== */
.modal-dialog-large {
  max-width: 880px !important;
  width: 95vw !important;
}

.guide-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 18px 12px;
  margin: -6px 0 10px;
}

.guide-tab-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.guide-tab-btn:hover {
  color: var(--text-primary);
  border-color: rgba(0, 242, 254, 0.3);
}

.guide-tab-btn.active {
  background: rgba(0, 242, 254, 0.12);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.guide-tab-pane {
  display: none;
}

.guide-tab-pane.active {
  display: block;
}

.guide-mission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 18px;
  padding: 4px 0 12px;
}

.guide-mission-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.guide-mission-card:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
}

.guide-card-head {
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
}

.guide-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.guide-card-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guide-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.guide-card-specs {
  display: flex;
  gap: 8px;
  background: var(--bg-spec);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
}

.guide-card-spec-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.guide-card-spec-label {
  color: var(--text-dim);
  font-size: 0.65rem;
  text-transform: uppercase;
  font-weight: 700;
}

.guide-card-spec-val {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-weight: 600;
}

.guide-card-apply-btn {
  margin-top: 4px;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.25);
  color: var(--accent-cyan);
  font-family: var(--font-main);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.guide-card-apply-btn:hover {
  background: var(--accent-cyan);
  color: #080c14;
}

/* ==========================================================================
   ESTILOS DO HOVER PREVIEW FLUTUANTE (TOOLTIP DE MISSÃO)
   ========================================================================== */
.mission-hover-tooltip {
  position: fixed;
  width: 320px;
  background: var(--bg-surface-elevated);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevation), var(--border-glow);
  z-index: 2800;
  pointer-events: none;
  opacity: 0;
  transform: translateX(10px) scale(0.96);
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mission-hover-tooltip.active {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.tooltip-header {
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-subtle);
}

.tooltip-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tooltip-stage {
  height: 155px;
  background: var(--bg-canvas);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border-subtle);
}

.tooltip-stage svg {
  width: 100%;
  height: 100%;
}

.tooltip-footer {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tooltip-desc {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.tooltip-specs {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  background: var(--bg-spec);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.tooltip-specs strong {
  color: var(--accent-cyan);
}

/* ==========================================================================
   TEMA CLARO - OVERRIDES DAS ANIMAÇÕES & MODAL DE GUIA
   ========================================================================== */
[data-theme="light"] .guide-mission-card {
  background: #ffffff;
  border-color: var(--border-subtle);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .guide-mission-card:hover {
  border-color: rgba(2, 132, 199, 0.4);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .guide-tab-btn {
  background: #f8fafc;
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

[data-theme="light"] .guide-tab-btn:hover {
  background: #ffffff;
  border-color: #0284c7;
  color: #0284c7;
}

[data-theme="light"] .guide-tab-btn.active {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.25);
}

[data-theme="light"] .guide-card-apply-btn {
  background: #f8fafc;
  border-color: var(--border-subtle);
  color: #0284c7;
}

[data-theme="light"] .guide-card-apply-btn:hover {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
}

[data-theme="light"] .mission-hover-tooltip {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(2, 132, 199, 0.45);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18), 0 0 15px rgba(2, 132, 199, 0.15);
}

[data-theme="light"] .tooltip-header,
[data-theme="light"] .tooltip-stage {
  border-color: rgba(100, 116, 139, 0.15);
}

[data-theme="light"] .tooltip-specs {
  background: #e2e8f0;
  color: #475569;
}

