/* ============================================================================
   Tour interactivo de Centella Agent
   ============================================================================ */

.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;  /* SIEMPRE deja pasar clicks: el dim es solo visual */
  background: transparent;
  transition: opacity 0.2s;
  /* El dimming lo hace el box-shadow gigante del spotlight, no apilamos capas. */
}
/* Cuando NO hay target (welcome), oscurecemos un poco para dar foco al modal central */
.tour-overlay.no-target {
  background: rgba(15, 25, 35, 0.72);
  backdrop-filter: blur(2px);
}

.tour-spotlight {
  position: fixed;
  z-index: 9001;
  pointer-events: none;
  border: 3px solid var(--accent, #57cc98);
  border-radius: 8px;
  /* Una sola capa de dim alrededor del foco (sin apilar con .tour-overlay) */
  box-shadow: 0 0 0 9999px rgba(15, 25, 35, 0.62), 0 0 24px rgba(87, 204, 152, 0.7);
  transition: top 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              left 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: tourPulse 2.2s ease-in-out infinite;
}
.tour-spotlight.no-target {
  display: none;
}
@keyframes tourPulse {
  0%, 100% { box-shadow: 0 0 0 9999px rgba(15, 25, 35, 0.62), 0 0 24px rgba(87, 204, 152, 0.55); }
  50% { box-shadow: 0 0 0 9999px rgba(15, 25, 35, 0.62), 0 0 38px rgba(87, 204, 152, 0.95); }
}

.tour-tooltip {
  position: fixed;
  z-index: 9002;
  width: 420px;
  max-width: calc(100vw - 24px);
  background: #1a2735;
  border: 1px solid #3fa37a;
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(87, 204, 152, 0.2);
  color: #e8eef5;
  font-family: 'Poppins', -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  transition: top 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tour-tooltip-arrow {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #1a2735;
  transform: rotate(45deg);
  border: 1px solid #3fa37a;
}
.tour-tooltip-arrow.top { top: -8px; left: 50%; margin-left: -7px; border-right: none; border-bottom: none; }
.tour-tooltip-arrow.bottom { bottom: -8px; left: 50%; margin-left: -7px; border-left: none; border-top: none; }
.tour-tooltip-arrow.left { left: -8px; top: 50%; margin-top: -7px; border-top: none; border-right: none; }
.tour-tooltip-arrow.right { right: -8px; top: 50%; margin-top: -7px; border-bottom: none; border-left: none; }

.tour-tooltip-step {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #57cc98;
  font-weight: 700;
  margin-bottom: 10px;
}
.tour-tooltip-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #ffffff;
  line-height: 1.25;
}
.tour-tooltip-body {
  color: #cbd6e3;
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.55;
}
.tour-tooltip-body strong {
  color: #ffffff;
  font-weight: 700;
}
.tour-tooltip-body code {
  background: rgba(87, 204, 152, 0.18);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 11px;
  color: #7dd9af;
  font-weight: 500;
}
.tour-tooltip-body kbd {
  background: rgba(87, 204, 152, 0.15);
  border: 1px solid rgba(87, 204, 152, 0.5);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 11px;
  color: #7dd9af;
  font-weight: 500;
}
.tour-tooltip-body em {
  color: #fbbf24;
  font-style: normal;
  font-weight: 600;
}

/* Cuando hay muchos pasos, los dots no caben → barra fina + flex-wrap */
/* Hint de atajos de teclado debajo del body */
.tour-tooltip-keys {
  font-size: 10px;
  color: rgba(203, 214, 227, 0.55);
  margin-bottom: 12px;
  text-align: center;
  letter-spacing: 0.3px;
}
.tour-tooltip-keys kbd {
  display: inline-block;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom-width: 2px;
  border-radius: 3px;
  padding: 1px 5px;
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  color: #cbd6e3;
  margin: 0 1px;
}

.tour-tooltip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.tour-tooltip-progress.as-dots {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  flex: 0 1 auto;
  max-width: 60%;
}
.tour-tooltip-progress.as-bar {
  flex: 1 1 100%;            /* ocupa toda una línea, los botones bajan */
  height: 3px;
  background: rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}
.tour-tooltip-progressbar {
  width: 100%;
  height: 100%;
  position: relative;
}
.tour-tooltip-progressbar-fill {
  height: 100%;
  background: linear-gradient(90deg, #57cc98 0%, #6fdba9 100%);
  border-radius: 999px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.tour-tooltip-progress-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  transition: all 0.2s;
}
.tour-tooltip-progress-dot.done { background: #3fa37a; }
.tour-tooltip-progress-dot.active {
  background: #57cc98;
  width: 18px;
  border-radius: 3px;
  box-shadow: 0 0 8px rgba(87, 204, 152, 0.5);
}

.tour-tooltip-buttons { display: flex; gap: 6px; }

.tour-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.tour-btn-primary { background: #57cc98; color: #0f1923; }
.tour-btn-primary:hover { background: #6fdba9; }
.tour-btn-secondary {
  background: rgba(255,255,255,0.06);
  color: #cbd6e3;
  border: 1px solid #3b4d61;
}
.tour-btn-secondary:hover { background: rgba(87,204,152,0.12); color: #ffffff; border-color: #57cc98; }
.tour-btn-skip {
  background: transparent;
  color: #94a8be;
  font-weight: 500;
  font-size: 12px;
  padding: 8px 10px;
  border: none;
}
.tour-btn-skip:hover { color: #ffffff; }

/* Welcome step (no target, centered) */
.tour-tooltip.welcome {
  width: 500px;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%);
  text-align: center;
  padding: 36px 38px 28px;
}
.tour-tooltip.welcome .tour-tooltip-step { display: none; }
.tour-tooltip.welcome .tour-tooltip-title {
  font-size: 26px;
  margin-bottom: 14px;
  margin-top: 4px;
  color: #ffffff;
  font-weight: 700;
  line-height: 1.2;
}
.tour-tooltip.welcome .tour-tooltip-body {
  font-size: 14px;
  max-width: 440px;
  margin: 0 auto 24px;
  color: #cbd6e3;
  line-height: 1.6;
}
.tour-tooltip.welcome .tour-tooltip-body strong { color: #57cc98; font-weight: 700; }
.tour-tooltip.welcome .tour-tooltip-arrow { display: none; }
.tour-tooltip.welcome .tour-tooltip-actions { justify-content: center; }

.tour-welcome-icon {
  width: 64px; height: 64px;
  margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 16px;
  background: linear-gradient(135deg, #57cc98 0%, #3fa37a 100%);
  color: #0f1923;
  font-size: 26px;
  font-weight: 700;
  box-shadow: 0 8px 30px rgba(87, 204, 152, 0.45);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  letter-spacing: -1px;
}

/* Tour relaunch button (always visible in toolbar) */
.tour-launch-btn,
.ag-pill-actions .ag-btn-demo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px !important;
  background: linear-gradient(135deg, rgba(87, 204, 152, 0.12) 0%, rgba(87, 204, 152, 0.05) 100%) !important;
  border: 1px solid var(--accent-dim, #3fa37a) !important;
  border-radius: 6px !important;
  color: var(--accent, #57cc98) !important;
  font-size: 12px;
  font-weight: 600 !important;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  height: auto !important;
}
.tour-launch-btn:hover,
.ag-pill-actions .ag-btn-demo:hover {
  background: rgba(87, 204, 152, 0.2) !important;
  border-color: var(--accent, #57cc98) !important;
}

/* Highlight pulse animation for waited-for actions */
.tour-wait-action-hint {
  position: absolute;
  z-index: 9003;
  pointer-events: none;
  background: var(--accent, #57cc98);
  color: #0f1923;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  animation: tourBounce 1.2s ease-in-out infinite;
  box-shadow: 0 4px 12px rgba(87, 204, 152, 0.4);
}
@keyframes tourBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Panel persistente del demo standalone (queda visible tras cerrar tour) */
.tour-demo-panel {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 8500;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #1a2735 0%, #1f3245 100%);
  border: 1px solid #57cc98;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(87, 204, 152, 0.3);
  color: #e8eef5;
  font-family: 'Poppins', -apple-system, sans-serif;
  font-size: 13px;
  max-width: 460px;
  animation: tourDemoPanelIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes tourDemoPanelIn {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.tour-demo-panel-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}
.tour-demo-panel-content { flex: 1; min-width: 0; }
.tour-demo-panel-title {
  font-weight: 700;
  font-size: 13px;
  color: #57cc98;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.tour-demo-panel-text {
  font-size: 12px;
  line-height: 1.4;
  color: #cbd6e3;
}
.tour-demo-panel-text strong { color: #ffffff; }
.tour-demo-panel-cleanup {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #ff8b8b;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s;
}
.tour-demo-panel-cleanup:hover {
  background: rgba(239, 68, 68, 0.30);
  border-color: #ef4444;
  color: #ffffff;
}

/* Mobile responsive */
@media (max-width: 700px) {
  .tour-tooltip { width: calc(100vw - 28px); }
  .tour-tooltip.welcome { width: calc(100vw - 28px); }
  .tour-demo-panel { left: 12px; right: 12px; bottom: 12px; max-width: none; }
}
