/**
 * Timeline Shortcode Styles
 */

.sosve-timeline {
    margin: 60px 0;
    position: relative;
    font-family: Arial, sans-serif;
}

/* Timeline bar */
.timeline-bar-container {
    position: relative;
    padding: 20px 0;
    margin-bottom: 0;
    margin-top: 0;
}

.timeline-bar {
    position: relative;
    height: 4px;
    background-color: #e0e0e0;
    margin: 0 auto;
    padding-right: 30px; /* Add extra space after the last item */
}

/* End marker for timeline */
.timeline-end-marker {
    position: absolute;
    right: -15px; /* Width of the SVG */
    top: -7px; /* Half the height of the SVG to center it */
    z-index: 2;
}

.timeline-end-marker svg {
    display: block;
}

.timeline-years {
    display: flex;
    position: relative;
    justify-content: flex-start;
    width: 100%;
}

/* Timeline year */
.timeline-year {
    position: relative;
    text-align: center;
    cursor: pointer;
    flex: 0 0 auto;
}

/* Space between years */
.timeline-year + .timeline-year {
    margin-left: auto;
}

/* First year should be at the beginning */
.timeline-year:first-child {
    margin-right: 0;
    text-align: left;
}

/* First year marker should be at the beginning */
.timeline-year:first-child .timeline-year-marker {
    left: 0;
    transform: translateX(0);
}

/* First year label should be at the beginning */
.timeline-year:first-child.top-label .timeline-year-label {
    left: 0;
}

.timeline-year:first-child.bottom-label .timeline-year-label {
    left: 0;
    transform: translateX(0);
    text-align: left;
}

/* Last year should be at the end */
.timeline-year:last-child {
    margin-left: auto;
    text-align: right;
}

/* Last year marker should be at the end */
.timeline-year:last-child .timeline-year-marker {
    left: auto;
    right: 0;
    transform: translateX(0);
}

/* Last year label should be at the end */
.timeline-year:last-child.top-label .timeline-year-label {
    left: auto;
    right: auto;

}

.timeline-year:last-child.bottom-label .timeline-year-label {
    left: auto;
    text-align: right;
}

.timeline-year-marker {
    position: absolute;
    top: -9px; /* Half the height of the SVG to center it on the line */
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    transition: all 0.3s ease;
}

.timeline-year-marker svg {
    display: block;
}

.timeline-year.active .timeline-year-marker {
    transform: translateX(-50%) scale(1.2);
    filter: drop-shadow(0 0 4px rgba(0, 159, 227, 0.4));
}

/* Fix transform for first and last markers when active */
.timeline-year:first-child.active .timeline-year-marker {
    transform: translateX(0) scale(1.2);
}

.timeline-year:last-child.active .timeline-year-marker {
    transform: translateX(0) scale(1.2);
}

.timeline-year-label {
    position: absolute;
    font-size: 20px;
    font-weight: 200;
    color: #9CA4B3;
    transition: all 0.3s ease;
}

/* Top label positioning */
.timeline-year.top-label .timeline-year-label {
    top: -40px;
 
    transform: translateX(-50%);
    text-align: center;
}

/* Bottom label positioning */
.timeline-year.bottom-label .timeline-year-label {
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.timeline-year.active .timeline-year-label {
    color: #009fe3;
    font-weight: 500;
}

/* Active year indicator */
.timeline-year::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: #e0e0e0;
    z-index: 1;
}

.timeline-year.active::before {
    background-color: #009fe3;
}

/* First and last years */
.timeline-year:first-child::before {
    left: 0;
    width: 50%;
}

.timeline-year:last-child::before {
    width: 50%;
}

/* Timeline items container */
.timeline-items-container {
    position: relative;
}

.timeline-items-container .timeline-item:nth-of-type(1) {
    display: block;
}

/* Timeline item */
.timeline-item {
    display: none;
    position: absolute;
    z-index: 10;
    width: 197px;
    transition: all 0.3s ease;
}

/* Top items (above timeline) */
.timeline-item.top {
    bottom: 100%;
    margin-bottom: 125px;
} 

/* Bottom items (below timeline) */
.timeline-item.bottom {
    top: 100%;
    margin-top: 75px;
}

.timeline-item.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Timeline bubble */
.timeline-bubble {
    background-color: #fff;
    border: 2px solid #009FE3;
    border-radius: 8px;
    padding: 10px 10px 12px;
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    max-width: 197px;
}

/* Close button */
.timeline-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 14px;
    height: 13px;
    cursor: pointer;
    z-index: 3;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

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

.timeline-close svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* Arrow for top items */
.timeline-item.top .timeline-arrow {
    position: absolute;
    bottom: -75px; /* Height of the SVG */
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    margin-top: 10px;
}

/* Arrow for bottom items */
.timeline-item.bottom .timeline-arrow {
    position: absolute;
    top: -75px; /* Height of the SVG */
    left: 50%;
    transform: translateX(-50%) rotate(180deg); /* Flip the arrow */
    z-index: 2;
    margin-bottom: 10px; /* Additional spacing between bubble and arrow */
}

/* For bottom items, we need to add margin to the bubble as well */
.timeline-item.bottom .timeline-bubble {
    margin-top: 10px; /* Add spacing between bubble and arrow for bottom items */
}

/* SVG sizing */
.timeline-arrow svg {
    display: block;
}

.timeline-content {
    font-size: 16px;
    margin-top: 20px;
    line-height: 1.5;
    color: #9CA4B3;
}

.timeline-content p {
    line-height: 1.2;
    margin: 0px;
    color: #9CA4B3;
}

.timeline-content p:last-child {
    margin-bottom: 0;
}

/* Responsive styles */
@media (max-width: 768px) {
    .timeline-item {
        width: 220px;
    }
    
    .timeline-year-label {
        font-size: 12px;
    }
}

