:root {
  --color-primary: #3abeff; /* Azul neón suave */
  --color-secondary: #8fbbd3; /* Azul claro sutil */
  --color-text: #d1e8ff; /* Azul muy claro */
  --timeline-line: #456990; /* Azul grisáceo */
  --anim-duration: 300ms;
  --neon-glow: 0 0 10px var(--color-primary), 0 0 20px var(--color-primary); /* Efecto neón */
  --glass-bg: rgba(19, 35, 57, 0.7); /* Fondo "glass" */
  --glass-border: rgba(255, 255, 255, 0.1); /* Borde "glass" */
}

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

body {
  font-family: "Lato", sans-serif;
  background: linear-gradient(
    180deg,
    #1a2632 0%,
    #152028 100%
  ); /* Degradado azul oscuro */
  color: var(--color-text);
  overflow-x: hidden;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  background: url("https://www.transparenttextures.com/patterns/batthern.png");
  opacity: 0.2;
  z-index: -1;
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.header {
  text-align: center;
  padding-top: 1rem;
}

.header h1 {
  font-size: 3rem;
  font-weight: bold;
  padding-top: 5%;
}

.subtitle {
  font-size: 1.2rem;
  color: var(--color-secondary);
  margin-top: 0.5rem;
}

.timeline-container {
  position: relative;
  flex: 1;
  overflow: hidden;
  padding-bottom: 5rem;
}

.timeline-track {
  display: flex;
  gap: 2rem;
  padding: 4rem 0rem;
  transition: transform var(--anim-duration) ease-out;
  position: relative;
  align-items: flex-start;
}

.timeline-item {
  flex: 0 0 400px;
  text-align: center;
  position: relative;
  cursor: pointer;
}

/* Punto cronológico */
.timeline-point {
  position: relative;
  width: 100%;
  height: 60px;
  margin-bottom: 2rem;
}

/* Círculo de año (inactivo por defecto) */
.year-circle {
  background-color: var(--glass-bg); /* Fondo "glass" */
  color: #8fbbd32e;;
  border-radius: 50%;
  width: 85px;
  height: 85px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: sans-serif;
  font-weight: 500; /* Peso medio */
  font-size: 1.6rem;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.7); /* Ligeramente más grande inactivo */
  transform-origin: center center;
  z-index: 10;
  border: 1px solid var(--glass-border); /* Borde "glass" */
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2); /* Sombra sutil */
  backdrop-filter: blur(10px); /* Efecto blur del fondo */
  transition: background-color 0.3s ease, transform 0.3s ease,
    box-shadow 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Círculo activo con efecto glow */
.timeline-item.active .year-circle {
  background-color: var(--color-primary);
  color: white;
  transform: translate(-50%, -50%) scale(1);
  box-shadow: 0 0 20px 6px rgba(11, 187, 239, 0.8);
  /* Efecto de brillo */
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 10px rgba(11, 187, 239, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(11, 187, 239, 1);
  }
  100% {
    box-shadow: 0 0 10px rgba(11, 187, 239, 0.5);
  }
}

.timeline-line {
  background-color: var(--timeline-line);
  height: 2px;
  width: 100vw;
  position: absolute;
  top: 50%;
  left: -50vw;
  transform: translateY(-50%);
  z-index: 1;
}

.timeline-content {
  opacity: 0.2;
  transform: scale(0.75);
  filter: blur(3px);
  transition: all 0.3s ease;
}

.timeline-item.active .timeline-content {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}

.timeline-content img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 0px;
  transition: transform var(--anim-duration);
  cursor: pointer;
}

.timeline-content h2 {
  margin-top: 1rem;
  font-size: 1.4rem;
  margin-bottom: 10px;
}

.timeline-content p {
  font-size: 1rem;
  padding: 0 1rem;
  color: var(--color-secondary);
}

/* Navegación */
.nav-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--color-primary);
  border: none;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  cursor: pointer;
  color: var(--color-background);
  font-size: 1.5rem;
  z-index: 10;
}

.nav-button:hover {
  background: var(--color-secondary);
  color: white;
}

.nav-button.prev {
  left: 5rem;
}

.nav-button.next {
  right: 5rem;
}

.nav-button.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.timeline-progress {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
}

.progress-dot {
  width: 0.5rem;
  height: 0.5rem;
  background: var(--color-secondary);
  border-radius: 50%;
  transition: all 0.2s ease;
}

.progress-dot.active {
  background: var(--color-primary);
  transform: scale(1.5);
}

/* Galería modal */
.gallery-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  cursor: zoom-out;
}

.gallery-image {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
  transition: transform 0.3s ease;
}

.gallery-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  z-index: 10000;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  backdrop-filter: blur(4px);
  transition: background 0.2s;
}

.gallery-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.gallery-wrapper {
  position: relative;
  display: inline-block;
}

.gallery-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10000;
  padding: 0.25rem 0.75rem;
  border-radius: 50%;
  transition: background 0.2s;
}

.gallery-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
  .timeline-track {
    padding: 4rem 0;
    gap: 1rem;
  }

  .timeline-item {
    flex: 0 0 100vw;
    padding: 0 1rem;
    max-width: 80%;
  }

  .timeline-content img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    display: block;
  }

  .timeline-content h2,
  .timeline-content p {
    text-align: center;
  }

  .year-circle {
    width: 60px;
    height: 60px;
    font-size: 1.2rem;
  }

  .timeline-line {
    width: 200vw;
    left: -100vw;
  }

  .nav-button.prev {
    left: 1rem;
  }

  .nav-button.next {
    right: 1rem;
  }
}

@media (max-width: 480px) {
  .timeline-item {
    flex: 0 0 100vw;
  }

  .year-circle {
    width: 50px;
    height: 50px;
    font-size: 1rem;
  }
}

/* Hover efecto solo en desktop */
@media (hover: hover) and (pointer: fine) {
  .timeline-content img {
    transition: transform 0.3s ease;
  }

  .timeline-content img:hover {
    transform: scale(1.05);
  }
}
