#timeline {
    position: relative;
    padding: 40px 0;
    background-color: #f4f4f9;
    background-image: url('./resources/images/sky.png');
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
}

.timeline {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 60px;
    background: transparent; /* Fond transparent */
    border-radius: 10px;
    transition: transform 0.3s ease, opacity 0.3s ease; /* Ajouter une transition pour l'animation */
}

.timeline::after {
    content: "";
    position: absolute;
    top: 20px;
    bottom: 20px;
    left: 50%;
    width: 8px;
    background: #003366;
    border-radius: 3px;
    z-index: 1;
}

.timeline article {
    position: relative;
    background: rgba(255, 255, 255, 0.8); /* Fond semi-transparent pour les articles */
    width: calc(50% - 40px);
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 10px;
    transition: opacity 0.3s ease; /* Supprimer la transition de zoom */
}

.timeline article:before {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: calc(100% + 26px);
    background: #fff;
    width: 24px;
    height: 24px;
    border: 6px #003366 solid;
    border-radius: 50%;
    z-index: 2;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.timeline article:hover:before {
    background: #003366; /* Vert clair au survol */
}

.timeline article.active:before {
    background: #003366; /* Vert foncé au clic */
    border-color: #003366;
}

.timeline article:after {
    content: "";
    position: absolute;
    top: 0;
    left: 100%;
    width: 0;
    height: 0;
    border-top: 20px solid transparent;
    border-left: 16px solid rgba(255, 255, 255, 0.8); /* Fond semi-transparent pour la flèche */
    border-bottom: 20px solid transparent;
}

.timeline article:nth-child(even) {
    margin-left: calc(50% + 48px);
}

.timeline article:nth-child(even):before {
    left: auto;
    right: calc(100% + 26px);
}

.timeline article:nth-child(even):after {
    left: auto;
    right: 100%;
    border-left: none;
    border-right: 16px solid rgba(255, 255, 255, 0.8); /* Fond semi-transparent pour la flèche */
}

.timeline-item {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 20px 0;
    position: relative;
    width: 50%;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

.timeline-item.left {
    left: 0;
    transform: translateX(-100%);
}

.timeline-item.right {
    left: 50%;
    transform: translateX(100%);
}

.timeline-item .date {
    font-size: 1.5em;
    font-weight: bold;
    color: #003366;
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    padding: 5px 10px;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

.timeline-item .details {
    background-color: #fff;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    width: 300px;
    margin-top: 20px;
    transition: transform 0.3s ease, opacity 0.3s ease; /* Ajouter une transition pour l'animation */
}

.timeline-item.left .details {
    margin-left: 20px;
    text-align: right;
}

.timeline-item.right .details {
    margin-right: 20px;
    text-align: left;
}

.timeline-item::before {
    content: '';
    position: absolute;
    top: 50%;
    width: 20px;
    height: 4px;
    background-color: #003366;
    z-index: 1;
}

.timeline-item.left::before {
    right: -20px;
}

.timeline-item.right::before {
    left: -20px;
    transform: rotate(180deg);
}

@media screen and (max-width: 768px) {
    .cv-container {
        flex-direction: column;
    }

    .left-section, .right-section {
        width: 100%;
    }

    #projets {
        flex-direction: column;
        align-items: center;
    }

    .project {
        width: 100%;
        margin-bottom: 20px;
    }

    .realisation-card {
        flex-direction: column;
    }

    .timeline-item {
        width: 100%;
        left: 0;
        transform: translateX(0);
    }

    .timeline-item.left .details,
    .timeline-item.right .details {
        margin: 0;
        text-align: center;
    }

    .timeline-item::before {
        left: 50%;
        transform: translateX(-50%);
    }

    .timeline-item .date {
        position: static;
        margin-bottom: 10px;
    }

    .timeline article {
        width: 100%;
        margin-left: 0;
    }

    .timeline article:before,
    .timeline article:after {
        left: 50%;
        transform: translateX(-50%);
    }

    .timeline article:nth-child(even):before,
    .timeline article:nth-child(even):after {
        left: 50%;
        transform: translateX(-50%);
    }
}

/* Animation pour la frise chronologique */
.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}
