/* Estilos do Modo Explicação / Tour Guiado Interativo (Spotlight Walkthrough) */

.tour-backdrop {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 99997;
  cursor: pointer;
}

body.tour-is-active {
  overflow-x: clip;
}

/* Spotlight Gliding Cutout Window (Inspirado no Shala Briefing & Video Pipelines) */
.tour-spotlight {
  position: fixed;
  pointer-events: none;
  border-radius: 10px;
  border: 2px solid #38bdf8;
  box-shadow: 
    0 0 0 100vmax rgba(5, 12, 28, 0.78),
    0 0 32px rgba(56, 189, 248, 0.6),
    inset 0 0 20px rgba(56, 189, 248, 0.18);
  transition: all 0.38s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 99998;
  will-change: top, left, width, height;
}

/* Elemento em Foco (Spotlight Highlight) */
.is-tour-highlighted {
  position: relative !important;
  z-index: 99999 !important;
  border-radius: 8px !important;
  transition: box-shadow 0.25s ease-out, transform 0.2s ease-out !important;
}

@keyframes tour-pulse-focus {
  0%, 100% {
    box-shadow: 
      0 0 0 4px #2563eb,
      0 0 0 9px rgba(37, 99, 235, 0.3),
      0 20px 45px rgba(0, 0, 0, 0.6);
  }
  50% {
    box-shadow: 
      0 0 0 5px #3b82f6,
      0 0 0 14px rgba(59, 130, 246, 0.42),
      0 24px 50px rgba(0, 0, 0, 0.7);
  }
}

/* Card Flutuante (Popover) */
.tour-popover {
  position: fixed;
  z-index: 100000;
  width: 440px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  box-sizing: border-box;
  background: #0d1a38;
  color: #f1f5f9;
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-radius: 14px;
  box-shadow: 
    0 25px 60px rgba(0, 7, 24, 0.85),
    0 0 25px rgba(37, 99, 235, 0.3);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: tour-popover-in 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.tour-popover__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tour-popover__tag-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tour-popover__step-badge {
  background: #1e3a8a;
  color: #bfdbfe;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tour-popover__security-tag {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 12px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.tour-popover__close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s ease;
  line-height: 1;
}

.tour-popover__close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.tour-popover__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tour-popover__title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
}

.tour-popover__desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: #cbd5e1;
}

.tour-popover__desc strong {
  color: #93c5fd;
  font-weight: 600;
}

.tour-popover__tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12px;
  line-height: 1.45;
  color: #fde68a;
}

.tour-popover__tip-icon {
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

.tour-popover__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tour-popover__dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tour-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tour-dot:hover {
  background: rgba(255, 255, 255, 0.5);
}

.tour-dot.is-active {
  width: 22px;
  border-radius: 5px;
  background: #3b82f6;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
}

.tour-popover__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tour-btn {
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.tour-btn--prev {
  background: rgba(255, 255, 255, 0.09);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.tour-btn--prev:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.tour-btn--next {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.4);
}

.tour-btn--next:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.55);
}

/* Botão no Menu Superior Global */
.tour-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.15), rgba(245, 158, 11, 0.25));
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fef08a;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tour-nav-pill:hover {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.25), rgba(245, 158, 11, 0.38));
  border-color: #fbbf24;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
  transform: translateY(-1px);
}

.tour-nav-pill__icon {
  font-size: 14px;
  filter: drop-shadow(0 0 3px rgba(251, 191, 36, 0.6));
}

/* Botão inline dentro da barra de ferramentas da Carta-Proposta */
.carta-tour-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1e3a8a;
  color: #ffffff;
  border: 1px solid #3b82f6;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.carta-tour-btn:hover {
  background: #2563eb;
  border-color: #60a5fa;
  box-shadow: 0 3px 12px rgba(37, 99, 235, 0.35);
}

/* ==========================================================================
   Animações Interativas de Pontos Focais (Radar Beacons & Motion Pointers)
   Inspirado em Video Editing Pipelines & HyperFrames Motion Graphics
   ========================================================================== */

/* Canvas SVG para traçado de feixe dinâmico conector */
.tour-svg-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 99999;
}

.tour-connector-path {
  fill: none;
  stroke: url(#tour-gradient-line);
  stroke-width: 2.5;
  stroke-dasharray: 8 6;
  stroke-linecap: round;
  animation: tour-dash-flow 1.2s linear infinite;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.8));
}

.tour-connector-head {
  fill: #38bdf8;
  stroke: #38bdf8;
  stroke-width: 1.5;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 7px rgba(56, 189, 248, 0.95));
  transition: transform 0.2s ease;
}

@keyframes tour-dash-flow {
  to {
    stroke-dashoffset: -28;
  }
}

/* Radar Beacon / Marcador Pulsante no Ponto Focal */
.tour-beacon {
  position: fixed;
  z-index: 100001;
  pointer-events: none;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), left 0.45s cubic-bezier(0.16, 1, 0.3, 1), top 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.tour-beacon__rings {
  position: relative;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tour-beacon__ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid #38bdf8;
  opacity: 0.8;
  animation: tour-beacon-wave 2.2s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.tour-beacon__ring--2 {
  animation-delay: 0.7s;
  border-color: #60a5fa;
}

.tour-beacon__ring--3 {
  animation-delay: 1.4s;
  border-color: #818cf8;
}

.tour-beacon__core {
  position: relative;
  z-index: 2;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle, #38bdf8 0%, #2563eb 85%);
  box-shadow: 
    0 0 0 3px #ffffff,
    0 0 16px rgba(56, 189, 248, 0.95),
    0 4px 12px rgba(0, 0, 0, 0.5);
  animation: tour-beacon-core 1.8s ease-in-out infinite alternate;
}

@keyframes tour-beacon-wave {
  0% {
    transform: scale(0.35);
    opacity: 0.95;
  }
  100% {
    transform: scale(2.8);
    opacity: 0;
  }
}

@keyframes tour-beacon-core {
  0% {
    transform: scale(0.9);
    filter: brightness(1);
  }
  100% {
    transform: scale(1.2);
    filter: brightness(1.35);
  }
}

/* Badge Flutuante do Ponto Focal */
.tour-beacon__badge {
  position: absolute;
  left: 30px;
  top: -16px;
  background: rgba(13, 26, 56, 0.96);
  border: 1px solid rgba(56, 189, 248, 0.7);
  backdrop-filter: blur(8px);
  color: #f0f9ff;
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.03em;
  white-space: nowrap;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  gap: 6px;
  animation: tour-badge-float 2.4s ease-in-out infinite alternate;
  pointer-events: none;
}

.tour-beacon.is-badge-left .tour-beacon__badge {
  left: auto;
  right: 30px;
}

.tour-beacon.is-badge-hidden .tour-beacon__badge {
  display: none !important;
}

.tour-beacon__badge-icon {
  font-size: 13px;
}

@keyframes tour-badge-float {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-4px);
  }
}

/* Indicador Direcional de Apontamento */
.tour-beacon__arrow {
  position: absolute;
  font-size: 20px;
  color: #38bdf8;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.8));
  animation: tour-arrow-nudge 1.2s ease-in-out infinite alternate;
  pointer-events: none;
}

.tour-beacon__arrow--left {
  right: 32px;
  transform: rotate(180deg);
}

.tour-beacon__arrow--right {
  left: 32px;
}

.tour-beacon__arrow--top {
  bottom: 32px;
  transform: rotate(-90deg);
}

.tour-beacon__arrow--bottom {
  top: 32px;
  transform: rotate(90deg);
}

@keyframes tour-arrow-nudge {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(6px);
  }
}

/* Hotspots Interativos no Documento — Régua Lateral Ordenada (Pins 1..8) */
.tour-hotspots-container {
  position: fixed;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  z-index: 100000;
}

.tour-hotspot-pin {
  position: relative;
  pointer-events: auto;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 4px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.5);
  border-radius: 20px;
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  width: fit-content;
}

.tour-hotspot-pin:hover,
.tour-hotspot-pin:focus-visible {
  transform: scale(1.06);
  background: #1e3a8a;
  border-color: #60a5fa;
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.65);
  gap: 7px;
  padding-right: 11px;
  z-index: 10;
  outline: none;
}

.tour-hotspot-pin__dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #334155;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.tour-hotspot-pin.is-active {
  background: #2563eb;
  border-color: #93c5fd;
  color: #ffffff;
  box-shadow: 0 0 18px rgba(37, 99, 235, 0.85);
  transform: scale(1.1);
  z-index: 12;
}

.tour-hotspot-pin.is-active .tour-hotspot-pin__dot {
  background: #ffffff;
  color: #1e3a8a;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.85);
}

.tour-hotspot-pin.is-passed .tour-hotspot-pin__dot {
  background: #10b981;
  color: #ffffff;
}

.tour-hotspot-pin__label {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: max-width 0.22s ease, opacity 0.18s ease;
}

.tour-hotspot-pin:hover .tour-hotspot-pin__label,
.tour-hotspot-pin:focus-visible .tour-hotspot-pin__label {
  max-width: 220px;
  opacity: 1;
}

/* Autoplay Controls e Barra de Progresso Cinematográfica */
.tour-autoplay-bar {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.tour-autoplay-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #3b82f6);
  border-radius: 2px;
  transition: width 0.1s linear;
}

.tour-btn--autoplay {
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 6px;
  font-weight: 650;
  transition: all 0.18s ease;
}

.tour-btn--autoplay:hover {
  background: rgba(56, 189, 248, 0.28);
  border-color: #38bdf8;
  color: #ffffff;
}

.tour-btn--autoplay.is-playing {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.55);
  color: #fde68a;
}

.tour-speed-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 7px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tour-speed-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.tour-timer-badge {
  font-size: 11px;
  font-weight: 600;
  color: #60a5fa;
  margin-left: 2px;
}

.tour-keyboard-hints {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  font-size: 11px;
  color: #64748b;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 10px;
  margin-top: 4px;
}

.tour-keyboard-hints kbd {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: inherit;
  font-size: 10px;
  color: #cbd5e1;
}

@media (max-width: 1180px) {
  .tour-hotspots-container {
    display: none !important;
  }
}

@media (max-width: 640px) {
  .tour-popover {
    left: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
    top: auto !important;
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    max-height: 46vh !important;
    padding: 14px 16px !important;
    gap: 10px !important;
  }
  .tour-popover__title {
    font-size: 15px;
  }
  .tour-popover__desc {
    font-size: 12.5px;
    line-height: 1.45;
  }
  .tour-beacon__badge,
  .tour-keyboard-hints {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tour-spotlight,
  .tour-popover,
  .tour-beacon,
  .tour-beacon__ring,
  .tour-beacon__core,
  .tour-beacon__badge,
  .tour-beacon__arrow,
  .tour-connector-path,
  .tour-hotspot-pin {
    animation: none !important;
    transition: none !important;
  }
}



