/* ==========================================================================
   TOUR INTERACTIVO DAMM - HOJA DE ESTILOS
   Proporción 1920x1077 nativa - Escalado dinámico en pantalla
   ========================================================================== */

:root {
  --bg-beige: #e8e0d3;
  --damm-red: #ae2f32;
  --damm-red-dark: #8c1e21;
  --damm-red-light: #c84346;
  --text-dark: #2c2523;
  --text-muted: #786e68;
  --white: #ffffff;
  
  --canvas-width: 1920px;
  --canvas-height: 1077px;
  --canvas-ratio: calc(1920 / 1077);
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-beige);
  color: var(--text-dark);
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ==========================================================================
   VIEWPORT 1920x1077 (Ajuste automático a pantallas 16:9 y cualquier TV)
   ========================================================================== */

.viewport {
  position: relative;
  width: 100vw;
  height: calc(100vw / var(--canvas-ratio));
  max-height: 100vh;
  max-width: calc(100vh * var(--canvas-ratio));
  background-color: var(--bg-beige);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

/* Si la pantalla es exactamente 1920x1077 o mayor con relación similar */
@media (min-aspect-ratio: 1920/1077) {
  .viewport {
    height: 100vh;
    width: calc(100vh * var(--canvas-ratio));
  }
}

@media (max-aspect-ratio: 1920/1077) {
  .viewport {
    width: 100vw;
    height: calc(100vw / var(--canvas-ratio));
  }
}

/* ==========================================================================
   PANTALLAS (INTRO, MAPA, VÍDEO)
   ========================================================================== */

.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition-smooth), visibility var(--transition-smooth);
}

.screen.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 10;
}

/* ==========================================================================
   1. PANTALLA INTRO
   ========================================================================== */

.screen-intro {
  background-color: #1a1717;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.intro-overlay {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px;
  background: radial-gradient(circle, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.85) 100%);
  border-radius: 24px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  animation: introFadeIn 1s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes introFadeIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.intro-brand {
  margin-bottom: 30px;
}

.intro-logo {
  height: 60px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.4));
  margin-bottom: 12px;
}

.intro-title {
  color: var(--white);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--damm-red) 0%, var(--damm-red-dark) 100%);
  color: var(--white);
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  padding: 16px 36px;
  border-radius: 50px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 25px rgba(174, 47, 50, 0.5);
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 30px rgba(174, 47, 50, 0.7);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-skip {
  margin-top: 18px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 20px;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.btn-skip:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   2. PANTALLA MAPA INTERACTIVO
   ========================================================================== */

.screen-map {
  background-color: var(--bg-beige);
  display: flex;
  flex-direction: column;
}

.map-header {
  position: absolute;
  top: 20px;
  left: 30px;
  right: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 20;
  pointer-events: none;
}

.map-header * {
  pointer-events: auto;
}

.map-logo {
  height: 44px;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.1));
}

.map-status-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.85);
  padding: 8px 20px;
  border-radius: 50px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  backdrop-filter: blur(8px);
}

.status-dot {
  width: 10px;
  height: 10px;
  background-color: var(--damm-red);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--damm-red);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.map-controls-hint {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.7);
  padding: 6px 16px;
  border-radius: 30px;
}

.key-badge {
  background: var(--damm-red);
  color: var(--white);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

/* LIENZO DE MAPA */
.map-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-beige);
}

.map-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.map-layer-base {
  z-index: 1;
}

/* Capas de tramos superpuestas */
.tramo-layer {
  z-index: 2;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal);
}

.tramo-layer.active {
  opacity: 1;
  visibility: visible;
}

/* HOTSPOTS INTERACTIVOS */
.hotspots-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
}

.station-hotspot {
  position: absolute;
  background: transparent;
  border: 2px dashed transparent;
  border-radius: 20px;
  cursor: pointer;
  outline: none;
  padding: 0;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.station-hotspot:hover {
  background: rgba(174, 47, 50, 0.08);
  border-color: rgba(174, 47, 50, 0.3);
}

.station-hotspot.selected {
  border-color: var(--damm-red);
  background: rgba(174, 47, 50, 0.12);
  box-shadow: 0 0 25px rgba(174, 47, 50, 0.35);
}

.hotspot-badge {
  display: none; /* Los números ya vienen integrados en el mapa */
}

/* Tooltip al estar seleccionado para el 2º clic */
.hotspot-hint {
  position: absolute;
  bottom: -32px;
  background: var(--damm-red);
  color: var(--white);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-5px);
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(174, 47, 50, 0.4);
  transition: all var(--transition-fast);
}

.station-hotspot.selected .hotspot-hint {
  opacity: 1;
  transform: translateY(0);
  animation: bounceHint 1.5s infinite;
}

@keyframes bounceHint {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Barra inferior del mapa */
.map-bottom-bar {
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(255, 255, 255, 0.95);
  padding: 10px 24px;
  border-radius: 50px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(10px);
}

.btn-map-action {
  background: #f0ebe4;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.btn-map-action:hover {
  background: #e2d9cf;
}

.map-selected-label {
  font-size: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.lbl-fase {
  color: var(--text-muted);
}

#selected-step-name {
  font-weight: 700;
  color: var(--damm-red);
}

.btn-map-play {
  background: var(--damm-red);
  color: var(--white);
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.btn-map-play:not(:disabled):hover {
  background: var(--damm-red-dark);
  transform: scale(1.04);
}

.btn-map-play:disabled {
  background: #d6cac3;
  cursor: not-allowed;
  opacity: 0.6;
}

/* ==========================================================================
   3. PANTALLA REPRODUCTOR DE VÍDEO
   ========================================================================== */

.screen-video {
  background-color: #000;
}

.video-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* OVERLAY CON CONTROLES */
.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  z-index: 30;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
  cursor: default;
}

.video-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Botón Cerrar (X) */
.btn-close-circle {
  position: absolute;
  top: 35px;
  right: 40px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--damm-red);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.btn-close-circle:hover {
  transform: scale(1.1);
  background: #fdfdfd;
}

/* Botón Central Play / Pausa */
.btn-center-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: var(--damm-red);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.4);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-center-play .icon-pause {
  display: none;
}

.btn-center-play.playing .icon-play {
  display: none;
}

.btn-center-play.playing .icon-pause {
  display: block;
}

.btn-center-play:hover {
  transform: translate(-50%, -50%) scale(1.12);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   BARRA INFERIOR DE VÍDEO (DOCK DAMM) - Fiel a la captura 1
   ========================================================================== */

.video-bottom-dock {
  position: absolute;
  bottom: 35px;
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  max-width: 1760px;
  z-index: 40;
}

.dock-container {
  display: flex;
  align-items: center;
  background: var(--white);
  height: 64px;
  border-radius: 50px;
  padding: 0 20px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.35);
  gap: 16px;
}

.dock-brand {
  display: flex;
  align-items: center;
  padding-right: 18px;
  border-right: 1.5px solid #dedede;
  height: 34px;
}

.dock-logo {
  height: 28px;
}

.dock-title {
  min-width: 160px;
  max-width: 220px;
  color: var(--damm-red);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dock-nav-btn {
  background: transparent;
  border: none;
  color: var(--damm-red);
  font-size: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.dock-nav-btn:hover {
  background: rgba(174, 47, 50, 0.1);
  transform: scale(1.15);
}

/* LÍNEA DE TIEMPO CON HITOS */
.dock-timeline {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 10px;
}

.timeline-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--damm-red);
  transform: translateY(-50%);
  z-index: 1;
}

.timeline-nodes {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Nodos individuales del 1 al 13 */
.dock-node {
  position: relative;
  background: var(--white);
  border: 2px solid var(--damm-red);
  color: var(--damm-red);
  font-size: 11px;
  font-weight: 700;
  min-width: 24px;
  height: 24px;
  border-radius: 12px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-fast);
}

.dock-node:hover {
  transform: scale(1.2);
  background: #fff5f5;
}

/* Nodo activo (Rojo sólido y ligeramente más grande) */
.dock-node.active {
  background: var(--damm-red);
  color: var(--white);
  border-color: var(--damm-red);
  min-width: 32px;
  height: 32px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(174, 47, 50, 0.5);
  transform: scale(1.08);
}
