/* ==========================================================
   Tour / onboarding — popover posicionado al lado del target
   con backdrop oscurecido y cutout del elemento resaltado.
   ==========================================================
   Anatomía:
     .tour-backdrop  → overlay (capta clicks fuera del popover).
     .tour-cutout    → div con box-shadow 0 0 0 9999px que deja
                       un "agujero" sobre el elemento target.
     .tour-popover   → tarjeta con título, cuerpo, contador y
                       botones. Posicionado con top/left inline.
     .tour-arrow     → flecha triangular que apunta al target.
   ========================================================== */

.tour-backdrop {
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: transparent;          /* el oscurecido lo hace el cutout */
  pointer-events: auto;
}

.tour-cutout {
  position: fixed;
  z-index: 12001;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55),
              0 0 0 3px rgba(25, 118, 210, 0.9),
              0 0 14px 4px rgba(25, 118, 210, 0.35);
  pointer-events: none;
  transition: top .18s ease, left .18s ease,
              width .18s ease, height .18s ease;
}

.tour-popover {
  position: fixed;
  z-index: 12002;
  width: 320px;
  max-width: calc(100vw - 24px);
  background: #fff;
  color: #222;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  padding: 14px 14px 10px;
  font-size: 13px;
  line-height: 1.4;
  animation: tourPopIn .18s ease-out;
}

.tour-popover .tour-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: #1976d2;
  padding-right: 24px;             /* espacio para el close */
}

.tour-popover .tour-body {
  margin: 0 0 10px;
  color: #333;
}

.tour-popover .tour-body strong { color: #111; }

.tour-popover .tour-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}

.tour-popover .tour-counter {
  font-size: 12px;
  color: #666;
}

.tour-popover .tour-nav {
  display: flex;
  gap: 6px;
}

.tour-popover .tour-btn {
  border: 1px solid #ccc;
  background: #fff;
  color: #222;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  transition: background .12s, border-color .12s, transform .08s;
}
.tour-popover .tour-btn:hover { background: #f4f6f8; border-color: #999; }
.tour-popover .tour-btn:active { transform: scale(0.96); }
.tour-popover .tour-btn[disabled] {
  opacity: .35; cursor: not-allowed;
}
.tour-popover .tour-btn.primary {
  background: #1976d2; color: #fff; border-color: #1565c0;
}
.tour-popover .tour-btn.primary:hover { background: #1565c0; }

.tour-popover .tour-close {
  position: absolute;
  top: 8px; right: 8px;
  border: 0; background: transparent;
  width: 22px; height: 22px;
  color: #888; cursor: pointer;
  font-size: 16px; line-height: 1;
  border-radius: 4px;
}
.tour-popover .tour-close:hover { background: #eee; color: #222; }

/* Flecha — cuatro variantes según .placement-{top|right|bottom|left} */
.tour-popover .tour-arrow {
  position: absolute;
  width: 0; height: 0;
  border: 8px solid transparent;
}
.tour-popover.placement-right .tour-arrow {
  left: -16px; top: 20px;
  border-right-color: #fff;
}
.tour-popover.placement-left .tour-arrow {
  right: -16px; top: 20px;
  border-left-color: #fff;
}
.tour-popover.placement-bottom .tour-arrow {
  top: -16px; left: 24px;
  border-bottom-color: #fff;
}
.tour-popover.placement-top .tour-arrow {
  bottom: -16px; left: 24px;
  border-top-color: #fff;
}
.tour-popover.placement-center .tour-arrow { display: none; }

/* Dark mode (si el shell activa [data-theme="dark"] o .theme-dark) */
[data-theme="dark"] .tour-popover,
.theme-dark .tour-popover {
  background: #23272e; color: #e6e9ef;
}
[data-theme="dark"] .tour-popover .tour-title,
.theme-dark .tour-popover .tour-title { color: #6cb6ff; }
[data-theme="dark"] .tour-popover .tour-body,
.theme-dark .tour-popover .tour-body { color: #c9ced6; }
[data-theme="dark"] .tour-popover .tour-counter,
.theme-dark .tour-popover .tour-counter { color: #98a0ac; }
[data-theme="dark"] .tour-popover .tour-btn,
.theme-dark .tour-popover .tour-btn {
  background: #2c313a; border-color: #3a404b; color: #e6e9ef;
}
[data-theme="dark"] .tour-popover .tour-btn:hover,
.theme-dark .tour-popover .tour-btn:hover { background: #353b46; }
[data-theme="dark"] .tour-popover .tour-close:hover,
.theme-dark .tour-popover .tour-close:hover { background: #353b46; color: #fff; }
[data-theme="dark"] .tour-popover.placement-right .tour-arrow,
.theme-dark .tour-popover.placement-right .tour-arrow { border-right-color: #23272e; }
[data-theme="dark"] .tour-popover.placement-left .tour-arrow,
.theme-dark .tour-popover.placement-left .tour-arrow { border-left-color: #23272e; }
[data-theme="dark"] .tour-popover.placement-bottom .tour-arrow,
.theme-dark .tour-popover.placement-bottom .tour-arrow { border-bottom-color: #23272e; }
[data-theme="dark"] .tour-popover.placement-top .tour-arrow,
.theme-dark .tour-popover.placement-top .tour-arrow { border-top-color: #23272e; }

@keyframes tourPopIn {
  from { opacity: 0; transform: translateY(4px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* Estados responsive: en pantallas chicas, popover centrado abajo */
@media (max-width: 600px) {
  .tour-popover {
    left: 12px !important;
    right: 12px;
    top: auto !important;
    bottom: 12px;
    width: auto;
  }
  .tour-popover .tour-arrow { display: none; }
}
