/* Timeline Container */
.timeline-container {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  padding: 3rem 0;
  position: relative;
}

.timeline-header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 0 1rem;
}

.timeline-title {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: 2.5rem;
  color: #2c3e50;
  margin-bottom: 1rem;
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.timeline-subtitle {
  font-family: "Poppins", sans-serif;
  font-size: 1.1rem;
  color: #6c757d;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
  font-weight: 400;
}

/* Timeline Layout */
.timeline-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 4rem;
  align-items: start;
  min-height: 100vh;
}

/* Left Side - Timeline */
.timeline {
  position: relative;
  padding: 1.5rem 0;
  height: fit-content;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timeline-line {
  width: 2px;
  background: #3498db;
  border-radius: 4px;
  position: absolute;
  left: 20px;
  top: 20px;
  bottom: 20px;
}

.timeline-item {
  position: relative;
  width: 100%;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  padding-left: 0;
}

.timeline-marker {
  position: absolute;
  left: 20px;
  z-index: 3;
  transform: translateX(-50%);
}

.timeline-circle {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #3498db;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
  transition: all 0.3s ease;
}

.timeline-circle:hover {
  transform: scale(1.2);
  background: #2980b9;
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.5);
}

.timeline-year-circle {
  display: none;
}

.timeline-event {
  display: flex;
  align-items: center;
  margin-left: 3rem;
  background: #fff;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  border: 1px solid #e9ecef;
  transition: all 0.3s ease;
  width: calc(100% - 3rem);
}

.timeline-event:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  border-color: #3498db;
}

.timeline-event-image {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  margin-right: 1rem;
  border: 2px solid #f8f9fa;
}

.timeline-event-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.timeline-event:hover .timeline-event-image img {
  transform: scale(1.1);
}

.timeline-event-content {
  flex: 1;
  text-align: left;
}

.timeline-event-year {
  font-size: 1.2rem;
  color: #3498db;
  margin-bottom: 0.3rem;
  font-weight: 700;
  font-family: "Poppins", sans-serif;
}

.timeline-event-title {
  font-size: 0.9rem;
  color: #2c3e50;
  margin-bottom: 0.2rem;
  font-weight: 600;
  line-height: 1.3;
}

.timeline-event-description {
  font-size: 0.8rem;
  color: #6c757d;
  line-height: 1.4;
  margin: 0;
}

/* Right Side - Content Cards */
.timeline-content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.timeline-card {
  background: #fff;
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border: 1px solid #e9ecef;
  overflow: hidden;
  transition: all 0.3s ease;
}

.timeline-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.timeline-card-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.timeline-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.timeline-card:hover .timeline-card-image img {
  transform: scale(1.05);
}

.timeline-card-content {
  padding: 1.5rem;
}

.timeline-year {
  display: inline-block;
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.timeline-title-card {
  font-family: "Poppins", sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.8rem;
  line-height: 1.3;
}

.timeline-description {
  color: #5a6c7d;
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
}

/* Responsive Design */
@media screen and (max-width: 1024px) {
  .timeline-wrapper {
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    padding: 0 1rem;
  }
  
  .timeline-circle {
    display: none;
  }
  
  .timeline-line {
    left: 40px;
  }
}

/* Tablets - Layout 2 columnas optimizado */
@media screen and (max-width: 1024px) and (min-width: 769px) {
  .timeline-container {
    padding: 2.5rem 0;
  }
  
  .timeline-title {
    font-size: 2.2rem;
  }
  
  .timeline-subtitle {
    font-size: 1rem;
  }
  
  .timeline-wrapper {
    grid-template-columns: 250px 1fr;
    gap: 1.5rem;
    padding: 0 1rem;
  }
  
  .timeline-event {
    padding: 0.8rem 1rem;
    margin-left: 2.5rem;
    width: calc(100% - 2.5rem);
  }
  
  .timeline-event-image {
    width: 45px;
    height: 45px;
    margin-right: 0.8rem;
  }
  
  .timeline-event-year {
    font-size: 1rem;
  }
  
  .timeline-event-title {
    font-size: 0.8rem;
  }
  
  .timeline-event-description {
    font-size: 0.7rem;
  }
  
  .timeline-line {
    left: 18px;
  }
  
  .timeline-marker {
    left: 18px;
  }
  
  .timeline-circle {
    display: none;
  }
  
  .timeline-card-content {
    padding: 1.3rem;
  }
  
  .timeline-title-card {
    font-size: 1.15rem;
  }
  
  .timeline-description {
    font-size: 0.95rem;
  }
}

/* Móviles - Diseño vertical simple y accesible */
@media screen and (max-width: 768px) {
  .timeline-container {
    padding: 2rem 0;
  }
  
  .timeline-title {
    font-size: 2rem;
    padding: 0 1rem;
  }
  
  .timeline-subtitle {
    font-size: 0.95rem;
    padding: 0 1rem;
  }
  
  .timeline-header {
    margin-bottom: 2rem;
  }
  
  .timeline-wrapper {
    display: block;
    padding: 0 1rem;
  }
  
  /* Timeline horizontal con scroll */
  .timeline {
    margin-bottom: 2.5rem;
    padding: 1.5rem 0;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    flex-direction: row;
    gap: 1rem;
    scrollbar-width: thin;
    scrollbar-color: #3498db #f8f9fa;
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
  }
  
  .timeline::before {
    content: '👈 Desliza para navegar en el tiempo';
    position: absolute;
    top: -2rem;
    left: 0;
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
  }
  
  .timeline::-webkit-scrollbar {
    height: 6px;
  }
  
  .timeline::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 3px;
  }
  
  .timeline::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 3px;
  }
  
  .timeline-line {
    position: absolute;
    top: 50%;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background: linear-gradient(to right, #3498db, #2980b9);
    transform: translateY(-50%);
    z-index: 1;
  }
  
  .timeline-item {
    flex: 0 0 auto;
    width: 200px;
    margin-bottom: 0;
    padding: 0 1rem;
    position: relative;
    z-index: 2;
  }
  
  .timeline-marker {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 1rem;
  }
  
  .timeline-circle {
    display: none;
  }
  
  .timeline-event {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 0.8rem;
    margin: 0;
    width: 100%;
    flex-direction: column;
    text-align: center;
  }
  
  .timeline-event-image {
    width: 50px;
    height: 50px;
    margin: 0 auto 0.5rem auto;
    border-radius: 6px;
  }
  
  .timeline-event-content {
    text-align: center;
  }
  
  .timeline-event-year {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
  }
  
  .timeline-event-title {
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
  }
  
  .timeline-event-description {
    font-size: 0.7rem;
    line-height: 1.3;
  }
  
  /* Cards de contenido */
  .timeline-content-wrapper {
    gap: 1.2rem;
  }
  
  .timeline-card {
    margin: 0;
    border-radius: 10px;
  }
  
  .timeline-card-content {
    padding: 1.2rem;
  }
  
  .timeline-title-card {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
  }
  
  .timeline-description {
    font-size: 0.9rem;
    line-height: 1.5;
  }
}

@media screen and (max-width: 480px) {
  .timeline-container {
    padding: 1.5rem 0;
  }
  
  .timeline-header {
    margin-bottom: 1.5rem;
  }
  
  .timeline-title {
    font-size: 1.8rem;
    padding: 0 0.8rem;
    line-height: 1.2;
  }
  
  .timeline-subtitle {
    font-size: 0.9rem;
    padding: 0 0.8rem;
  }
  
  .timeline-wrapper {
    padding: 0 0.8rem;
  }
  
  .timeline {
    padding: 1rem 0;
    gap: 0.8rem;
    margin-bottom: 2rem;
  }
  
  .timeline::before {
    font-size: 0.75rem;
    top: -1.8rem;
  }
  
  .timeline-item {
    width: 160px;
    padding: 0 0.5rem;
  }
  
  .timeline-circle {
    display: none;
  }
  
  .timeline-event {
    padding: 0.6rem;
  }
  
  .timeline-event-image {
    width: 40px;
    height: 40px;
  }
  
  .timeline-event-year {
    font-size: 1rem;
  }
  
  .timeline-event-title {
    font-size: 0.75rem;
  }
  
  .timeline-event-description {
    font-size: 0.65rem;
    line-height: 1.2;
  }
  
  .timeline-card-content {
    padding: 1rem;
  }
  
  .timeline-title-card {
    font-size: 1rem;
    line-height: 1.3;
  }
  
  .timeline-description {
    font-size: 0.85rem;
    line-height: 1.4;
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4),
                0 0 0 0 rgba(52, 152, 219, 0.1);
  }
  50% {
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4),
                0 0 0 12px rgba(52, 152, 219, 0.05);
  }
  100% {
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4),
                0 0 0 0 rgba(52, 152, 219, 0.1);
  }
}

@keyframes slideInFromLeft {
  0% {
    opacity: 0;
    transform: translateX(-30px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInFromRight {
  0% {
    opacity: 0;
    transform: translateX(30px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.timeline-item {
  opacity: 1;
  animation: slideInFromLeft 0.4s ease-out;
}

.timeline-card {
  opacity: 1;
  animation: slideInFromRight 0.6s ease-out;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }
.timeline-item:nth-child(5) { animation-delay: 0.5s; }
.timeline-item:nth-child(6) { animation-delay: 0.6s; }
.timeline-item:nth-child(7) { animation-delay: 0.7s; }
.timeline-item:nth-child(8) { animation-delay: 0.8s; }
.timeline-item:nth-child(9) { animation-delay: 0.9s; }

.timeline-card:nth-child(1) { animation-delay: 0.3s; }
.timeline-card:nth-child(2) { animation-delay: 0.5s; }
.timeline-card:nth-child(3) { animation-delay: 0.7s; }
.timeline-card:nth-child(4) { animation-delay: 0.9s; }

/* Smooth scroll behavior */
.timeline {
  scroll-behavior: smooth;
}

/* Additional hover effects */
.timeline-event-image {
  transition: all 0.3s ease;
}

.timeline-event-image:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.timeline-item:hover .timeline-event-content {
  transform: translateY(-2px);
  transition: transform 0.3s ease;
}

/* Loading states - Removiendo opacity inicial que causaba problemas */
.timeline-item {
  animation-fill-mode: forwards;
}

.timeline-card {
  animation-fill-mode: forwards;
}
