/* experience.css - Spécifique à la page Expériences */

/* Conteneur principal de la timeline */
.timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 0;
}

/* La ligne verticale centrale */
.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: var(--accent-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
    border-radius: 2px;
}

/* Les boîtes (gauche et droite) */
.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
    box-sizing: border-box;
}

.timeline-item.left {
    left: 0;
}

.timeline-item.right {
    left: 50%;
}

/* Le point central */
.timeline-dot {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: var(--bg-color);
    border: 4px solid var(--accent-color);
    top: 25px;
    border-radius: 50%;
    z-index: 3;
}

.timeline-item.left .timeline-dot {
    right: -10px;
    /* C'était -14px avant. 10px = moitié de la largeur du point */
}

.timeline-item.right .timeline-dot {
    left: -10px;
    /* C'était -14px avant */
}

/* La date (positionnement corrigé) */
.timeline-date {
    position: absolute;
    top: 25px;
    font-weight: bold;
    color: var(--accent-color);
    font-family: 'Space Mono', monospace;
    width: 150px;
}

.timeline-item.left .timeline-date {
    right: -200px;
    text-align: left;
}

.timeline-item.right .timeline-date {
    left: -200px;
    text-align: right;
}

/* Le contenu (Carte) */
.timeline-content {
    padding: 20px;
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    backdrop-filter: blur(5px);
}

.timeline-content:not(.expanded):hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Typographie interne */
.header-content h3 {
    margin: 0 0 5px 0;
    font-size: 1.2rem;
}

.company-location {
    font-size: 0.85rem;
    color: #888;
    font-style: italic;
}

.role-desc {
    font-style: italic;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

/* Liste des tâches */
.job-tasks {
    list-style: none;
    padding: 0;
    margin-bottom: 15px;
}

.job-tasks li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.job-tasks li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

/* Badges Techno */
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.tech-badge {
    background: #eee;
    color: #333;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-family: 'Space Mono', monospace;
}

.dark-mode .tech-badge {
    background: #333;
    color: #fff;
}

/* EXPANSION LOGIC */
.timeline-content {
    cursor: pointer;
    position: relative;
    z-index: 2;
    transform-origin: left center;
}

.timeline-item.right .timeline-content {
    transform-origin: right center;
}

.timeline-content.expanded {
    width: 180%;
    z-index: 100 !important;
    background: var(--glass-bg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    border-color: var(--accent-color);
}

/* Ensure the container keeps layout size but content shifts */
.timeline-item.right {
    display: flex;
    justify-content: flex-end;
}

.timeline-item.right .timeline-content {
    width: 100%;
    flex-shrink: 0;
    /* Prevents flex container from squishing the horizontal expansion */
}

.timeline-item.right .timeline-content.expanded {
    /* Anchored by flex-end, expanding width will naturally grow to the left! */
    width: 180%;
    margin-left: 0;
}

/* Hide/Show details */
.experience-details {
    display: none;
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.timeline-content.expanded .experience-details {
    display: flex;
    gap: 20px;
    opacity: 1;
    flex-direction: column;
    /* Mobile first / stack */
}

@media (min-width: 768px) {
    .timeline-content.expanded .experience-details {
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
    }
}

.exp-image-container {
    flex: 1;
    max-width: 300px;
}

.exp-image {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.exp-image:hover {
    transform: scale(1.02);
}

/* MODAL IMAGE EXPÉRIENCE */
.image-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-modal.active {
    display: flex;
    opacity: 1;
}

.image-modal-content {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
    object-fit: contain;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.image-modal.active .image-modal-content {
    transform: scale(1);
}

.close-image-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
    transition: color 0.3s;
}

.close-image-modal:hover {
    color: var(--accent-color);
}

.exp-extra-info {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Adjust timeline dot/date z-index so content goes over them if needed */
.timeline-dot,
.timeline-date {
    z-index: 1;
}

/* RESPONSIVE MOBILE */
@media screen and (max-width: 768px) {

    /* On annule une partie du padding global pour utiliser tout l'écran */
    .timeline {
        margin-left: -5vw;
        margin-right: -5vw;
    }

    .timeline::after {
        left: 20px;
        /* Ligne centrée sur la gauche */
    }

    .timeline-item {
        width: 100%;
        padding-left: 50px;
        /* 30px entre la ligne et la carte, 20px entre l'écran et la ligne */
        padding-right: 15px;
        /* Équilibre l'espace global */
    }

    .timeline-item.left,
    .timeline-item.right {
        left: 0;
        display: block;
    }

    .timeline-item.left .timeline-dot,
    .timeline-item.right .timeline-dot {
        left: 10px;
        /* 20px (la ligne) - 10px (le rayon de la pastille)  */
        right: auto;
    }

    .timeline-content {
        padding: 16px;
        /* Ajusté à 16px de remplissage intérieur comme demandé */
    }

    .timeline-date {
        position: relative;
        top: -5px;
        left: 0 !important;
        right: auto !important;
        text-align: left !important;
        margin-bottom: 10px;
        display: block;
    }

    /* Maintain scaling effect on mobile or reset if desired */
    .timeline-content.expanded,
    .timeline-item.right .timeline-content.expanded {
        width: 100%;
        margin-left: 0 !important;
    }
}