.timeline-block {
    padding: 80px 20px;
    overflow: hidden;
}

.timeline-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    min-height: 400px;
}

/* Ligne horizontale principale */
.timeline-line {
    position: absolute;
    top: 50%;
    left: 60px; /* Distance du bord gauche équivalente au rayon du premier cercle */
    right: 60px; /* Distance du bord droit équivalente au rayon du dernier cercle */
    height: 3px;
    background: rgba(132, 205, 243, 0.43);
    transform: translateY(-50%);
    z-index: 0;
}

/* Item de timeline */
.timeline-item {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.timeline-item.animate {
    opacity: 1;
    transform: translateX(0);
}

/* Cercle avec numéro */
.timeline-circle {
    position: relative;
    width: 3.75rem;
    height: 3.75rem;
    border-radius: 50%;
    background: #34A09F;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    flex-shrink: 0;
}

.timeline-circle::before {
    content: '';
    position: absolute;
    width: 6rem;
    height: 6rem;
    border-radius: 50%;
    background: rgba(132, 205, 243, 0.3);
    z-index: -1;
}

.timeline-number {
    font-size: 1.875rem;
    font-weight: bold;
    color: #fff;
}

/* Contenu (titre + description) */
.timeline-content {
    position: absolute;
    width: 100%;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    left: 25%;
    transform: translate(25%);
}

/* Position alternée */
.timeline-item[data-position="top"] .timeline-content {
    bottom: calc(100% + 0.875rem);
    flex-direction: column;
}

.timeline-item[data-position="bottom"] .timeline-content {
    top: calc(100% + 0.875rem);
    flex-direction: column-reverse;
}

/* Ligne verticale - hauteur auto */
.timeline-vertical-line {
    width: 0.125rem;
    min-height: 3.0625rem;
    height: auto;
    background: rgba(2, 32, 70, 0.30);
    flex-shrink: 0;
    
}

/* Texte */
.timeline-text {
   
    width: 100%;
}

.timeline-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #34A09F;
    margin: 0 0 0.625rem 0;
    word-wrap: break-word;
}

.timeline-description {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #333;
    margin: 0;
    word-wrap: break-word;
}

/* Animation en cascade */
.timeline-item:nth-child(1) { transition-delay: 0.1s; }
.timeline-item:nth-child(2) { transition-delay: 0.3s; }
.timeline-item:nth-child(3) { transition-delay: 0.5s; }
.timeline-item:nth-child(4) { transition-delay: 0.7s; }
.timeline-item:nth-child(5) { transition-delay: 0.9s; }
.timeline-item:nth-child(6) { transition-delay: 1.1s; }
.timeline-item:nth-child(7) { transition-delay: 1.3s; }
.timeline-item:nth-child(8) { transition-delay: 1.5s; }

/* Responsive */
@media (max-width: 1024px) {
    .timeline-container {
        gap: 1.875rem;
        min-height: 350px;
    }
    
    .timeline-line {
        left: 50px;
        right: 50px;
    }
    
    .timeline-circle {
        width: 3.125rem;
        height: 3.125rem;
    }
    
    .timeline-circle::before {
        width: 5rem;
        height: 5rem;
    }
    
    .timeline-number {
        font-size: 1.5rem;
    }
    
    .timeline-vertical-line {
        min-height: 1.5rem;
    }
    
    .timeline-content {
        max-width: 220px;
    }
}

@media (max-width: 768px) {
    .timeline-block {
        padding: 0;
    }
    .timeline-container {
        flex-direction: column;
        gap: 5rem;
        min-height: auto;
        position: relative;
    }
    
    .timeline-line {
        bottom: auto;
        right: auto;
        width: 2px;
        height: calc(100% - 60px); /* Hauteur adaptée - s'arrête au dernier cercle */
        background: rgba(132, 205, 243, 0.43);
    }
    
    .timeline-item {
        display: flex;
        align-items: flex-start;
        margin-left: 2rem;
        justify-content: inherit;
        position: relative;
        flex-direction: row;
    }

    /* Calcul dynamique pour la dernière item */
    .timeline-item:last-child ~ .timeline-line {
        height: auto;
    }
    .timeline-item .timeline-content {
        display: block;
        position: relative;
        left: inherit;
        transform: inherit;
        text-align: left;
        max-width: 700px;
        width: 80%;
        flex: 0 0 80%;
    }
    .timeline-item[data-position="top"] .timeline-content,
    .timeline-item[data-position="bottom"] .timeline-content {
        position: relative;
        top: auto;
        bottom: auto;
        flex-direction: row;
        padding: 0 1rem;
    }
    
    .timeline-vertical-line {
        display: none;
    }
    
    .timeline-text {

        padding: 0 1rem;
    }
}

@media (max-width: 480px) {

    
    .timeline-container {
        gap: 4rem;
    }
    
    .timeline-circle {
        width: 2.5rem;
        height: 2.5rem;
        flex: 0 0 2.5rem;
    }
    
    .timeline-circle::before {
        width: 4rem;
        height: 4rem;
    }
    
    .timeline-number {
        font-size: 1.25rem;
    }
    
    .timeline-content {
        max-width: 100%;
    }
    
    .timeline-title {
        font-size: 1.125rem;
    }
    
    .timeline-description {
        font-size: 0.8125rem;
    }
}