/* ==========================================================================
   SISTEMA DE DISEÑO NEOBRUTALISTA - CRONOLOGÍA 4 REVOLUCIONES INDUSTRIALES
   ========================================================================== */

:root {
  --bg-page: #F5F1E9;
  --bg-card: #FFFFFF;
  --color-black: #000000;
  --color-white: #FFFFFF;
  --color-yellow: #FFE600;
  --color-red: #FF5252;
  --color-cyan: #00F0FF;
  --color-green: #00E676;
  --color-purple: #9D4EDD;
  --current-theme: #FFE600;

  --border-thick: 4px solid var(--color-black);
  --border-medium: 3px solid var(--color-black);
  --border-thin: 2px solid var(--color-black);

  --shadow-large: 8px 8px 0px var(--color-black);
  --shadow-medium: 5px 5px 0px var(--color-black);
  --shadow-small: 3px 3px 0px var(--color-black);

  --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-page);
  color: var(--color-black);
  font-family: var(--font-display);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(#000000 1px, transparent 1px);
  background-size: 24px 24px;
}

/* MARQUESINA SUPERIOR TICKER TAPE */
.top-ticker-banner {
  background: var(--color-black);
  color: var(--color-yellow);
  padding: 6px 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 800;
  border-bottom: var(--border-medium);
  overflow: hidden;
  white-space: nowrap;
}

.ticker-content {
  display: inline-block;
  animation: tickerScroll 24s linear infinite;
}

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* CONTENEDOR PRINCIPAL */
.main-wrapper {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  width: 100%;
  flex: 1;
}

/* CABECERA NEOBRUTALISTA */
.header-section {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  background: var(--color-white);
  border: var(--border-thick);
  box-shadow: var(--shadow-large);
  padding: 18px 24px;
}

.header-title-box h1 {
  font-size: clamp(1.4rem, 2.5vw, 2.2rem);
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: -0.5px;
}

.header-subtitle-tag {
  display: inline-block;
  background: var(--color-yellow);
  border: var(--border-thin);
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 800;
  margin-top: 6px;
  box-shadow: var(--shadow-small);
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* BOTONES NEOBRUTALISTAS GENERALES */
.neo-btn {
  background: var(--color-white);
  color: var(--color-black);
  border: var(--border-medium);
  box-shadow: var(--shadow-small);
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  text-transform: uppercase;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.1s ease;
  user-select: none;
}

.neo-btn:hover {
  background: var(--color-yellow);
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0px var(--color-black);
}

.neo-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0px var(--color-black);
}

.neo-btn.btn-active {
  background: var(--color-green);
}

.neo-btn-primary {
  background: var(--color-cyan);
}

/* MARCO DEL REPRODUCTOR DE VIDEO CINEMATOGRÁFICO */
.video-player-frame {
  position: relative;
  background: #0D0F12;
  border: var(--border-thick);
  box-shadow: var(--shadow-large);
  border-radius: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ÁREA DE PROYECCIÓN DE LA ESCENA (16:9 aprox adaptable) */
.video-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 560px;
  background: #FDFBF7;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* CANVAS DE GRÁFICOS Y ANIMACIONES PROCEDURALES */
.canvas-visuals {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* HUD SUPERIOR DEL VIDEO (Lower thirds / overlays) */
.video-hud-top {
  position: relative;
  z-index: 10;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}

.hud-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.badge-cluster {
  display: flex;
  gap: 8px;
  align-items: center;
}

.act-badge {
  background: var(--color-yellow);
  border: var(--border-medium);
  box-shadow: var(--shadow-small);
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 0.85rem;
}

.act-epoch {
  background: var(--color-black);
  color: var(--color-white);
  border: var(--border-medium);
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.85rem;
}

.active-tag-badge {
  background: var(--color-white);
  border: var(--border-thin);
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
  box-shadow: 2px 2px 0px #000;
}

.act-title-box {
  background: var(--color-white);
  border: var(--border-medium);
  box-shadow: var(--shadow-medium);
  padding: 6px 12px;
  display: inline-block;
}

.act-title-box h2 {
  font-size: 1.15rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hud-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.rec-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--color-white);
  border: var(--border-thin);
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 900;
  box-shadow: 2px 2px 0px #000;
}

.rec-dot {
  width: 10px;
  height: 10px;
  background-color: #FF0000;
  border-radius: 50%;
  animation: pulseDot 1s infinite alternate;
}

@keyframes pulseDot {
  from { opacity: 0.3; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1.1); }
}

.visualizer-box {
  background: var(--color-white);
  border: var(--border-medium);
  box-shadow: var(--shadow-small);
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.visualizer-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 900;
  text-transform: uppercase;
}

.canvas-visualizer {
  display: block;
}

/* OVERLAY INFORMATIVO Y EDUCATIVO (LOWER THIRDS) */
.video-hud-bottom {
  position: relative;
  z-index: 10;
  padding: 0 18px 12px;
  pointer-events: none;
}

.scene-info-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  background: rgba(255, 255, 255, 0.96);
  border: var(--border-thick);
  box-shadow: var(--shadow-medium);
  padding: 10px 16px;
  backdrop-filter: blur(4px);
  margin-bottom: 6px;
}

.scene-info-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scene-headline {
  font-size: clamp(1rem, 1.5vw, 1.3rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.3px;
}

.scene-subheadline {
  font-size: 0.85rem;
  font-weight: 700;
  color: #333333;
}

.key-points-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 3px 12px;
  margin-top: 2px;
}

.key-points-list li {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.bullet-box {
  color: var(--color-black);
  font-size: 0.8rem;
}

.stat-container {
  min-width: 130px;
  background: var(--color-yellow);
  border: var(--border-medium);
  box-shadow: var(--shadow-small);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 900;
  font-family: var(--font-mono);
  line-height: 1;
}

.stat-label {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-top: 3px;
  line-height: 1.15;
}

/* CAJA DE SUBTÍTULOS / NARRACIÓN TIPO TELEPROMPTER */
.subtitles-box {
  background: var(--color-black);
  color: var(--color-white);
  border: var(--border-medium);
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.3;
  box-shadow: var(--shadow-small);
}

.subtitles-text {
  color: #FFFFFF;
}

/* BARRA DE CONTROLES DEL REPRODUCTOR */
.video-control-bar {
  background: #FFFFFF;
  border-top: var(--border-thick);
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 20;
}

/* BARRA DE TIEMPO Y SCRUBBER */
.timeline-scrubber-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.progress-track-wrapper {
  position: relative;
  flex: 1;
  height: 20px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.progress-track {
  position: relative;
  width: 100%;
  height: 12px;
  background: #E0E0E0;
  border: var(--border-medium);
  box-shadow: 2px 2px 0px #000;
}

.progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: var(--color-red);
  border-right: 2px solid #000;
}

.scrub-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 18px;
  height: 24px;
  background: var(--color-yellow);
  border: 3px solid #000;
  box-shadow: 2px 2px 0px #000;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.time-display {
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 0.9rem;
  min-width: 110px;
  text-align: right;
}

/* MARCADORES DE CAPÍTULO EN LA LÍNEA DE TIEMPO */
.chapter-marks-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.chapter-mark {
  position: absolute;
  top: -4px;
  width: 4px;
  height: 20px;
  background: #000000;
  pointer-events: auto;
  cursor: pointer;
}

.chapter-mark:hover .chapter-tooltip {
  display: block;
}

.chapter-tooltip {
  display: none;
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #000;
  color: #FFF;
  padding: 2px 6px;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  white-space: nowrap;
  border: 1px solid #FFF;
}

/* FILA DE BOTONES DE CONTROL */
.control-buttons-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.controls-left, .controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-play-pause {
  background: var(--color-yellow);
  font-size: 1rem;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-play-pause.is-playing {
  background: var(--color-cyan);
}

.volume-control-group {
  display: flex;
  align-items: center;
  gap: 6px;
  border: var(--border-medium);
  box-shadow: var(--shadow-small);
  padding: 4px 8px;
  background: var(--color-white);
}

.volume-slider {
  width: 80px;
  cursor: pointer;
  accent-color: var(--color-black);
}

.speed-select {
  border: var(--border-medium);
  box-shadow: var(--shadow-small);
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-weight: 800;
  background: var(--color-white);
  cursor: pointer;
  outline: none;
}

/* BOTONES DE NAVEGACIÓN RÁPIDA POR ACTO (PILLS) */
.acts-quick-nav-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.act-nav-btn {
  flex: 1;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 12px;
  background: var(--color-white);
  border: var(--border-medium);
  box-shadow: var(--shadow-small);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.act-nav-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0px #000;
}

.act-nav-btn.active-act-btn {
  border-width: 4px;
  background: var(--color-yellow);
  box-shadow: 4px 4px 0px #000;
}

.nav-act-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 900;
}

.nav-act-name {
  font-size: 0.85rem;
  font-weight: 800;
  margin-top: 2px;
}

/* PANEL INFERIOR DE NOTAS HISTÓRICAS / SHORTCUTS */
.footer-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.info-card {
  background: var(--color-white);
  border: var(--border-thick);
  box-shadow: var(--shadow-medium);
  padding: 16px 20px;
}

.info-card h3 {
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 8px;
  border-bottom: 2px solid #000;
  padding-bottom: 4px;
}

.info-card p, .info-card ul {
  font-size: 0.85rem;
  line-height: 1.5;
  color: #222;
}

.info-card ul {
  list-style: square;
  padding-left: 18px;
}

.kbd-badge {
  display: inline-block;
  background: #EEE;
  border: 1px solid #000;
  box-shadow: 1px 1px 0px #000;
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
}

/* MODAL DE MATRIZ COMPARATIVA NEOBRUTALISTA */
.matrix-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  z-index: 100;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.matrix-modal-overlay.is-open {
  display: flex;
}

.matrix-modal-card {
  background: var(--color-white);
  border: 5px solid #000;
  box-shadow: 12px 12px 0px #000;
  max-width: 1100px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.matrix-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-yellow);
  padding: 14px 20px;
  border-bottom: 4px solid #000;
}

.matrix-header h2 {
  font-size: 1.3rem;
  font-weight: 900;
  text-transform: uppercase;
}

.matrix-content-scroll {
  padding: 20px;
  overflow-y: auto;
}

.table-responsive {
  overflow-x: auto;
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.matrix-table th, .matrix-table td {
  border: 3px solid #000;
  padding: 10px 12px;
  vertical-align: top;
}

.matrix-table th {
  background: #000000;
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-weight: 800;
  text-transform: uppercase;
}

.matrix-table tr:nth-child(even) {
  background: #F9F9F9;
}

/* RESPONSIVE DESIGN */
@media (max-width: 860px) {
  .video-viewport {
    aspect-ratio: auto;
    min-height: 540px;
  }
  .scene-info-card {
    grid-template-columns: 1fr;
  }
  .stat-container {
    min-width: 100%;
  }
  .control-buttons-row {
    flex-direction: column;
    align-items: stretch;
  }
  .controls-left, .controls-right {
    justify-content: space-between;
  }
}
