/**
 * tour.css — Estilos do sistema de tour guiado
 *
 * Componentes:
 * - .tour-overlay   — overlay escuro de fundo
 * - .tour-highlight — borda azul + box-shadow que recorta o elemento destacado
 * - .tour-tooltip   — tooltip com informações e botões
 * - Responsividade e temas
 */

/* ============================================================================
   OVERLAY ESCURO
   ========================================================================== */

.tour-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 10000;
  display: none;
}

/* ============================================================================
   HIGHLIGHT — recorte spotlight ao redor do elemento
   ========================================================================== */

.tour-highlight {
  position: fixed;
  border: 3px solid #3b82f6;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7);
  z-index: 10001;
  pointer-events: none;
  display: none;
}

/* ============================================================================
   TOOLTIP
   ========================================================================== */

.tour-tooltip {
  position: fixed;
  background: #1e293b;
  color: #f1f5f9;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  z-index: 10002;
  max-width: 340px;
  min-width: 280px;
  overflow: hidden;
  display: none;
  font-family: 'Poppins', sans-serif;
}

/* Tema Light */
.tour-tooltip-light {
  background: #f1f5f9;
  color: #0f172a;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.tour-tooltip-light .tour-tooltip-title {
  color: #0f172a;
}

.tour-tooltip-light .tour-tooltip-description {
  color: #475569;
}

.tour-tooltip-light .tour-step-badge {
  background: rgba(15, 23, 42, 0.08);
  color: #475569;
}

.tour-tooltip-light .tour-tooltip-content {
  border-bottom-color: rgba(15, 23, 42, 0.1);
}

/* ============================================================================
   CONTEÚDO DO TOOLTIP
   ========================================================================== */

.tour-tooltip-content {
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tour-tooltip-title {
  margin: 0 0 10px 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  color: #f1f5f9;
}

.tour-tooltip-description {
  margin: 0 0 14px 0;
  font-size: 14px;
  line-height: 1.6;
  color: #cbd5e1;
  letter-spacing: 0.3px;
  white-space: pre-line;
}

.tour-step-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ============================================================================
   BOTÕES DE AÇÃO
   ========================================================================== */

.tour-tooltip-actions {
  display: flex;
  gap: 8px;
  padding: 16px 24px;
  justify-content: flex-end;
  flex-wrap: wrap;
  align-items: center;
}

.tour-btn {
  padding: 9px 18px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.3px;
  white-space: nowrap;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Poppins', sans-serif;
  text-decoration: none;
}

/* Botão Primário (Próximo/Concluir) */
.tour-btn-primary {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.tour-btn-primary:hover {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
}

.tour-btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

/* Botão Secundário (Anterior) */
.tour-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.tour-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
}

/* Botão Ghost (Pular) */
.tour-btn-ghost {
  background: transparent;
  color: #64748b;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  margin-right: auto;
}

.tour-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  border-color: rgba(255, 255, 255, 0.25);
}

/* Variações para tema light */
.tour-tooltip-light .tour-btn-secondary {
  background: rgba(15, 23, 42, 0.08);
  color: #334155;
  border-color: rgba(15, 23, 42, 0.15);
}

.tour-tooltip-light .tour-btn-secondary:hover {
  background: rgba(15, 23, 42, 0.13);
}

.tour-tooltip-light .tour-btn-ghost {
  color: #94a3b8;
  border-color: rgba(15, 23, 42, 0.12);
}

.tour-tooltip-light .tour-btn-ghost:hover {
  background: rgba(15, 23, 42, 0.06);
  color: #64748b;
}

/* ============================================================================
   RESPONSIVIDADE
   ========================================================================== */

/* Notebook (1024–1366px) — viewport estreito + sidebar de 270px */
@media (max-width: 1366px) and (min-width: 769px) {
  .tour-tooltip {
    max-width: 270px;
    min-width: 220px;
  }

  .tour-tooltip-content {
    padding: 16px 18px;
  }

  .tour-tooltip-title {
    font-size: 14px;
  }

  .tour-tooltip-description {
    font-size: 12px;
    margin-bottom: 10px;
  }

  .tour-tooltip-actions {
    padding: 10px 18px;
    gap: 6px;
  }

  .tour-btn {
    padding: 7px 12px;
    font-size: 12px;
  }
}

@media (max-width: 768px) {
  .tour-tooltip {
    max-width: 85vw;
  }

  .tour-tooltip-content {
    padding: 18px 20px;
  }

  .tour-tooltip-title {
    font-size: 15px;
  }

  .tour-tooltip-description {
    font-size: 13px;
  }

  .tour-tooltip-actions {
    padding: 12px 20px;
  }

  .tour-btn {
    padding: 8px 14px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .tour-tooltip {
    max-width: 92vw;
    min-width: 0;
  }

  .tour-tooltip-content {
    padding: 14px 16px;
  }

  .tour-tooltip-actions {
    flex-direction: column;
    padding: 12px 16px;
  }

  .tour-btn-ghost {
    margin-right: 0;
    order: 3;
    width: 100%;
  }

  .tour-btn-secondary,
  .tour-btn-primary {
    width: 100%;
  }
}

/* ============================================================================
   ACESSIBILIDADE
   ========================================================================== */

.tour-btn:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.tour-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

@media (prefers-contrast: more) {
  .tour-tooltip {
    box-shadow: 0 0 0 3px #3b82f6;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tour-tooltip,
  .tour-btn {
    transition: none !important;
    animation: none !important;
  }
}

/* ============================================================================
   WELCOME MODAL
   ========================================================================== */

.welcome-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 10010;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: tour-fade-in 0.3s ease;
}

.welcome-modal-backdrop.hidden {
  display: none;
}

.welcome-modal {
  background: #1e2435;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 2.5rem 2rem 2rem;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  animation: tour-slide-up 0.35s ease;
}

.welcome-modal-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.25rem;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: #fff;
}

.welcome-modal-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0 0 0.5rem;
}

.welcome-modal-subtitle {
  font-size: 0.875rem;
  color: #94a3b8;
  margin: 0 0 1.5rem;
  line-height: 1.6;
}

.welcome-modal-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  margin: 0 0 1.5rem;
}

.welcome-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.welcome-modal-actions .tour-btn {
  width: 100%;
  justify-content: center;
  font-size: 0.9rem;
}

@media (max-width: 480px) {
  .welcome-modal {
    padding: 2rem 1.25rem 1.5rem;
  }
  .welcome-modal-title {
    font-size: 1.2rem;
  }
}

/* ==========================================================================
   EXIT / END-OF-TOUR MODAL
   ========================================================================== */

.exit-modal-logo { background: linear-gradient(135deg, #10b981, #059669); }

.exit-modal-nav-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
  margin-bottom: 0.75rem;
}

.exit-modal-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.exit-modal-nav-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0.75rem 0.5rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.04);
  color: #cbd5e1;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  text-align: center;
}
.exit-modal-nav-card:hover {
  background: rgba(59,130,246,0.12);
  border-color: rgba(59,130,246,0.3);
  color: #93c5fd;
}
.exit-modal-nav-card i      { font-size: 1.25rem; }
.exit-modal-nav-card strong { font-size: 0.8rem; font-weight: 600; display: block; }
.exit-modal-nav-card span   { font-size: 0.7rem; color: #64748b; }

@media (max-width: 480px) {
  .exit-modal-nav { gap: 0.375rem; }
  .exit-modal-nav-card { padding: 0.625rem 0.25rem; }
  .exit-modal-nav-card strong { font-size: 0.72rem; }
}
