/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #121212;
  color: #f1f1f1;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Línea de tiempo - Estilo base para escritorio */
.timeline-line {
  position: fixed;
  top: 50%;
  left: 0;
  right: 0;
  height: 4px;
  background: #00bcd4;
  z-index: 0;
}

/* Contenedor scrollable */
.scroll-wrapper {
  display: flex;
  gap: min(8vw, 80px);
  padding: min(10vh, 100px) min(6vw, 60px);
  overflow-x: scroll;
  width: 100%;
  position: relative;
  top: 50vh;
  transform: translateY(-50%);
  scrollbar-width: thin;
  scrollbar-color: #00bcd4 #1e1e1e;
}

/* Estilo para la barra de scroll en Chrome/Safari */
.scroll-wrapper::-webkit-scrollbar {
  height: 12px;
}

.scroll-wrapper::-webkit-scrollbar-track {
  background: #1e1e1e;
  border-radius: 6px;
}

.scroll-wrapper::-webkit-scrollbar-thumb {
  background-color: #00bcd4;
  border-radius: 6px;
  border: 3px solid #1e1e1e;
}

/* Evento individual */
.event {
  position: relative;
  flex: 0 0 auto;
  background-color: #1e1e1e;
  padding: min(3vh, 30px);
  border-radius: 16px;
  width: min(90vw, 800px);
  height: min(80vh, 800px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.event:hover {
  transform: scale(1.02);
}

/* Imagen de cada evento */
.event a {
  display: block;
  width: 100%;
  height: 60%;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.event a:hover {
  transform: scale(1.05);
}

.event a::before {
  content: '🔎 Ver en mapa';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 188, 212, 0.9);
  color: white;
  padding: 8px;
  text-align: center;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.event a:hover::before {
  transform: translateY(0);
}

.event .imagen {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  transition: transform 0.3s ease;
}

/* Estilos del carrusel */
.carousel {
  position: relative;
  width: 100%;
  height: 60%;
  overflow: hidden;
  border-radius: 10px;
}

.carousel-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.carousel-container a {
  width: 100%;
  height: 100%;
  display: block;
  position: relative;
  text-decoration: none;
}

.carousel-container a::before {
  content: '🔎 Ver en mapa';
  position: absolute;
  bottom: 50px; /* Ajustado para estar por encima de los dots */
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  background: rgba(0, 188, 212, 0.9);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  text-align: center;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 3;
  pointer-events: none; /* Evita que el texto interfiera con el hover */
  white-space: nowrap;
}

.carousel-container a:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.carousel .imagen {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.5s ease;
  opacity: 0;
}

.carousel .imagen[data-index="0"] {
  opacity: 1;
}

.carousel-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 4;
  font-size: 18px;
  transition: background-color 0.3s ease;
}

.carousel-button:hover {
  background: rgba(0, 0, 0, 0.8);
}

.carousel-button.prev {
  left: 10px;
}

.carousel-button.next {
  right: 10px;
}

.carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 4;
  background: rgba(0, 0, 0, 0.3);
  padding: 5px 10px;
  border-radius: 15px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.dot.active {
  background: #00bcd4;
}

/* Ajustes responsive */
@media screen and (max-width: 768px) {
  .carousel-container a::before {
    bottom: 40px;
    font-size: 0.9rem;
    padding: 8px 16px;
  }
  
  .carousel-dots {
    bottom: 8px;
    padding: 4px 8px;
  }
  
  .dot {
    width: 6px;
    height: 6px;
  }
}

/* Punto de conexión (línea vertical en móvil) */
.dot {
  display: none;  /* Este es para el punto de la línea vertical */
}

/* Puntos del carousel */
.carousel-dots .dot {
  display: block;  /* Aseguramos que los puntos del carousel siempre sean visibles */
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.carousel-dots .dot.active {
  background: #00bcd4;
}

/* Fecha encima de cada tarjeta */
.date {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #00bcd4;
  color: #121212;
  padding: min(1.5vh, 15px) min(2vw, 20px);
  border-radius: 20px;
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: bold;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  z-index: 2;
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards;
}

/* Animación para fecha */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate(-50%, -10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Estilos para texto */
.event h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: min(2vh, 20px);
  color: #00e5ff;
}

.event p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.5;
  color: #e0e0e0;
}

/* Botón de más información */
.info-button {
  background-color: #00bcd4;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  margin-top: 10px;
  transition: all 0.3s ease;
}

.info-button:hover {
  background-color: #00e5ff;
  transform: scale(1.05);
}

/* Botón de ver más */
.ver-mas-button {
  display: inline-block;
  background: transparent;
  color: #00e5ff;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
  margin-top: 4px;
  font-size: 0.85rem;
  font-weight: 400;
  transition: all 0.2s ease;
  border: 1px solid #00bcd4;
}

.ver-mas-button::after {
  content: ' →';
  opacity: 0;
  margin-left: -10px;
  transition: all 0.2s ease;
}

.ver-mas-button:hover {
  background-color: rgba(0, 229, 255, 0.1);
  transform: translateX(2px);
}

.ver-mas-button:hover::after {
  opacity: 1;
  margin-left: 2px;
}

.ver-mas-button:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.2);
}

@media screen and (max-width: 768px) {
  .ver-mas-button {
    font-size: 0.8rem;
    padding: 3px 6px;
  }
}

/* Contenedor de información adicional */
.info-adicional {
  display: none;
  background-color: rgba(30, 30, 30, 0.95);
  padding: 15px;
  border-radius: 10px;
  margin-top: 15px;
  border: 1px solid #00bcd4;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.info-adicional.visible {
  display: block;
  opacity: 1;
}

.info-adicional h4 {
  color: #00e5ff;
  margin: 10px 0 5px 0;
  font-size: 1.1rem;
}

.info-adicional h4:first-child {
  margin-top: 0;
}

.info-adicional p {
  font-size: 0.95rem;
  line-height: 1.4;
  margin-bottom: 10px;
  color: #e0e0e0;
}

/* Estilo específico para el botón Ver más */
.info-adicional .ver-mas-button {
  display: inline;
  background: transparent;
  color: #00e5ff;
  text-decoration: underline;
  padding: 0;
  border-radius: 0;
  margin: 0;
  font-size: 0.85rem;
  font-weight: normal;
  transition: color 0.2s ease;
  border: none;
  width: auto;
  text-align: left;
  position: relative; /* Asegura que el botón tenga su propio contexto de apilamiento */
  z-index: 1; /* Evita que se vea afectado por otros elementos */
}

.info-adicional .ver-mas-button::before {
  content: none;
}

.info-adicional .ver-mas-button::after {
  content: ' →';
  opacity: 0;
  margin-left: -8px;
  transition: all 0.2s ease;
}

.info-adicional .ver-mas-button:hover {
  color: #ffffff;
  background: transparent;
  transform: none;
}

.info-adicional .ver-mas-button:hover::after {
  opacity: 1;
  margin-left: 2px;
}

.info-adicional .ver-mas-button:focus {
  outline: none;
  box-shadow: none;
  text-decoration: underline;
}

/* Diseño móvil */
@media screen and (max-width: 768px), (orientation: portrait) {
  body {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    height: auto;
  }
  .timeline-line {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 45px;
    width: 4px;
    height: 100%;
    transform: none;
  }
  .scroll-wrapper {
    flex-direction: column;
    gap: 30px;
    padding: 20px;
    padding-left: 60px;
    overflow-y: visible;
    overflow-x: hidden;
    height: auto;
    width: 100%;
    position: static;
    transform: none;
    margin-top: 20px;
  }

  .scroll-wrapper::-webkit-scrollbar {
    display: none;
  }
  .event {
    width: calc(100% - 30px);
    height: auto;
    min-height: auto;
    margin: 0;
    margin-left: auto;
    margin-top: 40px;
    padding: 15px;
    background: #1e1e1e;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  }

  .event:hover {
    transform: translateX(5px);
  }

  .event .carousel {
    width: 100%;
    height: 250px;  /* Altura fija para las imágenes en móvil */
    margin: 0;
    border-radius: 8px;
    overflow: hidden;
  }

  .event .carousel-container {
    height: 100%;
  }

  .event .carousel-container a {
    height: 100%;
  }

  .event .imagen {
    position: absolute;
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: 8px;
    object-fit: cover;
  }

  .event h3 {
    font-size: 1.4rem;
    margin: 10px 0;
    color: #00e5ff;
  }

  .event p {
    font-size: 1rem;
    margin: 0;
    line-height: 1.4;
  }
  .date {
    position: absolute;
    top: -30px;
    left: -20px;
    transform: none;
    font-size: 0.9rem;
    padding: 6px 12px;
    background: #1e1e1e;
    color: #00bcd4;
    border: 2px solid #00bcd4;
    border-radius: 4px;
    font-weight: bold;
    z-index: 2;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    text-align: center;
  }

  /* Puntos de conexión para la línea vertical */
  .dot {
    display: block;
    position: absolute;
    left: -47px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #1e1e1e;
    border: 3px solid #00bcd4;
    border-radius: 50%;
  }

  .dot::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 50%;
    width: 32px;
    height: 2px;
    background: #00bcd4;
    transform: translateY(-50%);
    z-index: 2;
  }

  .info-adicional {
    font-size: 0.9rem;
    padding: 12px;
  }
  
  .info-button {
    width: 100%;
    margin-top: 8px;
  }

  .carousel-dots {
    bottom: 15px;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 15px;
    z-index: 5;
  }

  .carousel-dots .dot {
    width: 6px;
    height: 6px;
    margin: 0 4px;
  }
}
