* {
  box-sizing: border-box;
}

body {
  background-color: #f9f9f9;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  /* padding: 20px; */
}

/* Contenedor principal del timeline */
.timeline {
  position: relative;
  
  margin: 40px auto;
  padding: 20px 0;
  height: 90vh; /* La "ventana" donde se ve el timeline (puedes ajustar este %) */
  overflow: hidden; /* Oculta los elementos que se queden fuera de la ventana */
  
  background-image: url("./resources/backgrounds/skills-section-porfolio.png");
  background-size: cover;
  background-repeat: no-repeat;
}

/* La línea vertical central */
.timeline::before {
  content: '';
  position: absolute;
  left: 50%; /* Justo en el centro */
  transform: translateX(-50%);
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: #e0e0e0;
  border-radius: 2px;
  z-index: 1; /* Para que quede por debajo de los nodos */
}

/* Cada bloque de experiencia */
.timeline-item {
  position: relative;
  width: 50%;
  padding: 0 40px; /* Espacio entre el texto y la línea central */
  margin-bottom: 100px;
  z-index: 2; /* Por encima de la línea central */
  transition: transform 0.15s ease-out; /* Suaviza el salto de la rueda del ratón */
  display: flex;
  text-align: left;
}

/* Nodos a la Izquierda */
.timeline-item.left {
  left: 0;
  justify-content: flex-end;
}

/* Nodos a la Derecha */
.timeline-item.right {
  left: 50%;
  justify-content: flex-start;
}
/* El punto en la línea (Centrado en la pantalla) */
.timeline-dot {
  position: absolute;
  top: 20px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: #616161;
  border: 4px solid #ffffff;
  box-shadow: 0 0 0 2px #e0e0e0;
  transition: all 0.3s ease;
  z-index: 10;
}

/* Ajuste del punto para la izquierda */
.timeline-item.left .timeline-dot {
  right: -10px; /* Lo empuja hacia la línea central */
}

/* Ajuste del punto para la derecha */
.timeline-item.right .timeline-dot {
  left: -10px; /* Lo empuja hacia la línea central */
}

/* Contenedor visual del contenido (La "tarjeta") */
.timeline-box {
  background: rgb(223, 223, 223);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
  
}

/* Efectos Hover (Active) */
.timeline-item.active .timeline-box {
  background-color: #cee7fd;
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(43, 132, 212, 0.15);
}
.timeline-item.active .timeline-box.actual{
  background-color: #f4ffca;
}

.timeline-item.active .timeline-dot {
  background-color: #2b84d4;
  transform: scale(1.3);
  box-shadow: 0 0 0 2px #2b84d4;
}

/* Texto y Listas */
.timeline-header {
  cursor: pointer;
}

.timeline-date {
  font-size: 0.85rem;
  color: #888;
  font-weight: 600;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 5px;
}

.timeline-title {
  margin: 0 0 10px 0;
  font-size: 1.3rem;
  color: #333;
  transition: color 0.3s ease;
}
.timeline-subtitle {
  margin: 0 0 10px 0;
  font-size: 0.8rem;
  color: #777777;
  transition: color 0.3s ease;
}
.timeline-item.active .timeline-title {
  color: #2b84d4;
}

/* Bullets personalizados */
.texto-con-bullet {
  position: relative;
  padding-left: 20px;
  margin-bottom: 10px;
  line-height: 1.5;
}

.texto-con-bullet::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #616161;
  transition: background-color 0.3s ease;
}

.timeline-item.active .texto-con-bullet::before {
  background-color: #2b84d4;
}

/* Animación de apertura */
.timeline-content-wrapper {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s ease-out;
}

.timeline-item.active .timeline-content-wrapper {
  grid-template-rows: 1fr;
}

.timeline-content {
  overflow: hidden;
  color: #555;
  font-size: 0.95rem;
}

/* Habilidades y Tech Stack */
.skills-section {
  margin-top: 15px;
  font-size: 0.9rem;
  background: #f8f9fa;
  padding: 10px;
  border-radius: 6px;
  border-left: 3px solid #2b84d4;
}

.tech-stack {
  display: flex;
  gap: 15px;
  margin-top: 15px;
}

.tech-stack svg {
  width: 28px;
  height: 28px;
  transition: transform 0.2s ease;
}

.tech-stack svg:hover {
  transform: translateY(-3px);
}

/* === RESPONSIVE (Móviles) === */
@media screen and (max-width: 768px) {
  .timeline::before {
    left: 30px; /* Movemos la línea a la izquierda */
  }

  .timeline-item {
    width: 100%;
    padding-left: 70px; /* Dejamos espacio para la línea */
    padding-right: 0;
  }

  /* Tanto los de la izquierda como derecha ahora ocupan todo el ancho */
  .timeline-item.left, 
  .timeline-item.right {
    left: 0; 
  }

  /* Los puntos vuelven a estar a la izquierda para todos */
  .timeline-item.left .timeline-dot,
  .timeline-item.right .timeline-dot {
    left: 20px; 
    right: auto;
  }
}