/* tour-guiado.css — Sistema de Tour Guiado Interativo (Onboarding) */

:root {
  --tour-primary: #10b981;
  --tour-primary-hover: #059669;
  --tour-primary-dark: #047857;
  --tour-bg: #ffffff;
  --tour-text: #1e293b;
  --tour-text-muted: #64748b;
  --tour-border: rgba(16, 185, 129, 0.25);
  --tour-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.25), 0 10px 15px -5px rgba(0, 0, 0, 0.15);
  --tour-backdrop: rgba(15, 23, 42, 0.65);
}

[data-theme="dark"],
body.dark-mode {
  --tour-bg: #1e293b;
  --tour-text: #f8fafc;
  --tour-text-muted: #cbd5e1;
  --tour-border: rgba(16, 185, 129, 0.4);
  --tour-shadow: 0 25px 35px -10px rgba(0, 0, 0, 0.6), 0 15px 20px -5px rgba(0, 0, 0, 0.4);
  --tour-backdrop: rgba(3, 7, 18, 0.82);
}

/* ── BACKDROP OVERLAY COM SPOTLIGHT ── */
.tour-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99990;
  pointer-events: none;
  display: none;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.tour-overlay.active {
  display: block !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Máscara de spotlight via SVG sobreposto */
.tour-backdrop-svg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  cursor: pointer;
}

/* Destaque no elemento alvo (Spotlight Focus Ring) */
.tour-target-highlight {
  position: fixed;
  border-radius: 10px;
  box-shadow: 0 0 0 4px #10b981, 0 0 25px rgba(16, 185, 129, 0.65);
  pointer-events: none;
  z-index: 99995;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  animation: tourGlowPulse 2s infinite;
}

@keyframes tourGlowPulse {
  0% {
    box-shadow: 0 0 0 3px #10b981, 0 0 15px rgba(16, 185, 129, 0.5);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.8), 0 0 30px rgba(16, 185, 129, 0.85);
  }
  100% {
    box-shadow: 0 0 0 3px #10b981, 0 0 15px rgba(16, 185, 129, 0.5);
  }
}

/* ── BALÃO DE DIÁLOGO / POPOVER ── */
.tour-popover {
  position: fixed;
  z-index: 100000;
  width: 480px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  background: var(--tour-bg);
  color: var(--tour-text);
  border-radius: 14px;
  border: 1.5px solid var(--tour-border);
  box-shadow: var(--tour-shadow);
  padding: 20px 22px;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  display: none;
  opacity: 0;
  transform: scale(0.95) translateY(6px);
  transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1), transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), top 0.25s ease, left 0.25s ease;
  pointer-events: none;
}

.tour-popover::-webkit-scrollbar {
  width: 5px;
}
.tour-popover::-webkit-scrollbar-thumb {
  background: rgba(16, 185, 129, 0.35);
  border-radius: 4px;
}

.tour-popover.visible {
  display: block !important;
  opacity: 1 !important;
  transform: scale(1) translateY(0);
  pointer-events: auto !important;
}

.tour-popover a,
.tour-popover button,
.tour-popover .tour-btn,
.tour-popover .tour-close-btn,
.tour-popover .tour-btn-skip {
  pointer-events: auto !important;
  cursor: pointer;
}

/* ── SETA INDICATIVA (ARROW) ── */
.tour-arrow {
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--tour-bg);
  border: 1.5px solid var(--tour-border);
  transform: rotate(45deg);
  z-index: -1;
}

.tour-popover[data-placement="bottom"] .tour-arrow {
  top: -8px;
  left: 36px;
  border-bottom: none;
  border-right: none;
}

.tour-popover[data-placement="top"] .tour-arrow {
  bottom: -8px;
  left: 36px;
  border-top: none;
  border-left: none;
}

.tour-popover[data-placement="left"] .tour-arrow {
  right: -8px;
  top: 24px;
  border-bottom: none;
  border-left: none;
}

.tour-popover[data-placement="right"] .tour-arrow {
  left: -8px;
  top: 24px;
  border-top: none;
  border-right: none;
}

/* ── CABEÇALHO DO TOUR ── */
.tour-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.tour-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tour-icon-badge {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
}

.tour-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--tour-text);
  margin: 0;
  line-height: 1.3;
}

.tour-close-btn {
  background: none;
  border: none;
  color: var(--tour-text-muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  margin: -4px -4px 0 0;
  border-radius: 6px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tour-close-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

/* ── CORPO DO TEXTO ── */
.tour-body {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--tour-text-muted);
  margin-bottom: 18px;
}

.tour-body p {
  margin: 0 0 8px 0;
}

.tour-body p:last-child {
  margin-bottom: 0;
}

.tour-body strong {
  color: var(--tour-text);
  font-weight: 600;
}

.tour-highlight-tag {
  display: inline-block;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.82rem;
  margin-top: 4px;
}

[data-theme="dark"] .tour-highlight-tag,
body.dark-mode .tour-highlight-tag {
  color: #34d399;
  background: rgba(16, 185, 129, 0.22);
}

/* ── GRÁFICOS E LINKS DO TOUR ── */
.tour-chart-links-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 6px 0;
  max-height: 230px;
  overflow-y: auto;
  padding-right: 4px;
}

.tour-chart-links-list::-webkit-scrollbar {
  width: 4px;
}
.tour-chart-links-list::-webkit-scrollbar-thumb {
  background: rgba(16, 185, 129, 0.35);
  border-radius: 4px;
}

.tour-chart-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.22);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto !important;
  cursor: pointer;
}

[data-theme="dark"] .tour-chart-card,
body.dark-mode .tour-chart-card {
  background: rgba(16, 185, 129, 0.10);
  border-color: rgba(16, 185, 129, 0.3);
}

.tour-chart-card:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.18);
}

.tour-chart-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.tour-chart-info {
  flex: 1;
  min-width: 0;
}

.tour-chart-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--tour-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 2px;
}

.tour-chart-title i {
  font-size: 0.75rem;
  color: #10b981;
  transition: transform 0.2s ease;
}

.tour-chart-card:hover .tour-chart-title i {
  transform: translate(2px, -2px);
}

.tour-chart-desc {
  font-size: 0.74rem;
  color: var(--tour-text-muted);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── DESCRIÇÃO DOS GRÁFICOS DA HOME ── */
.tour-home-charts-desc {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 10px 0;
}

.tour-home-chart-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.45;
}

[data-theme="dark"] .tour-home-chart-item,
body.dark-mode .tour-home-chart-item {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
}

.tour-home-chart-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.tour-support-list {
  margin: 10px 0 12px 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tour-support-list li {
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--tour-text-muted);
  background: rgba(15, 23, 42, 0.03);
  padding: 6px 10px;
  border-radius: 8px;
  border-left: 3px solid #10b981;
}

[data-theme="dark"] .tour-support-list li,
body.dark-mode .tour-support-list li {
  background: rgba(255, 255, 255, 0.05);
}

.tour-inline-link {
  color: #10b981;
  text-decoration: underline;
  font-weight: 600;
}
.tour-inline-link:hover {
  color: #059669;
}

/* ── RODAPÉ E BOTÕES DE AÇÃO ── */
.tour-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.tour-progress-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}

.tour-step-counter {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--tour-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-block;
}

.tour-dots-indicator {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.tour-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.35);
  transition: all 0.2s ease;
}

.tour-dot.active {
  width: 14px;
  border-radius: 4px;
  background: #10b981;
}

.tour-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.tour-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  font-family: inherit;
  line-height: 1;
  white-space: nowrap;
}

.tour-btn-prev {
  background: transparent;
  color: var(--tour-text-muted);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.tour-btn-prev:hover:not(:disabled) {
  background: rgba(148, 163, 184, 0.12);
  color: var(--tour-text);
}

.tour-btn-prev:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.tour-btn-next {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.35);
}

.tour-btn-next:hover {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.45);
  transform: translateY(-1px);
}

.tour-btn-skip {
  background: transparent;
  color: var(--tour-text-muted);
  font-size: 0.8rem;
  padding: 6px 10px;
  text-decoration: underline;
  border: none;
  cursor: pointer;
}

.tour-btn-skip:hover {
  color: var(--tour-text);
}

/* ── BOTÃO FLUTUANTE REATIVAR TOUR (Opcional) ── */
.tour-floating-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 990;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border: none;
  border-radius: 50px;
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.tour-floating-launcher:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 25px rgba(16, 185, 129, 0.5);
}

/* ── RESPONSIVIDADE MOBILE ── */
@media (max-width: 640px) {
  .tour-popover {
    width: calc(100vw - 24px);
    left: 12px !important;
    right: 12px !important;
    padding: 16px 18px;
  }

  .tour-arrow {
    display: none; /* Seta oculta em mobile para layout centralizado limpo */
  }

  .tour-title {
    font-size: 0.96rem;
  }

  .tour-body {
    font-size: 0.84rem;
  }

  .tour-footer {
    flex-wrap: wrap;
    gap: 12px;
  }

  .tour-actions-group {
    width: 100%;
    justify-content: flex-end;
  }
}
