/* Besalp Timeline Widget Styles */
.besalp-timeline-widget {
    position: relative;
    --counter-size: 100px;
    /* Default fallback value - will be overridden by Elementor */
}

.step-wrapper {
    position: relative;
    padding-bottom: 30px;
    min-height: 100px;
}

.step-wrapper:last-child {
    padding-bottom: 0;
}

/* Timeline line - always centered in the container */
.besalp-timeline-widget .step-wrapper:before {
    content: "";
    position: absolute;
    top: var(--counter-size);
    height: calc(100% - var(--counter-size));
    transform: translateX(-50%);
}
.besalp-timeline-widget .step-wrapper.step-wrapper-last:before {
    display: none;
}

.besalp-timeline-widget.normal-layout .step-wrapper:before {
    left: calc(var(--counter-size) / 2);
}

.besalp-timeline-widget.alternating-layout .step-wrapper:before {
    left: 50%;
}

.besalp-timeline-widget .step-counter {
    height: var(--counter-size);
    width: var(--counter-size);
    background: #F2F2F2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 24px;
    color: #333333;
    position: absolute;
    z-index: 2;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
}

.step-content {
    padding-top: 10px;
    /* Width and margins will be controlled by Elementor controls */
}

.step-title {
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
}

.step-description {
    margin: 0;
    line-height: 1.6;
    color: #666666;
}

/* Alternating Layout Styles */
.besalp-timeline-widget.alternating-layout .step-wrapper.step-left .step-content {
    text-align: right;
}

.besalp-timeline-widget.alternating-layout .step-wrapper.step-right .step-content {
    text-align: left;
}

/* Animation Styles */
.timeline-animated .timeline-animate {
    opacity: 0;
    transition: all 0.6s ease-out;
}

.timeline-animated .timeline-animate.animate-from-right {
    transform: translateX(50px);
}

.timeline-animated .timeline-animate.animate-from-left {
    transform: translateX(-50px);
}

.timeline-animated .timeline-animate.in-view {
    opacity: 1;
    transform: translateX(0);
}

/* Mobile Responsive */
@media screen and (max-width: 767px) {
    .step-counter {
        font-size: 18px;
    }

    .step-title {
        font-size: 18px;
    }

    /* Reset all alternating layout styles on mobile for better readability */
    .besalp-timeline-widget.alternating-layout .step-wrapper.step-left .step-content,
    .besalp-timeline-widget.alternating-layout .step-wrapper.step-right .step-content {
        text-align: left !important;
        margin-left: calc(var(--counter-size) + 20px) !important;
        margin-right: 0 !important;
        width: calc(100% - var(--counter-size) - 20px) !important;
    }
    
    /* Reset timeline line positioning to normal layout on mobile */
    .besalp-timeline-widget.alternating-layout .step-wrapper:before {
        left: calc(var(--counter-size) / 2) !important;
    }
    
    /* Reset step counter positioning on mobile */
    .besalp-timeline-widget.alternating-layout .step-counter {
        left: 0 !important;
        transform: none !important;
    }
    
    /* Reset animations to be consistent on mobile - all animate from right */
    .besalp-timeline-widget.alternating-layout .timeline-animate.animate-from-left {
        transform: translateX(50px) !important;
    }
    
    .besalp-timeline-widget.alternating-layout .timeline-animate.animate-from-left.in-view {
        transform: translateX(0) !important;
    }
}

@media screen and (max-width: 480px) {
    .step-counter {
        font-size: 16px;
    }

    .step-title {
        font-size: 16px;
    }
}