.gsafrica-timeline-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
    position: relative;
}

.gsafrica-timeline-title {
    text-align: center;
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 100px;
    color: #333;
}

.gsafrica-timeline {
    position: relative;
    padding: 0 0 0 0;
}

/* Vertical solid line - centered */
.gsafrica-timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #5EB84A;
    transform: translateX(-50%);
    z-index: 0;
}

/* Stop line at last item's small circle - cover the line below */
.gsafrica-timeline-item:last-child::after {
    content: '';
    position: absolute;
    left: 50%;
    top: calc(50% + 10px);
    width: 5px;
    height: 2000px;
    background: white;
    transform: translateX(-50%);
    z-index: 1;
    pointer-events: none;
}

.gsafrica-timeline-item {
    position: relative;
    margin-bottom: 60px;
    display: flex;
    align-items: flex-start;
    width: 100%;
}

.gsafrica-timeline-item:first-child {
    margin-top: 0;
}

.gsafrica-timeline-item:last-child {
    margin-bottom: 0;
}

/* Date marker - positioned on left or right side of line with spacing */
.gsafrica-timeline-date-marker {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: flex;
    flex-direction: row;
    align-items: center;
}

/* First item at the top - center aligned with top of line */
.gsafrica-timeline-item.first-item .gsafrica-timeline-date-marker,
.gsafrica-timeline-item:first-child .gsafrica-timeline-date-marker {
    top: 0;
    transform: translateY(-50%);
}

/* Items on the left side - circle positioned with space from line, arrow on right of circle */
.gsafrica-timeline-item.left .gsafrica-timeline-date-marker {
    transform: translate(calc(-100% - 30px), -50%);
    left: 50%;
    flex-direction: row;
}

.gsafrica-timeline-item.left.first-item .gsafrica-timeline-date-marker,
.gsafrica-timeline-item.left:first-child .gsafrica-timeline-date-marker {
    top: 0;
    transform: translate(calc(-100% - 30px), -50%);
}

/* Items on the right side - circle positioned with space from line, arrow on left of circle */
.gsafrica-timeline-item.right .gsafrica-timeline-date-marker {
    transform: translate(30px, -50%);
    left: 50%;
    flex-direction: row;
}

.gsafrica-timeline-item.right.first-item .gsafrica-timeline-date-marker,
.gsafrica-timeline-item.right:first-child .gsafrica-timeline-date-marker {
    top: 0;
    transform: translate(30px, -50%);
}

/* Circle with text inside - larger and bolder */
.gsafrica-timeline-date-circle {
    width: 90px;
    height: 90px;
    border: 10px solid #5EB84A;
    border-radius: 50%;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #5EB84A;
    text-align: center;
    line-height: 1.2;
    padding: 5px;
    flex-shrink: 0;
    word-break: keep-all;
}

.gsafrica-timeline-date-circle > div {
    display: block;
    line-height: 1.2;
}

/* Triangular pointer pointing toward the vertical line */
.gsafrica-timeline-date-pointer {
    width: 0;
    height: 0;
    flex-shrink: 0;
}

/* Pointer for left side items (pointing right toward the line) */
.gsafrica-timeline-item.left .gsafrica-timeline-date-pointer {
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
    border-left: 15px solid #5EB84A;
    margin-left: -5px;
    position: relative;
}

/* Pointer for right side items (pointing left toward the line) */
.gsafrica-timeline-item.right .gsafrica-timeline-date-pointer {
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
    border-right: 15px solid #5EB84A;
    margin-right: -5px;
    position: relative;
}

/* Small circle at the tip of arrow where it meets the vertical line */
.gsafrica-timeline-line-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    border: 3px solid #5EB84A;
    box-shadow: 0 0 0 2px #5EB84A;
    z-index: 3;
}

.gsafrica-timeline-item.first-item .gsafrica-timeline-line-dot,
.gsafrica-timeline-item:first-child .gsafrica-timeline-line-dot {
    top: 0;
    transform: translate(-50%, -50%);
}

/* Dashed horizontal line from small circle to content */
.gsafrica-timeline-connector-line {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 0;
    border-top: 1px dashed #5EB84A;
    border-image: none;
    z-index: 2;
}

/* Connector line for left side items (extends right from center to content) */
.gsafrica-timeline-item.left .gsafrica-timeline-connector-line {
    left: calc(50% + 10px);
    width: 80px;
}

/* Connector line for right side items (extends left from center to content) */
.gsafrica-timeline-item.right .gsafrica-timeline-connector-line {
    right: calc(50% + 10px);
    width: 80px;
}

.gsafrica-timeline-item.first-item .gsafrica-timeline-connector-line,
.gsafrica-timeline-item:first-child .gsafrica-timeline-connector-line {
    top: 0;
    transform: translateY(-50%);
}

/* Content wrapper - alternating sides */
.gsafrica-timeline-content {
    position: relative;
    width: 45%;
}

/* Items without images - align text with dashed line */
.gsafrica-timeline-content > .gsafrica-timeline-text {
    margin-top: -20px;
}

/* First item - ensure text aligns with dashed line at top */
.gsafrica-timeline-item.first-item .gsafrica-timeline-content,
.gsafrica-timeline-item:first-child .gsafrica-timeline-content {
    margin-top: -60px;
}

.gsafrica-timeline-item.first-item .gsafrica-timeline-content > .gsafrica-timeline-text,
.gsafrica-timeline-item:first-child .gsafrica-timeline-content > .gsafrica-timeline-text {
    margin-top: 0;
}

/* Content on the right side (when marker is on left) - starts at end of dashed line with padding */
.gsafrica-timeline-item.left .gsafrica-timeline-content {
    margin-left: calc(50% + 90px);
    padding-left: 15px;
    text-align: left;
}

/* Content on the left side (when marker is on right) - starts at end of dashed line with padding */
.gsafrica-timeline-item.right .gsafrica-timeline-content {
    margin-right: calc(50% + 90px);
    padding-right: 15px;
    text-align: right;
}

.gsafrica-timeline-content-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-top: -20px;
}

.gsafrica-timeline-image {
    flex-shrink: 0;
    width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
}

.gsafrica-timeline-item.left .gsafrica-timeline-content-wrapper {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.gsafrica-timeline-item.right .gsafrica-timeline-content-wrapper {
    flex-direction: row;
}

/* Text content */
.gsafrica-timeline-text {
    flex: 1;
}

.gsafrica-timeline-title-text {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.gsafrica-timeline-item.first-item .gsafrica-timeline-title-text,
.gsafrica-timeline-item:first-child .gsafrica-timeline-title-text {
    margin-top: 0;
    line-height: 1.2;
}

.gsafrica-timeline-subtitle {
    font-size: 15px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.gsafrica-timeline-location {
    font-size: 14px;
    color: #888;
    margin-bottom: 8px;
}

.gsafrica-timeline-description {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
}

/* Responsive design */
@media (max-width: 768px) {
    .gsafrica-timeline::before {
        left: 30px;
    }

    .gsafrica-timeline-item.left .gsafrica-timeline-date-marker,
    .gsafrica-timeline-item.right .gsafrica-timeline-date-marker {
        left: 30px;
        transform: translateX(-50%) translateY(-50%);
    }

    .gsafrica-timeline-date-circle {
        width: 70px;
        height: 70px;
        font-size: 13px;
        border-width: 4px;
    }

    .gsafrica-timeline-item.left .gsafrica-timeline-date-pointer,
    .gsafrica-timeline-item.right .gsafrica-timeline-date-pointer {
        border-top: 12px solid transparent;
        border-bottom: 12px solid transparent;
        border-left: 12px solid #5EB84A;
        border-right: none;
    }

    .gsafrica-timeline-item.left .gsafrica-timeline-content,
    .gsafrica-timeline-item.right .gsafrica-timeline-content {
        width: calc(100% - 100px);
        margin-left: 100px;
        padding-left: 20px;
        padding-right: 0;
        text-align: left;
    }

    .gsafrica-timeline-content-wrapper {
        flex-direction: column !important;
    }

    .gsafrica-timeline-image {
        width: 100%;
        max-width: 300px;
    }
}
