/* ============================================================================
   Centella · Master Tutorial styling
   ============================================================================
   Reusa .tour-overlay/.tour-spotlight/.tour-tooltip de agent-tour.css.
   Aquí solo lo específico del tutorial maestro: barra de progreso, estados
   de step (do/verify/explain), pulse, botones, pause menu, launcher.
   ============================================================================ */

/* ─── Launcher en el header ─── */
.mt-launcher {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22) 0%, rgba(99, 102, 241, 0.08) 100%);
  color: #B6BBFE;
  border: 1px solid rgba(99, 102, 241, 0.45);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  margin-right: 6px;
  transition: all 0.15s;
}
.mt-launcher:hover {
  background: rgba(99, 102, 241, 0.28);
  color: #FFFFFF;
}

/* ─── Barra de progreso fija arriba ─── */
.mt-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9100;
  height: 32px;
  background: rgba(15, 25, 35, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(99, 102, 241, 0.45);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 11px;
  color: #B6BBFE;
}
.mt-progress::before {
  content: "📚 Tutorial Maestro";
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-right: 6px;
  color: #B6BBFE;
}
.mt-progress-bar {
  flex: 1;
  height: 5px;
  background: rgba(99, 102, 241, 0.15);
  border-radius: 3px;
  overflow: hidden;
}
.mt-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366F1 0%, #8B5CF6 50%, #57CC98 100%);
  width: 0%;
  transition: width 240ms cubic-bezier(.2,.8,.2,1);
}
.mt-progress-label {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  min-width: 60px;
  text-align: right;
}
.mt-progress-pause {
  background: transparent;
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #B6BBFE;
  border-radius: 6px;
  padding: 2px 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  transition: all 0.12s;
}
.mt-progress-pause:hover {
  background: rgba(99, 102, 241, 0.2);
  color: #FFFFFF;
}

/* Cuando la barra de progreso está visible, empuja el header global hacia
   abajo para que no se solape. */
body:has(.mt-progress) .app-header {
  margin-top: 32px;
}

/* ─── Tooltip extendido ─── */
.mt-tooltip-title {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #FFFFFF;
}
.mt-tooltip-body {
  font-size: 13.5px;
  line-height: 1.55;
  color: #cfdde8;
}
.mt-tooltip-body code {
  background: #0F1923;
  color: #B6BBFE;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.mt-tooltip-body kbd {
  background: #0F1923;
  border: 1px solid #2A3F55;
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  color: #B6BBFE;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.mt-tooltip-body strong { color: #FFFFFF; }

.mt-station-outro {
  margin-top: 10px;
  padding: 9px 11px;
  background: rgba(87, 204, 152, 0.1);
  border-left: 3px solid #57CC98;
  border-radius: 6px;
  font-size: 12.5px;
  color: #cfdde8;
}

.mt-action-hint {
  margin-top: 10px;
  padding: 9px 11px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px dashed rgba(99, 102, 241, 0.55);
  border-radius: 6px;
  font-size: 12.5px;
  color: #B6BBFE;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mt-pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #6366F1;
  border-radius: 50%;
  animation: mtPulse 1.2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes mtPulse {
  0%, 100% { transform: scale(0.85); opacity: 0.7; }
  50% { transform: scale(1.25); opacity: 1; box-shadow: 0 0 14px rgba(99, 102, 241, 0.7); }
}
.mt-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(99, 102, 241, 0.3);
  border-top-color: #6366F1;
  border-radius: 50%;
  animation: mtSpin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes mtSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ─── Botones del tooltip ─── */
.mt-tooltip-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.mt-tooltip-actions > button {
  font-family: inherit;
  cursor: pointer;
  border-radius: 5px;
  padding: 6px 12px;
  font-size: 12.5px;
  transition: all 0.12s;
}
.mt-btn-skip {
  background: transparent;
  color: #5a6b7e;
  border: none;
  font-size: 11px;
  margin-right: auto;
}
.mt-btn-skip:hover { color: #9fb3c8; }
.mt-btn-back {
  background: transparent;
  color: #9fb3c8;
  border: 1px solid #2a3f55;
}
.mt-btn-back:hover { border-color: #3fa37a; color: #B6BBFE; }
.mt-btn-next {
  background: #6366F1;
  color: #FFFFFF;
  border: none;
  font-weight: 600;
}
.mt-btn-next:hover { filter: brightness(1.1); }

/* ─── Pause menu ─── */
.mt-pause-menu {
  position: fixed;
  inset: 0;
  z-index: 9200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mt-pause-bg {
  position: absolute;
  inset: 0;
  background: rgba(15, 25, 35, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.mt-pause-card {
  position: relative;
  background: #0F1923;
  border: 1px solid rgba(99, 102, 241, 0.5);
  border-radius: 14px;
  padding: 26px 30px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  color: #E8EEF5;
  font-family: 'Poppins', -apple-system, sans-serif;
  width: min(420px, 92vw);
  text-align: center;
}
.mt-pause-card h3 {
  margin: 0 0 8px 0;
  font-size: 20px;
  font-weight: 600;
  color: #FFFFFF;
}
.mt-pause-card p {
  margin: 0 0 18px 0;
  font-size: 13.5px;
  color: #9FB3C8;
}
.mt-pause-card button {
  display: block;
  width: 100%;
  margin: 6px 0;
  padding: 10px 14px;
  background: rgba(99, 102, 241, 0.12);
  color: #B6BBFE;
  border: 1px solid rgba(99, 102, 241, 0.45);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s;
}
.mt-pause-card button:hover {
  background: rgba(99, 102, 241, 0.22);
  color: #FFFFFF;
}
.mt-pause-card button[data-action="exit"] {
  color: #E0A8A8;
  border-color: rgba(220, 38, 38, 0.4);
  background: rgba(220, 38, 38, 0.08);
}
.mt-pause-card button[data-action="exit"]:hover {
  background: rgba(220, 38, 38, 0.18);
  color: #FFFFFF;
}

/* ─── Mobile ─── */
@media (max-width: 640px) {
  .mt-progress::before { content: "📚 Tutorial"; }
  .mt-progress { height: 36px; padding: 0 8px; }
  body:has(.mt-progress) .app-header { margin-top: 36px; }
}

/* Garantías de visibilidad del tooltip — aplica solo al maestro, no rompe
   los tours per-módulo. Cuando el motor del maestro está activo, el body
   tiene .mt-progress como hijo. */
body:has(.mt-progress) .tour-tooltip {
  max-width: min(420px, calc(100vw - 24px));
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}
body:has(.mt-progress) .tour-tooltip::-webkit-scrollbar {
  width: 6px;
}
body:has(.mt-progress) .tour-tooltip::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.5);
  border-radius: 3px;
}
