/**
 * Timeline Component Styles
 * Modern image-focused timeline design with improved spacing
 */

.timeline {
    position: relative;
    margin: 60px 0;
    padding: 0;
}

.timeline-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 50px;
    position: relative;
}

/* Alternate timeline items left and right on larger screens */
@media (min-width: 768px) {
    .timeline-item {
        flex-direction: row;
        align-items: center;
    }    
    
    .timeline-item:nth-child(odd) .timeline-image {
        padding-right: 60px; /* Increased spacing from center line */
        padding-left: 0px; /* Increased spacing from center line */
    }

    .timeline-item:nth-child(odd) .timeline-content {
        text-align: left;
        padding-right: 0px; /* Increased spacing from center line */
        padding-left: 60px; /* Increased spacing from center line */
    }
    
    .timeline-item:nth-child(even) {
        flex-direction: row-reverse;
    }
        
    .timeline-item:nth-child(even) .timeline-image {
        padding-right: 0px; /* Increased spacing from center line */
        padding-left: 60px; /* Increased spacing from center line */
    }
    
    .timeline-item:nth-child(even) .timeline-content {
        text-align: right;
        padding-right: 60px; /* Increased spacing from center line */
        padding-left: 0px; /* Increased spacing from center line */
    }
    /* Create timeline connecting line - progressive drawing animation */
    .timeline::before {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        left: 50%;
        width: 3px;
        background-color: var(--secondary-color, #E67E22);
        transform: translateX(-50%);
        transform-origin: top;
        animation: drawLine 1.5s ease-out forwards;
        animation-play-state: paused;
    }

    .timeline.animate::before {
        animation-play-state: running;
    }

    @keyframes drawLine {
        from {
            clip-path: inset(0 0 100% 0);
        }
        to {
            clip-path: inset(0 0 0% 0);
        }
    }
    
    /* Timeline dots/connectors at each item */
    .timeline-item::after {
        content: '';
        position: absolute;
        top: 50%; /* Center vertically */
        left: 50%;
        height: 20px;
        width: 20px;
        background-color: var(--secondary-color, #E67E22);
        border-radius: 50%;
        transform: translate(-50%, -50%); /* Center both horizontally and vertically */
        z-index: 1;
        box-shadow: 0 0 0 4px rgba(230, 126, 34, 0.2); /* Optional: adds a subtle glow */
    }
}

.timeline-image {
    flex: 1;
    padding-right: 30px;
}

.timeline-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.timeline-content {
    flex: 1;
}

.timeline-content h3 {
    margin-top: 0;
    color: var(--primary-color, #E67E22);
    font-size: 1.5rem;
}

.timeline-content p {
    margin-bottom: 0;
    line-height: 1.6;
}

/* Improve mobile view spacing */
@media (max-width: 767px) {
    .timeline-item {
        padding-left: 30px;
    }

    .timeline-item .timeline-image {
        padding-bottom: 10px;
    }
    
    .timeline::before {
        left: 0;
        transform: none;
    }
    
    .timeline-item::after {
        left: 0;
        transform: translateX(-50%);
    }
}

/* Placeholder wenn noch kein echtes Foto vorhanden ist */
.timeline-img-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    background-color: var(--primary-color, #2C3E50);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: rgba(255, 255, 255, 0.6);
}

.timeline-img-placeholder i {
    font-size: 4rem;
    color: var(--secondary-color, #E67E22);
}

.timeline-img-placeholder span {
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 600;
}
