/*
  main.css — chrome exclusivo de la vista principal (index.html).
  Escala el canvas fijo de 1280x720 a la ventana real y dibuja los
  controles de navegación. Los controles viven FUERA del canvas escalado
  y son los únicos elementos con handler de click para avanzar/retroceder:
  el cuerpo de la slide nunca tiene un listener de click, así seleccionar
  texto con el mouse nunca dispara una navegación.

  Base: Competencias Gerenciales/deck/assets/main.css. Cambios: fondo del
  chrome pasado a gris oscuro cargado (nunca negro puro, pedido explícito
  de la cátedra), acento de progreso en lima, y un panel de índice nuevo
  para poder saltar a cualquier slide desde la vista compartida en clase
  (no solo desde presenter.html).
*/

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #17150f;
}

.stage-outer {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage {
  position: relative;
  flex: none;
  width: 1280px;
  height: 720px;
  transform-origin: center center;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.45);
}

.viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  /* Gris oscuro neutro (no var(--paper), que es la piel institutional por
     defecto): durante el fundido entre slides se asoma el fondo del
     viewport un instante, y si fuera claro se vería un flash claro al
     transicionar hacia/entre slides con piel signal. */
  background: #17150f;
}

/* Estados de transición (deslizamiento + fundido) */
.slide.is-entering-right { transform: translateX(3.5%); opacity: 0; }
.slide.is-entering-left { transform: translateX(-3.5%); opacity: 0; }
.slide.is-active { transform: translateX(0); opacity: 1; }
.slide.is-leaving-left { transform: translateX(-3.5%); opacity: 0; }
.slide.is-leaving-right { transform: translateX(3.5%); opacity: 0; }

/* ---------- Chrome fijo (fuera del canvas escalado) ---------- */
.chrome {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.progress-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: #c7e23e;
  transition: width 0.35s ease;
}

.toolbar-top {
  position: absolute;
  top: 20px;
  right: 24px;
  display: flex;
  gap: 10px;
  pointer-events: auto;
}

.ghost-btn {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #f4f1e6;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.15s ease, transform 0.15s ease;
  user-select: none;
}
.ghost-btn:hover { background: rgba(255, 255, 255, 0.16); }
.ghost-btn:active { transform: scale(0.97); }
.ghost-btn.small { font-size: 12px; padding: 6px 12px; }
.ghost-btn.is-active { background: #c7e23e; color: #1e1c17; border-color: transparent; }

.navbar-bottom {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 14px;
  background: rgba(23, 21, 15, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

.nav-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #f4f1e6;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
  user-select: none;
}
.nav-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.2); }
.nav-btn:active:not(:disabled) { transform: scale(0.94); }
.nav-btn:disabled {
  opacity: 0.28;
  cursor: default;
}

.navbar-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 190px;
  color: #f4f1e6;
  user-select: none;
}
.counter {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.act-label {
  font-size: 12px;
  color: rgba(244, 241, 230, 0.65);
  margin-top: 2px;
  text-align: center;
}

@media (max-width: 720px) {
  .toolbar-top .ghost-btn span.full { display: none; }
}

/* ---------- Panel de índice — saltar a cualquier slide desde la vista
   compartida en clase, sin depender de presenter.html ---------- */
.index-panel {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 14, 10, 0.72);
  backdrop-filter: blur(3px);
  pointer-events: auto;
}
.index-panel.is-open { display: flex; }
.index-panel-card {
  width: min(880px, 92vw);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  background: #211f18;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
.index-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.index-panel-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #f4f1e6;
}
.index-panel-hint {
  font-size: 12px;
  color: rgba(244, 241, 230, 0.55);
  margin-top: 3px;
}
.index-panel-body {
  overflow-y: auto;
  padding: 10px;
}
.index-act-title {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c7e23e;
  padding: 14px 12px 6px;
}
.index-item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: #e9e6d9;
  font-size: 14.5px;
  cursor: pointer;
  font-family: inherit;
}
.index-item:hover { background: rgba(255, 255, 255, 0.07); }
.index-item.is-current { background: rgba(199, 226, 62, 0.16); color: #f4f1e6; }
.index-item .num {
  font-variant-numeric: tabular-nums;
  color: #8d8975;
  width: 24px;
  flex: 0 0 auto;
}
.index-item.is-current .num { color: #c7e23e; }
