.project-timeline {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.6;
}

.timeline-year {
    margin-bottom: 30px;
}

.timeline-year h2 {
    color: #2c3e50;
    font-size: 2.2em;
    font-weight: 300;
    border-bottom: 3px solid #3498db;
    padding-bottom: 10px;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.timeline-item {
    margin-bottom: 15px;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
    position: relative;
}

.timeline-item:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Use height-based hiding instead of display:none for smooth animations */
.timeline-item.collapsed .timeline-content {
    height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    overflow: hidden;
    border-top: none !important;
}

/* Add a class to prevent pointer events during animation */
.timeline-item.animating {
    pointer-events: none;
}

/* Ensure smooth transitions */
.timeline-item .timeline-content {
    overflow: hidden;
    transition: height 0.3s ease, padding 0.3s ease, border 0.3s ease;
}

.timeline-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 20px 25px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    min-height: 60px;
    transition: background-color 0.3s ease;
}

.timeline-header:hover {
    background-color: #e9ecef;
}

.timeline-title-full {
    color: #495057;
    font-size: 1.3em;
    font-weight: 600;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    flex: 1;
    margin-right: 15px;
}

.toggle-icon {
    font-size: 18px;
    color: #6c757d;
    transition: all 0.3s ease;
    font-weight: bold;
    opacity: 0.8;
}

.toggle-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}

.timeline-item.animating {
    pointer-events: none;
}

.timeline-content {
    padding: 25px;
    background-color: #ffffff;
    border-top: 1px solid #e1e8ed;
    overflow: hidden;
    transition: all 0.3s ease;
    /* Ensure content is properly positioned during animations */
    position: relative;
    will-change: height, opacity;
}

.timeline-content p {
    margin: 15px 0;
    color: #34495e;
    font-size: 1em;
    line-height: 1.7;
}

.timeline-image {
    max-width: 100%;
    height: auto;
    cursor: pointer;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    padding: 8px;
    margin-top: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.timeline-image:hover {
    transform: scale(1.02);
    border-color: #3498db;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.pdf-link {
    display: inline-block;
    background-color: #2c3e50;
    color: white !important;
    padding: 12px 20px;
    text-decoration: none;
    border-radius: 25px;
    margin-top: 15px;
    transition: all 0.3s ease;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(44, 62, 80, 0.3);
}

.pdf-link:hover {
    background-color: #34495e;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(44, 62, 80, 0.4);
    text-decoration: none;
}

/* Lightbox Styles */
.timeline-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
    overflow: auto;
    padding: 60px 20px 20px 20px;
    box-sizing: border-box;
}

.timeline-lightbox-content {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.timeline-lightbox-content img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

.timeline-lightbox-close {
    position: fixed;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 35px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: all 0.3s ease;
    z-index: 10001;
}

.timeline-lightbox-close:hover {
    opacity: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .project-timeline {
        max-width: 95%;
        margin: 0 2.5%;
    }

    .timeline-header {
        padding: 15px 20px;
        flex-direction: column;
        align-items: flex-start;
    }

    .timeline-title {
        margin-top: 8px;
        margin-right: 0;
    }

    .toggle-icon {
        position: absolute;
        top: 15px;
        right: 20px;
    }

    .timeline-content {
        padding: 20px;
    }

    .timeline-lightbox-overlay {
        padding: 70px 10px 10px 10px;
    }

    .timeline-lightbox-close {
        top: 10px;
        right: 10px;
        font-size: 28px;
        width: 40px;
        height: 40px;
    }

    .timeline-lightbox-content img {
        max-width: 100%;
        max-height: 100%;
    }
}