/* Other existing styles */
.interactive-tape-measure-container {
    width: 80%;
    margin: 0 auto;
    position: relative;
    text-align: center;
}

.slider-wrapper {
    margin: 20px 0;
    position: relative;
}

#lifespan-slider {
    width: 100%;
    position: relative;
    z-index: 1;
    background: #fff;
    height: 50px;
    border-radius: 0px;
}

#lifespan-ruler {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50px;
    z-index: 2;
    pointer-events: none;
}

#lifespan-ruler::before {
    content: "";
    display: block;
    height: 100%;
    width: 30px;
    position: absolute;
    top: 0;
    left: -30px;
    background: #fff;
}

#lifespan-ruler::after {
    content: "";
    display: block;
    height: 100%;
    width: 30px;
    position: absolute;
    top: 0;
    right: -30px;
    background: #fff;
    z-index: -1;
}

.ui-widget.ui-widget-content {
    border-color: #fff !important;
}

.marker {
    position: absolute;
    bottom: 0;
    width: 1px;
    background: black;
}

.marker.short {
    height: 8px;
}

.marker.long {
    height: 15px;
}

.ruler-label {
    position: absolute;
    top: 15px;
    transform: translateX(-50%);
    font-size: 14px;
    color: #333;
}

.ui-slider-horizontal .ui-slider-handle {
    top: -10px;
    background: #333; /* Hintergrundfarbe für den Griff */
    width: 10px;
    height: 50px;
    border-radius: 4px;
    z-index: 3;
    position: relative; /* Für Tooltip-Positionierung */
    margin: 0 !important;
    border-color: #333;
}

.tooltip {
    position: absolute;
    top: -50px; /* Platzieren Sie es unter dem Griff */
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 16px;
    white-space: nowrap;
    text-align: center;
}

#lifespan-slider .ui-slider-handle:last-child {
	top: 40px;
    margin-left: -1px !important;
}

.retirement-tooltip {
	top: 15px;
}

.tooltip span {
    display: block;
    font-size: 14px;
    color: #ccc;
}

.average-life-marker {
    position: absolute;
    top: -20px;
    width: 2px;
    height: 70px;
    background: #333;
    z-index: 4;
}

#average-life {
    left: 80%;
}

.marker-label {
    position: absolute;
    top: -40px;
    text-align: left;
    font-size: 14px;
    line-height: 1rem;
}

.highlight {
    position: absolute;
    top: 0;
    height: 50px;
    z-index: 1;
    pointer-events: none;
}

#highlight-birth-to-current {
    background: #F0EDF5; /* Graue Markierung */
}

#highlight-current-to-retirement {
    background: #C2B7D5; /* Grüne Markierung */
}

#highlight-retirement-to-average {
    background: #edbe88; /* Blaue Markierung */
}

#lifespan-summary,
#lifespan-summary-vertical {
    margin-top: 120px;
    font-size: 1rem;
    display: flex;
    justify-content: center;
    
}

#lifespan-summary-vertical {
    flex-direction: column;
}

#lifespan-summary div,
#lifespan-summary-vertical div {
    margin: 20px 50px;
}


#lifespan-summary span,
#lifespan-summary-vertical span {
    padding: 30px;
    border-radius: 8px;
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 50px;
    height: 50px;
    color: #333;
    font-size: 1.313rem;
    line-height: 1em;
    margin: 0 auto 10px auto;
    font-weight: bold;
}

#lifespan-summary #lived-years-value,
#highlight-birth-to-current-vertical,
#lived-years-value-vertical {
    background: #F0EDF5 !important;
}

#lifespan-summary #years-to-retirement-value,
#highlight-current-to-retirement-vertical,
#years-to-retirement-value-vertical {
    background: #C2B7D5 !important;
}

#lifespan-summary #years-in-retirement-value,
#highlight-retirement-to-average-vertical,
#years-in-retirement-value-vertical {
    background: #edbe88 !important;
}

#average-life {
    left: 80%;
}

/* Media Queries für mobile Ansichten */
@media (max-width: 768px) {
    .interactive-tape-measure-container {
        width: 100%;
    }

    .ruler-label {
        font-size: 10px;
    }

    .tooltip {
        font-size: 12px;
    }

    .tooltip span {
        font-size: 10px;
    }

    .average-life-marker {
        height: 50px;
    }

    #lifespan-summary {
        margin-top: 40px;
        font-size: 0.875rem;
        flex-direction: column;
    }

    #lifespan-summary div {
        margin: 10px 0;
    }

    #lifespan-summary span {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        padding: 20px;
    }
}



@media (max-width: 480px) {
    .interactive-tape-measure-container {
        width: 100%;
    }

    .ruler-label {
        font-size: 8px;
    }

    .tooltip {
        font-size: 10px;
    }

    .tooltip span {
        font-size: 8px;
    }

    .average-life-marker {
        height: 40px;
    }

    #lifespan-summary {
        margin-top: 20px;
        font-size: 0.75rem;
    }

    #lifespan-summary div {
        margin: 5px 0;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    #lifespan-summary span {
        width: 30px;
        height: 30px;
        font-size: 0.875rem;
        padding: 10px;
        margin: 0 20px;
    }
}



@media (max-width: 1024px) {
    .interactive-tape-measure-container.vertical {
        position: relative;
        width: 80%;
        height: auto;
        margin: 20px auto;
    }
    
    .slider-wrapper {
        position: relative;
        height: 600px;
        background: #fff !important;
        margin: 0 !important;
        width: 80px;
        margin: auto !important;
    }

    .wrapper::before {
        content:"";
        display: block;
        width: 100%;
        height: 20px;
        position: absolute;
        top: -20px;
        background: #fff;
    }

    .wrapper::after {
        content:"";
        display: block;
        width: 100%;
        height: 20px;
        position: absolute;
        bottom: -20px; 
        background: #fff;
    }
    
    #lifespan-ruler-vertical {
        position: absolute;
        left: 0px;
        bottom: 0;
        width: auto;
        height: 100%;
        z-index: 10;
    }
    
    .marker {
        position: absolute;
        left: 0;
        width: 20px;
        border-bottom: 1px solid #333;
        background: transparent !important;
    }
    
    .marker.long {
        width: 20px;
    }
    
    .marker.short {
        width: 15px;
    }
    
    .ruler-label {
        position: absolute;
        left: 45px;
        font-size: 12px;
        top: unset !important;
        margin-bottom: -8px !important;
    }
    
    #average-markers-vertical .highlight {
        position: absolute;
        width: 100%;
    }
    
    #lifespan-summary-vertical {
        margin-top: 20px;
        text-align: center;
        width: 60%;
    }
    
    #lifespan-summary-vertical div {
        margin-bottom: 5px;
    }
    }



    #average-markers-vertical {
        height: 100%;
        width: 100%;
        position: absolute;
    }

    #average-markers-vertical .highlight {
        top: unset !important;
    }

    #interactive-tape-measure-result {
        
        margin-top: 0px;
        margin-left: auto;
        margin-right: auto;
        display: flex;
    }



    #life-tape-form {
        margin-bottom: 30px;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-around;
    }

    #life-tape-form .form-row {
        display: flex;
        align-items: center;
        flex-direction: column;
        width: 100% ;
        margin-bottom: 30px;
    }


    #life-tape-form input {
        height: 70px;
        width: 100px;
        border-radius: 10px;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-top: 8px;
        text-align: center;
    }


    .step-label {
        margin-bottom: 0 !important;
        opacity: .7;
    }

    #life-tape-form .form-row label {
        font-weight: bold;
    }

    #restart {
        width: 100% !important;
        min-width: unset !important;
        margin-top: 50px;
        box-shadow: none;
        background: #6a5888 !important;
    }



    .error {
        border: 2px solid red !important;
    }
    .error-message {
        color: #fff !important;
        font-size: 0.875em;
        font-weight: bold;
        padding: 10px;
        border: 2px solid red !important;
        border-radius: 10px;
    }




    @media (max-width: 678px) {
        .interactive-tape-measure-container.vertical {
            width: 100% !important;
        }
    
    }