/* ============================================
   TOUR GUIADO - SISTEMA DE ONBOARDING
   ============================================ */

/* Overlay del tour */
.tour-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(3px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.tour-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* Spotlight - Resalta el elemento actual */
.tour-spotlight {
  position: absolute;
  border: 4px solid #6366f1;
  border-radius: 12px;
  /* Fondo claro para destacar el elemento */
  background: rgba(255, 255, 255, 0.05);
  /* Shadow que oscurece todo alrededor pero deja el elemento claro */
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.85),
              0 0 50px rgba(99, 102, 241, 0.9),
              0 0 80px rgba(99, 102, 241, 0.6),
              inset 0 0 0 2px rgba(255, 255, 255, 0.3);
  pointer-events: none;
  z-index: 9999;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  animation: pulse-spotlight 2.5s ease-in-out infinite;
}

@keyframes pulse-spotlight {
  0%, 100% {
    border-color: #6366f1;
    border-width: 4px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.85),
                0 0 50px rgba(99, 102, 241, 0.9),
                0 0 80px rgba(99, 102, 241, 0.6),
                inset 0 0 0 2px rgba(255, 255, 255, 0.3);
  }
  50% {
    border-color: #818cf8;
    border-width: 5px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.85),
                0 0 60px rgba(129, 140, 248, 1),
                0 0 100px rgba(129, 140, 248, 0.8),
                inset 0 0 0 3px rgba(255, 255, 255, 0.4);
  }
}

/* Tooltip del tour */
.tour-tooltip {
  position: fixed;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
              0 0 0 1px rgba(0, 0, 0, 0.1);
  z-index: 10000;
  max-width: 420px;
  min-width: 320px;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

[data-theme="dark"] .tour-tooltip {
  background: var(--color-surface);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6),
              0 0 0 1px rgba(255, 255, 255, 0.1);
}

.tour-tooltip.active {
  opacity: 1;
  transform: scale(1);
}

/* Header del tooltip */
.tour-tooltip-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, #818cf8 100%);
  padding: 20px 24px;
  color: white;
  position: relative;
  overflow: hidden;
}

.tour-tooltip-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  animation: shine 3s ease-in-out infinite;
}

@keyframes shine {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-30%, -30%); }
}

.tour-tooltip-icon {
  font-size: 32px;
  margin-bottom: 8px;
  display: inline-block;
  animation: bounce-icon 2s ease-in-out infinite;
}

@keyframes bounce-icon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.tour-tooltip-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px 0;
  line-height: 1.3;
  position: relative;
  z-index: 1;
}

.tour-tooltip-subtitle {
  font-size: 14px;
  opacity: 0.95;
  margin: 0;
  position: relative;
  z-index: 1;
}

/* Body del tooltip */
.tour-tooltip-body {
  padding: 24px;
}

.tour-tooltip-content {
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text);
  margin-bottom: 20px;
}

/* Lista de características */
.tour-features {
  list-style: none;
  padding: 0;
  margin: 16px 0;
}

.tour-features li {
  padding: 8px 0;
  padding-left: 28px;
  position: relative;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.tour-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--color-success);
  font-weight: bold;
  font-size: 16px;
}

/* Footer con botones */
.tour-tooltip-footer {
  padding: 0 24px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tour-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.tour-progress-dots {
  display: flex;
  gap: 6px;
}

.tour-progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-border);
  transition: all 0.3s ease;
}

.tour-progress-dot.active {
  background: var(--color-primary);
  width: 24px;
  border-radius: 4px;
}

.tour-buttons {
  display: flex;
  gap: 8px;
}

.tour-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tour-btn-skip {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.tour-btn-skip:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-text-secondary);
}

.tour-btn-prev {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.tour-btn-prev:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.tour-btn-next,
.tour-btn-start {
  background: linear-gradient(135deg, var(--color-primary) 0%, #818cf8 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.tour-btn-next:hover,
.tour-btn-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.tour-btn-finish {
  background: linear-gradient(135deg, var(--color-success) 0%, #10b981 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.tour-btn-finish:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* Modal de bienvenida */
.tour-welcome-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: white;
  border-radius: 24px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
  z-index: 10001;
  max-width: 600px;
  width: 90%;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .tour-welcome-modal {
  background: var(--color-surface);
}

.tour-welcome-modal.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: all;
}

.tour-welcome-hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, #818cf8 100%);
  padding: 48px 32px;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.tour-welcome-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.3;
}

.tour-welcome-icon {
  font-size: 64px;
  margin-bottom: 16px;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.tour-welcome-title {
  font-size: 32px;
  font-weight: 800;
  margin: 0 0 8px 0;
  position: relative;
  z-index: 1;
}

.tour-welcome-subtitle {
  font-size: 18px;
  opacity: 0.95;
  margin: 0;
  position: relative;
  z-index: 1;
}

.tour-welcome-content {
  padding: 32px;
}

.tour-welcome-description {
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
  text-align: center;
}

.tour-welcome-benefits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.tour-benefit-card {
  padding: 16px;
  background: var(--color-surface);
  border-radius: 12px;
  border: 1px solid var(--color-border);
  text-align: center;
  transition: all 0.3s ease;
}

.tour-benefit-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
  border-color: var(--color-primary);
}

.tour-benefit-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.tour-benefit-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.tour-welcome-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Animación de entrada */
@keyframes slideInFromBottom {
  from {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.tour-welcome-modal.entering {
  animation: slideInFromBottom 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Arrow apuntando al elemento */
.tour-arrow {
  position: absolute;
  width: 20px;
  height: 20px;
  background: white;
  z-index: 9999;
  pointer-events: none;
}

[data-theme="dark"] .tour-arrow {
  background: var(--color-surface);
}

.tour-arrow[data-position="top"] {
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.tour-arrow[data-position="bottom"] {
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  box-shadow: -2px -2px 4px rgba(0, 0, 0, 0.1);
}

.tour-arrow[data-position="left"] {
  right: -10px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  box-shadow: 2px -2px 4px rgba(0, 0, 0, 0.1);
}

.tour-arrow[data-position="right"] {
  left: -10px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  box-shadow: -2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
  .tour-tooltip {
    max-width: 90vw;
    min-width: unset;
  }

  .tour-welcome-modal {
    width: 95%;
  }

  .tour-welcome-title {
    font-size: 24px;
  }

  .tour-welcome-benefits {
    grid-template-columns: 1fr;
  }

  .tour-tooltip-footer {
    flex-wrap: wrap;
  }

  .tour-buttons {
    width: 100%;
    justify-content: space-between;
  }
}
