/* Custom CSS for Timeline on Berufliche Stationen page */

.timeline {
    position: relative;
    padding: 20px 0;
    margin-bottom: 60px; /* Add more space at the bottom */
    clear: both; /* Ensure no floating elements interfere */
}

.timeline:before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3px;
    margin-left: -1.5px;
    background-color: var(--light-gray);
}

.timeline-item {
    position: relative;
    margin-bottom: 50px;
    width: 100%;
    clear: both; /* Clear any floating elements */
    overflow: hidden; /* Contain floated children */
}

.timeline-item:after {
    content: "";
    display: table;
    clear: both; /* Clear floats after each item */
}

.timeline-badge {
    position: absolute;
    top: 16px;
    left: 50%;
    width: 50px;
    height: 50px;
    margin-left: -25px;
    border-radius: 50%;
    text-align: center;
    font-size: 1.4em;
    line-height: 50px;
    color: var(--white);
    z-index: 100;
    background-color: var(--medium-gray) !important;
}

.timeline-panel {
    position: relative;
    width: 46%;
    float: left;
    padding: 20px;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
    background-color: var(--white);
    margin-bottom: 20px;
}

.timeline-item:nth-child(even) .timeline-panel {
    float: right;
}

.timeline-item:nth-child(odd) .timeline-panel:before {
    content: '';
    position: absolute;
    top: 26px;
    right: -15px;
    border-top: 15px solid transparent;
    border-left: 15px solid var(--light-gray);
    border-right: 0 solid var(--light-gray);
    border-bottom: 15px solid transparent;
}

.timeline-item:nth-child(even) .timeline-panel:before {
    content: '';
    position: absolute;
    top: 26px;
    left: -15px;
    border-top: 15px solid transparent;
    border-right: 15px solid var(--light-gray);
    border-left: 0 solid var(--light-gray);
    border-bottom: 15px solid transparent;
}

/* Responsive adjustments for timeline */
@media (max-width: 767px) {
    .timeline:before {
        left: 40px;
    }
    
    .timeline-badge {
        left: 40px;
        margin-left: 0;
    }
    
    .timeline-panel {
        width: calc(100% - 90px);
        float: right;
    }
    
    .timeline-item:nth-child(odd) .timeline-panel:before {
        border-left-width: 0;
        border-right-width: 15px;
        left: -15px;
        right: auto;
    }
}

/* Ensure footer is properly separated */
.career-timeline-section {
    padding-bottom: 60px; /* Add extra padding at the bottom */
    overflow: hidden; /* Contain all floated elements */
}

/* Clear floats before footer */
footer {
    clear: both;
    position: relative;
    margin-top: 20px;
    width: 100%;
}
