/* ======================================================= */
/* 0. FILTER BUTTONS STYLING */
/* ======================================================= */
.nk-timeline-filter-buttons {
    text-align: center;
    margin-bottom: 30px;
}
.nk-filter-btn {
    background: #f0f0f0;
    border: 1px solid #ddd;
    color: #333;
    padding: 8px 15px;
    margin: 5px;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 5px;
}
.nk-filter-btn.active, 
.nk-filter-btn:hover {
    background: #789F55; /* Default Grün */
    color: #fff;
    border-color: #789F55;
}

/* ======================================================= */
/* 1. GENERAL LAYOUT & WRAPPER */
/* ======================================================= */
.nk-timeline-wrapper {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
    /* WICHTIG: Verhindert, dass Marker am Rand abgeschnitten werden */
    overflow: visible !important; 
}

/* LINIE (Hintergrund/Basis) */
.nk-timeline-wrapper::after {
    content: '';
    position: absolute;
    width: 0; 
    border-left-style: solid;
    border-left-width: 4px;
    border-left-color: #e0e0e0;
    top: 0;
    bottom: 0;
    left: 50%; 
    margin-left: -2px; 
    z-index: 0;
}

/* SCROLL PROGRESS BAR (Der farbige Overlay-Balken) */
.nk-timeline-progress-bar {
    position: absolute;
    top: 0;
    left: 50%; /* Default Mitte */
    width: 4px; /* Muss zur Linienbreite passen */
    background-color: #789F55; /* Default Grün */
    height: 0%; /* Wird via JS gesetzt */
    z-index: 1; /* Über der grauen Linie, unter Markern */
    margin-left: -2px; /* Zentrieren */
    transition: height 0.1s linear; /* Smoothness */
}

/* PROGRESS TIP (Der Punkt am Ende der wachsenden Linie) */
.nk-timeline-progress-bar.nk-progress-tip-yes::after {
    content: '';
    position: absolute;
    bottom: 0; 
    left: 50%;
    transform: translate(-50%, 50%); /* Zentriert auf Spitze */
    width: 12px; 
    height: 12px; /* Default Size, wird via PHP überschrieben */
    background-color: #fff;
    border: 2px solid #789F55;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0,0,0,0.15);
    z-index: 2;
}

/* Linien-Styles */
.nk-line-style-dashed .nk-timeline-wrapper::after { border-left-style: dashed; }
.nk-line-style-dotted .nk-timeline-wrapper::after { border-left-style: dotted; }
.nk-line-style-none .nk-timeline-wrapper::after { display: none; }

/* Sticky Line Feature */
.nk-timeline-sticky-yes .nk-timeline-date-side.is-sticky {
    position: sticky;
    top: 50px; 
    z-index: 10;
}

/* Timeline Item (Basis Animation Container) */
.nk-timeline-item {
    position: relative;
    opacity: 0;
    transition-property: opacity, transform;
    transition-timing-function: ease-out;
    z-index: 2; /* Über der Progress Bar */
}
.nk-timeline-item.visible {
    opacity: 1;
    transform: translateX(0); 
}

/* ======================================================= */
/* 2. MARKER SYSTEM (WRAPPER) */
/* ======================================================= */
/* Der Container für das Icon. Dient nur noch der Positionierung. */
.nk-timeline-marker-wrapper {
    position: absolute;
    width: 30px; 
    height: 30px;
    z-index: 5; /* Ganz oben */
    top: 15px; 
    display: flex;
    align-items: center;
    justify-content: center;
    /* Position wird unten pro Layout gesetzt */
}

/* KILL SWITCH: Marker ausblenden */
.nk-timeline-markers-no .nk-timeline-marker-wrapper { 
    display: none !important; 
}

/* HINTERGRUND KREIS ENTFERNT */
/* Die CSS-Regel ::before für den Kreis wurde hier komplett gelöscht. */

/* Icon Styling */
.nk-timeline-icon-wrap {
    width: 100%; 
    height: 100%;
    display: flex; 
    align-items: center; 
    justify-content: center;
}
.nk-timeline-icon-wrap i, 
.nk-timeline-icon-wrap svg { 
    font-size: 14px; 
    width: auto; 
    height: auto; 
    line-height: 1; 
}

/* Icons ausblenden */
.nk-timeline-icon-show-no .nk-timeline-icon-wrap {
    display: none !important;
}

/* Marker Ausrichtung (Center/Top) */
.nk-marker-align-center .nk-timeline-marker-wrapper {
    top: 50%;
    transform: translateY(-50%);
}


/* ======================================================= */
/* 3. LAYOUT: VERTICAL (ZIGZAG / MITTIG) */
/* ======================================================= */
.nk-timeline-layout-vertical .nk-timeline-item {
    width: 50%;
    padding: 10px 40px;
}

/* Linke Seite (Gerade) */
.nk-timeline-layout-vertical .nk-timeline-item:nth-child(even) {
    left: 0;
    transform: translateX(-50px);
    text-align: right; 
}
.nk-timeline-layout-vertical .nk-timeline-item:nth-child(even) .nk-timeline-content-side {
    align-items: flex-end;
}

/* Rechte Seite (Ungerade) */
.nk-timeline-layout-vertical .nk-timeline-item:nth-child(odd) {
    left: 50%;
    transform: translateX(50px);
    text-align: left;
}

/* Marker Positionierung ZigZag */
.nk-timeline-layout-vertical .nk-timeline-item:nth-child(odd) .nk-timeline-marker-wrapper {
    left: 0; 
    margin-left: -15px; /* Zentriert auf Linie */
}
.nk-timeline-layout-vertical .nk-timeline-item:nth-child(even) .nk-timeline-marker-wrapper {
    right: 0; 
    left: auto;
    margin-right: -15px; /* Zentriert auf Linie */
}


/* ======================================================= */
/* 4. LAYOUT: VERTICAL LEFT (LINKSBÜNDIG) */
/* ======================================================= */

/* Linie nach rechts schieben (50px) */
.nk-timeline-layout-vertical_left .nk-timeline-wrapper::after,
.nk-timeline-layout-vertical_left .nk-timeline-progress-bar {
    left: 50px; 
    margin-left: -2px; 
}

/* Inhalt einrücken */
.nk-timeline-layout-vertical_left .nk-timeline-item {
    width: 100%;
    padding-left: 100px; /* Genug Platz für Marker + Abstand */
    padding-right: 0;
    transform: translateY(20px);
    text-align: left;
}
.nk-timeline-layout-vertical_left .nk-timeline-item.visible {
    transform: translateY(0);
}

/* Marker fixieren */
.nk-timeline-layout-vertical_left .nk-timeline-marker-wrapper {
    left: 50px; 
    margin-left: -15px; 
    right: auto; 
}


/* ======================================================= */
/* 5. LAYOUT: SINGLE SIDED (ALLES RECHTS) */
/* ======================================================= */

/* Linie Links (Enger am Rand als Vertical Left: 20px) */
.nk-timeline-layout-single_sided .nk-timeline-wrapper::after,
.nk-timeline-layout-single_sided .nk-timeline-progress-bar {
    left: 20px; 
    margin-left: -2px; 
}

/* Inhalt komplett rechts */
.nk-timeline-layout-single_sided .nk-timeline-item {
    width: 100%;
    padding-left: 60px; /* Platz ab Linie */
    padding-right: 0;
    transform: translateY(20px);
    text-align: left;
}
.nk-timeline-layout-single_sided .nk-timeline-item.visible {
    transform: translateY(0);
}

/* Marker auf der Linie */
.nk-timeline-layout-single_sided .nk-timeline-marker-wrapper {
    left: 20px; 
    margin-left: -15px; 
    right: auto; 
}

/* Spezielle Inhalts-Struktur für Single Sided */
.nk-timeline-single-sided-content .nk-timeline-date {
    display: block;
    font-weight: bold;
    color: #789F55;
    margin-bottom: 5px;
}
.nk-timeline-single-sided-content h3 {
    margin: 0 0 10px;
}


/* ======================================================= */
/* 6. KARTEN DESIGN & PFEILE */
/* ======================================================= */
.nk-timeline-arrow {
    display: none;
    position: absolute;
    top: 20px;
    width: 0; 
    height: 0; 
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
}
.nk-timeline-arrow-yes .nk-timeline-arrow { display: block; }

/* Pfeil Ausrichtung anpassen wenn Marker mittig */
.nk-marker-align-center .nk-timeline-arrow {
    top: 50%;
    transform: translateY(-50%);
}

/* Pfeil-Richtungen */
.nk-timeline-layout-vertical_left .nk-timeline-arrow,
.nk-timeline-layout-single_sided .nk-timeline-arrow {
    left: -10px;
    border-right: 10px solid #fff;
}
.nk-timeline-layout-vertical .nk-timeline-item:nth-child(odd) .nk-timeline-arrow {
    left: -10px;
    border-right: 10px solid #fff;
}
.nk-timeline-layout-vertical .nk-timeline-item:nth-child(even) .nk-timeline-arrow {
    right: -10px;
    border-left: 10px solid #fff;
}


/* ======================================================= */
/* 7. BILDER */
/* ======================================================= */
.nk-timeline-image-wrap {
    margin-bottom: 15px;
    overflow: hidden;
    border-radius: 5px;
}
.nk-timeline-image-wrap img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s;
}
.nk-timeline-image-wrap a:hover img {
    transform: scale(1.03);
}


/* ======================================================= */
/* 8. HORIZONTAL LAYOUT */
/* ======================================================= */
.nk-timeline-layout-horizontal .nk-timeline-wrapper {
    display: flex;
    overflow-x: auto;
    padding-bottom: 50px;
}
.nk-timeline-layout-horizontal .nk-timeline-wrapper::after { display: none; }

.nk-timeline-layout-horizontal .nk-timeline-line {
    position: absolute;
    top: 50%;
    width: 100%;
    height: 4px;
    border-top-style: solid;
    border-top-width: 4px;
    border-top-color: #e0e0e0;
}
.nk-line-style-dashed.nk-timeline-layout-horizontal .nk-timeline-line { border-top-style: dashed; }
.nk-line-style-dotted.nk-timeline-layout-horizontal .nk-timeline-line { border-top-style: dotted; }

.nk-timeline-layout-horizontal .nk-timeline-item {
    min-width: 300px;
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateY(50px);
}
.nk-timeline-layout-horizontal .nk-timeline-item.visible { transform: translateY(0); }

.nk-timeline-layout-horizontal .nk-timeline-marker-wrapper {
    top: 50%;
    left: 50%;
    margin-left: -15px; 
    margin-top: -15px; 
}
.nk-timeline-layout-horizontal .nk-timeline-arrow { display: none !important; }


/* ======================================================= */
/* 9. RESPONSIVE (MOBILE) */
/* ======================================================= */
@media screen and (max-width: 768px) {
    /* Linie auf Mobile: Gleiche Position wie Vertikal Left */
    .nk-timeline-layout-vertical .nk-timeline-wrapper::after,
    .nk-timeline-layout-vertical .nk-timeline-progress-bar {
        left: 50px; 
        margin-left: -2px;
    }
    .nk-timeline-layout-vertical .nk-timeline-item {
        width: 100%;
        padding-left: 100px; 
        padding-right: 0;
        text-align: left;
        left: 0 !important;
        transform: translateX(0) translateY(20px);
    }
    
    /* Marker Reset */
    .nk-timeline-layout-vertical .nk-timeline-marker-wrapper {
        left: 50px; 
        margin-left: -15px; 
        right: auto; 
        margin-right: 0;
    }
    
    .nk-timeline-layout-vertical .nk-timeline-item .nk-timeline-content-side {
        align-items: flex-start;
    }
    
    /* Pfeile korrigieren */
    .nk-timeline-layout-vertical .nk-timeline-item:nth-child(even) .nk-timeline-arrow {
        right: auto; 
        left: -10px;
        border-left: none; 
        border-right: 10px solid #fff; 
    }
    
    /* Sticky aus auf Mobile */
    .nk-timeline-sticky-yes .nk-timeline-date-side.is-sticky {
        position: relative; 
        top: 0;
    }
    
    /* Single Sided Mobile Anpassung */
    .nk-timeline-layout-single_sided .nk-timeline-wrapper::after,
    .nk-timeline-layout-single_sided .nk-timeline-progress-bar {
        left: 20px;
    }
    .nk-timeline-layout-single_sided .nk-timeline-item {
        padding-left: 50px;
    }
    .nk-timeline-layout-single_sided .nk-timeline-marker-wrapper {
        left: 20px;
    }
}

/* ======================================================= */
/* 10. PERFORMANCE BOOSTER & ANIMATION */
/* ======================================================= */
.nk-timeline-item {
    content-visibility: auto; 
    contain-intrinsic-size: 0 300px; 
}

@keyframes nk-line-flow {
    0% { background-position: 0% 0%; }
    100% { background-position: 0% 100%; }
}
@keyframes nk-line-flow-horiz {
    0% { background-position: 0% 0%; }
    100% { background-position: 100% 0%; }
}

/* Klassen für Flow (gesteuert durch PHP) */
.nk-line-flow-yes .nk-timeline-wrapper::after {
    background-size: 100% 40px; 
    animation: nk-line-flow 1s linear infinite; 
    border: none; 
    width: 4px; 
}
.nk-line-flow-yes.nk-timeline-layout-horizontal .nk-timeline-line {
    background-size: 40px 100%;
    animation: nk-line-flow-horiz 1s linear infinite;
    border: none; 
    height: 4px;
}