/* TIMELINE SPEZIFISCHE STYLES */
.timeline {
    max-width: 900px;
    margin: 4rem auto 0;
    position: relative;
    /* Höhe für Desktop-Ansicht erhöhen */
    height: 800px;
    /* Begrenzen des Überlaufs der Timeline */
    z-index: 1;
}

/* Der Hauptpfad */
.timeline-path {
    position: absolute;
    width: 4px;
    background-color: var(--accent-mint);
    height: 120%; /* Verlängert für bessere Sichtbarkeit */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

/* Die horizontalen Linien */
.timeline-hline {
    position: absolute;
    height: 4px;
    background-color: var(--accent-mint);
    /* Mittig zur Box positionieren */
    top: 50%;
    z-index: 1;
}

/* Linien zum korrekten Richtung ausrichten */
#timeline-first .timeline-hline,
#timeline-third .timeline-hline {
    right: 50%;
    width: 120px;
}

#timeline-second .timeline-hline,
#timeline-fourth .timeline-hline {
    left: 50%;
    width: 120px;
}

/* Die Zeitpunkte als Container */
.timeline-item {
    position: absolute;
    width: 100%;
    height: 150px;
    z-index: 2;
}

/* Positionierung für die spezifischen Zeitpunkte */
#timeline-first {
    top: 0;
}

#timeline-second {
    top: 200px;
}

#timeline-third {
    top: 400px;
}

#timeline-fourth {
    top: 600px;
}

/* Die Inhaltsboxen mit Farbgebung */
.timeline-content {
    width: 40%;
    padding: 1.5rem;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-default);
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.3s ease;
    z-index: 2;
    opacity: 1;
}

/* Solide Farben für die Boxen (keine Transparenz) */
#timeline-first .timeline-content {
    background-color: #EBEBEB;
}

#timeline-second .timeline-content {
    background-color: #EBF5F2;
}

#timeline-third .timeline-content {
    background-color: #FBF6E8;
}

#timeline-fourth .timeline-content {
    background-color: #E8E6F8;
}

/* Boxen auf der richtigen Seite platzieren */
#timeline-second .timeline-content,
#timeline-fourth .timeline-content {
    right: 5%;
}

#timeline-first .timeline-content,
#timeline-third .timeline-content {
    left: 5%;
}

.timeline-content:hover {
    transform: translateY(-50%) translateY(-5px);
    box-shadow: var(--shadow-hover);
}

/* Der Beschreibungstext mit dunkler Farbgebung */
.timeline-detail {
    width: 40%;
    padding: 1rem;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    font-size: 0.9rem;
    line-height: 1.6;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    max-height: none;
    min-height: 100px;
    font-weight: 500;
}

/* Dunklere Textfarben für die Detail-Texte */
#timeline-first .timeline-detail {
    color: rgba(200, 60, 40, 1);
}

#timeline-second .timeline-detail {
    color: rgba(50, 110, 90, 1);
}

#timeline-third .timeline-detail {
    color: rgba(150, 100, 30, 1);
}

#timeline-fourth .timeline-detail {
    color: rgba(80, 70, 160, 1);
}

/* Details auf der richtigen Seite platzieren */
#timeline-second .timeline-detail,
#timeline-fourth .timeline-detail {
    left: 5%;
    text-align: right;
}

#timeline-first .timeline-detail,
#timeline-third .timeline-detail {
    right: 5%;
    text-align: left;
}

.timeline-item:hover .timeline-detail {
    opacity: 1;
    visibility: visible;
}

/* Mobile Ansicht */
@media (max-width: 768px) {
    .timeline {
        height: auto;
        padding-left: 0;
        min-height: 900px;
        position: relative;
        margin-bottom: 200px;
        display: flex;
        flex-direction: column;
    }
    
    /* Keine vertikale Linie in der mobilen Ansicht */
    .timeline-path {
        display: none;
    }
    
    /* Keine horizontalen Linien in der mobilen Ansicht */
    .timeline-hline {
        display: none;
    }
    
    .timeline-item {
        position: relative;
        height: auto;
        margin-bottom: 30px;
        padding-bottom: 0;
        top: 0 !important;
        margin-left: 0;
    }
    
    /* Chronologische Reihenfolge in der mobilen Ansicht */
    .timeline-item:nth-child(1) {
        order: 1; /* Q3 2025 */
    }
    .timeline-item:nth-child(2) {
        order: 2; /* Q4 2025 */
    }
    .timeline-item:nth-child(3) {
        order: 3; /* Q1 2026 */
    }
    .timeline-item:nth-child(4) {
        order: 4; /* Q2 2026 */
    }
    
    .timeline-content {
        width: 100%;
        position: relative;
        top: 0;
        transform: none;
        margin-left: 0;
        left: 0 !important;
        right: 0 !important;
    }
    
    .timeline-content:hover {
        transform: translateY(-5px);
    }
    
    .timeline-detail {
        width: 100%;
        position: relative;
        margin-top: 10px;
        margin-left: 0;
        top: 0;
        transform: none;
        left: 0 !important;
        right: 0 !important;
        text-align: left !important;
    }
    
    .timeline-item:hover .timeline-detail {
        transform: none;
    }
}