/* Timeline Styles */
.timeline-container {
    width: 1000px;
    margin: 50px auto;
    position: relative;
    padding: 20px 0;
}

/* Timeline Years */
.timeline-years {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 0 20px;
}

.year {
    font-weight: 600;
    color: #fff;
    opacity: 0.7;
    transition: all 0.3s ease;
}

/* Timeline Line */
.timeline-line {
    position: relative;
    height: 4px;
    margin: 20px 0 25px;
}

.timeline-line .line {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(102, 102, 102, 0.87) 0%, rgb(255, 255, 255) 100%);
    /* border-radius: 2px; */
}

/* Timeline Events */
.timeline-events {
    position: relative;
    height: 300px;
    margin-bottom: 40px;
}

/* Event Connections */
.event-connections {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.connection-line {
    position: absolute;
    height: 3px;
    border-radius: 2px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    transform: translateY(-50%);
}

.connection-line:hover {
    opacity: 0.9;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: pulse 1.5s infinite;
}

/* Connection line colors matching event categories */
.connection-line[data-category="education"] {
    background: linear-gradient(90deg, #46dff0, rgba(70, 223, 240, 0.7));
    box-shadow: 0 0 4px rgba(70, 223, 240, 0.4);
}

.connection-line[data-category="work"] {
    background: linear-gradient(90deg, #e90c59, rgba(233, 12, 89, 0.7));
    box-shadow: 0 0 4px rgba(233, 12, 89, 0.4);
}

.connection-line[data-category="publication"] {
    background: linear-gradient(90deg, #9c27b0, rgba(156, 39, 176, 0.7));
    box-shadow: 0 0 4px rgba(156, 39, 176, 0.4);
}

.connection-line[data-category="project"] {
    background: linear-gradient(90deg, #ff9800, rgba(255, 152, 0, 0.7));
    box-shadow: 0 0 4px rgba(255, 152, 0, 0.4);
}

.event-marker {
    position: absolute;
    bottom: 100%;
    transform: translateX(-50%);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
}

.event-dot {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    /* margin-bottom: -18px; */
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.event-dot-vtech {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    /* margin-bottom: -18px; */
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.event-marker[data-category="education"] .event-dot {
    top: -1px;
}

.event-marker[data-category="education"] .event-dot-vtech {
    top: -1px;
}

.event-marker[data-category="work"] .event-dot {
    top: -23px;
}

.event-marker[data-event-id="lilly"] .event-dot {
    top: -45px;
}

.event-marker[data-category="publication"] .event-dot {
    top: -45px;
}

.event-marker[data-category="project"] .event-dot {
    top: -45px;
}

.event-marker[data-event-id="lims"] .event-dot {
    left: 245px;
}

.event-marker[data-event-id="basf"] .event-dot {
    left: 445px;
}

.event-marker[data-event-id="lims"] .event-info {
    left: 325px;
    margin-bottom: 20px;
}

.event-marker[data-index="2"] .event-info {
    margin-bottom: 20px;
}

.event-marker[data-index="3"] .event-info {
    margin-bottom: 40px;
}


/* Event Categories Colors */
.event-marker[data-category="education"] .event-dot,
.legend-dot[data-category="education"] {
    background-color: #46dff0;
    box-shadow: 0 0 10px rgba(70, 223, 240, 0.7);
}

.event-marker[data-category="education"] .event-dot-vtech,
.legend-dot[data-category="education"] {
    background-color: #46dff0;
    box-shadow: 0 0 10px rgba(70, 223, 240, 0.7);
}

.event-marker[data-category="work"] .event-dot,
.legend-dot[data-category="work"] {
    background-color: #e90c59;
    box-shadow: 0 0 10px rgba(233, 12, 89, 0.7);
}

.event-marker[data-category="publication"] .event-dot,
.legend-dot[data-category="publication"] {
    background-color: #9c27b0;
    box-shadow: 0 0 10px rgba(156, 39, 176, 0.7);
}

.event-marker[data-category="project"] .event-dot,
.legend-dot[data-category="project"] {
    background-color: #ff9800;
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.7);
}

/* Event Info Box */
.event-info {
    position: absolute;
    width: 300px;
    background: rgba(30, 30, 30, 0.9);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 10;
    left: 50%;
    transform: translateX(-50%);
    bottom: 30px;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}



.event-marker:hover .event-dot {
    transform: scale(1.5);
}

.event-marker:hover .event-dot-vtech {
    transform: scale(1.5);
}


.event-marker:hover .event-info {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) translateX(-50%);
}

/* Pinned card stays visible until user clicks elsewhere */
.timeline-has-pinned .event-marker.timeline-pinned .event-info {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 30;
}

/* Pinned state - keep dot scaled and pulsing */
.event-marker.timeline-pinned .event-dot,
.event-marker.timeline-pinned .event-dot-vtech {
    transform: scale(1.5);
}

.event-marker.timeline-pinned[data-category="education"] .event-dot,
.event-marker.timeline-pinned[data-category="education"] .event-dot-vtech {
    animation: pulseEducation 1.2s ease-in-out infinite;
}

.event-marker.timeline-pinned[data-category="work"] .event-dot,
.event-marker.timeline-pinned[data-category="work"] .event-dot-vtech {
    animation: pulseWork 1.2s ease-in-out infinite;
}

.event-marker.timeline-pinned[data-category="publication"] .event-dot,
.event-marker.timeline-pinned[data-category="publication"] .event-dot-vtech {
    animation: pulsePublication 1.2s ease-in-out infinite;
}

.event-marker.timeline-pinned[data-category="project"] .event-dot,
.event-marker.timeline-pinned[data-category="project"] .event-dot-vtech {
    animation: pulseProject 1.2s ease-in-out infinite;
}

/* Pinned connection line - keep pulsing */
.connection-line.timeline-pinned[data-category="education"] {
    animation: pulseLineEducation 1.2s ease-in-out infinite;
    height: 5px;
}

.connection-line.timeline-pinned[data-category="work"] {
    animation: pulseLineWork 1.2s ease-in-out infinite;
    height: 5px;
}

.connection-line.timeline-pinned[data-category="publication"] {
    animation: pulseLinePublication 1.2s ease-in-out infinite;
    height: 5px;
}

.connection-line.timeline-pinned[data-category="project"] {
    animation: pulseLineProject 1.2s ease-in-out infinite;
    height: 5px;
}

/* Connection line pinned popup */
.connection-line.timeline-pinned .event-info-popup {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.event-info h3 {
    margin: 0 0 5px;
    color: #fff;
    font-size: 18px;
}

.event-info h4 {
    margin: 0 0 10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 400;
}

.event-date {
    display: inline-block;
    background: rgba(70, 223, 240, 0.2);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-bottom: 10px;
    color: #46dff0;
}

.event-info p {
    margin: 5px 0;
    font-size: 14px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.7);
}

/* Timeline Legend */
.timeline-legend {
    display: flex;
    width: 90%;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-right: 15px;
    font-size: 14px;
    color: #fff;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 6px;
    display: inline-block;
}

/* Animation for dots */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.event-marker:hover .event-dot {
    animation: pulse 1.5s infinite;
}

.event-marker:hover .event-dot-vtech {
    animation: pulse 1.5s infinite;
}

/* ========== Timeline Hover Group Effects ========== */

/* Pulse animations for different categories */
@keyframes pulseEducation {
    0% { box-shadow: 0 0 5px rgba(70, 223, 240, 0.6); }
    50% { box-shadow: 0 0 20px rgba(70, 223, 240, 1), 0 0 30px rgba(70, 223, 240, 0.6); }
    100% { box-shadow: 0 0 5px rgba(70, 223, 240, 0.6); }
}

@keyframes pulseWork {
    0% { box-shadow: 0 0 5px rgba(233, 12, 89, 0.6); }
    50% { box-shadow: 0 0 20px rgba(233, 12, 89, 1), 0 0 30px rgba(233, 12, 89, 0.6); }
    100% { box-shadow: 0 0 5px rgba(233, 12, 89, 0.6); }
}

@keyframes pulsePublication {
    0% { box-shadow: 0 0 5px rgba(156, 39, 176, 0.6); }
    50% { box-shadow: 0 0 20px rgba(156, 39, 176, 1), 0 0 30px rgba(156, 39, 176, 0.6); }
    100% { box-shadow: 0 0 5px rgba(156, 39, 176, 0.6); }
}

@keyframes pulseProject {
    0% { box-shadow: 0 0 5px rgba(255, 152, 0, 0.6); }
    50% { box-shadow: 0 0 20px rgba(255, 152, 0, 1), 0 0 30px rgba(255, 152, 0, 0.6); }
    100% { box-shadow: 0 0 5px rgba(255, 152, 0, 0.6); }
}

@keyframes pulseLineEducation {
    0% { 
        box-shadow: 0 0 5px rgba(70, 223, 240, 0.6);
        opacity: 0.6;
    }
    50% { 
        box-shadow: 0 0 15px rgba(70, 223, 240, 1), 0 0 25px rgba(70, 223, 240, 0.8);
        opacity: 1;
    }
    100% { 
        box-shadow: 0 0 5px rgba(70, 223, 240, 0.6);
        opacity: 0.6;
    }
}

@keyframes pulseLineWork {
    0% { 
        box-shadow: 0 0 5px rgba(233, 12, 89, 0.6);
        opacity: 0.6;
    }
    50% { 
        box-shadow: 0 0 15px rgba(233, 12, 89, 1), 0 0 25px rgba(233, 12, 89, 0.8);
        opacity: 1;
    }
    100% { 
        box-shadow: 0 0 5px rgba(233, 12, 89, 0.6);
        opacity: 0.6;
    }
}

@keyframes pulseLinePublication {
    0% { 
        box-shadow: 0 0 5px rgba(156, 39, 176, 0.6);
        opacity: 0.6;
    }
    50% { 
        box-shadow: 0 0 15px rgba(156, 39, 176, 1), 0 0 25px rgba(156, 39, 176, 0.8);
        opacity: 1;
    }
    100% { 
        box-shadow: 0 0 5px rgba(156, 39, 176, 0.6);
        opacity: 0.6;
    }
}

@keyframes pulseLineProject {
    0% { 
        box-shadow: 0 0 5px rgba(255, 152, 0, 0.6);
        opacity: 0.6;
    }
    50% { 
        box-shadow: 0 0 15px rgba(255, 152, 0, 1), 0 0 25px rgba(255, 152, 0, 0.8);
        opacity: 1;
    }
    100% { 
        box-shadow: 0 0 5px rgba(255, 152, 0, 0.6);
        opacity: 0.6;
    }
}

/* Group hover state - applied via JavaScript */
.timeline-group-hover .event-dot,
.timeline-group-hover .event-dot-vtech {
    transform: scale(1.5);
}

.timeline-group-hover[data-category="education"] .event-dot,
.timeline-group-hover[data-category="education"] .event-dot-vtech {
    animation: pulseEducation 1.2s ease-in-out infinite;
}

.timeline-group-hover[data-category="work"] .event-dot,
.timeline-group-hover[data-category="work"] .event-dot-vtech {
    animation: pulseWork 1.2s ease-in-out infinite;
}

.timeline-group-hover[data-category="publication"] .event-dot,
.timeline-group-hover[data-category="publication"] .event-dot-vtech {
    animation: pulsePublication 1.2s ease-in-out infinite;
}

.timeline-group-hover[data-category="project"] .event-dot,
.timeline-group-hover[data-category="project"] .event-dot-vtech {
    animation: pulseProject 1.2s ease-in-out infinite;
}

/* Connection line hover state */
.connection-line.timeline-group-hover[data-category="education"] {
    animation: pulseLineEducation 1.2s ease-in-out infinite;
    height: 5px;
}

.connection-line.timeline-group-hover[data-category="work"] {
    animation: pulseLineWork 1.2s ease-in-out infinite;
    height: 5px;
}

.connection-line.timeline-group-hover[data-category="publication"] {
    animation: pulseLinePublication 1.2s ease-in-out infinite;
    height: 5px;
}

.connection-line.timeline-group-hover[data-category="project"] {
    animation: pulseLineProject 1.2s ease-in-out infinite;
    height: 5px;
}

/* Event info shown when group is hovered */
.timeline-group-hover .event-info {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) translateX(-50%);
    pointer-events: auto;
}

/* Connection line centered info popup */
.connection-line .event-info-popup {
    position: absolute;
    width: 300px;
    background: rgba(30, 30, 30, 0.95);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(20px);
    transition: all 0.3s ease;
    z-index: 100;
    left: 50%;
    bottom: 25px;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.connection-line.timeline-group-hover .event-info-popup {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}


/* Responsive styles */
@media (max-width: 768px) {
    .timeline-container {
        width: 95%;
    }
    
    .timeline-years {
        font-size: 12px;
    }
    
    .event-info {
        width: 250px;
    }
}

@media (max-width: 480px) {
    .timeline-years {
        font-size: 10px;
    }
    
    .event-info {
        width: 200px;
        padding: 10px;
    }
    
    .event-info h3 {
        font-size: 16px;
    }
    
    .event-info p {
        font-size: 12px;
    }
    
    .timeline-legend {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}
