/* Budi Flowchart Widget Styles */
.budi-flowchart__wrapper {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 0;
}

/* Main Layout Container */
.budi-flowchart__layout {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 45px;
    align-items: start;
    position: relative;
}

/* Flowchart Items Section - Left and Right */
.budi-flowchart__items {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.budi-flowchart__items--left {
    justify-self: end;
}

.budi-flowchart__items--right {
    justify-self: start;
}

.budi-flowchart__item {
    background: #F7F7F7;
    border-radius: 20px;
    padding: 20px 20px 24px 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    /* Initial state for fade-in animation */
    opacity: 0;
    transform: translateY(30px);
}

/* .budi-flowchart__item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
} */

.budi-flowchart__item-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 55px;
    height: 55px;
    background: var(--color-main, #0B3753);
    border-radius: 10px;
    margin-bottom: 25px;
    transition: all 0.3s ease;
}

.budi-flowchart__item-icon {
    max-width: 28px;
    max-height: 28px;
    width: auto;
    height: auto;
}

.budi-flowchart__item-title {
    font-size: var(--font-text-size);
    font-weight: 500;
    color: var(--color-main, #0B3753);
    margin-bottom: 10px;
}

.budi-flowchart__item-description {
    color: var(--color-main, #0B3753);
    line-height: 1.6;
    font-size: 14px;
}

/* Flowchart Steps Section - Center */
.budi-flowchart__steps-wrapper {
    padding-top: 40px;
    position: relative;
    height: 100%;
}

.budi-flowchart__steps {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 40px;
    width: 100%;
    min-width: 290px;
    margin-inline: auto;
}

.budi-flowchart__steps-line {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.8s ease-out;
}

.budi-flowchart__steps-line line {
    stroke-dasharray: 0 1000;
    stroke-dashoffset: 1000;
}

.budi-flowchart__steps-line.is-visible {
    opacity: 1;
}

.budi-flowchart__steps-line.is-visible line {
    animation: drawLine 1.2s ease-out forwards;
}

.budi-flowchart__steps-line.is-visible line:nth-child(1) {
    animation-delay: 0.1s;
}

.budi-flowchart__steps-line.is-visible line:nth-child(2) {
    animation-delay: 0.2s;
}

.budi-flowchart__steps-line.is-visible line:nth-child(3) {
    animation-delay: 0.3s;
}

.budi-flowchart__steps-line.is-visible line:nth-child(4) {
    animation-delay: 0.4s;
}

.budi-flowchart__steps-line.is-visible line:nth-child(5) {
    animation-delay: 0.5s;
}

.budi-flowchart__steps-line.is-visible line:nth-child(6) {
    animation-delay: 0.6s;
}

.budi-flowchart__steps-line.is-visible line:nth-child(7) {
    animation-delay: 0.7s;
}

.budi-flowchart__steps-line.is-visible line:nth-child(8) {
    animation-delay: 0.8s;
}

.budi-flowchart__steps-line.is-visible line:nth-child(9) {
    animation-delay: 0.9s;
}

.budi-flowchart__steps-line.is-visible line:nth-child(10) {
    animation-delay: 1.0s;
}

.budi-flowchart__steps-line.is-visible line:nth-child(11) {
    animation-delay: 1.1s;
}

.budi-flowchart__steps-line.is-visible line:nth-child(12) {
    animation-delay: 1.2s;
}

.budi-flowchart__steps-line.is-visible line:nth-child(13) {
    animation-delay: 1.3s;
}

.budi-flowchart__steps-line.is-visible line:nth-child(14) {
    animation-delay: 1.4s;
}

.budi-flowchart__steps-line.is-visible line:nth-child(15) {
    animation-delay: 1.5s;
}

.budi-flowchart__steps-line.is-visible line:nth-child(16) {
    animation-delay: 1.6s;
}

.budi-flowchart__steps-line.is-visible line:nth-child(17) {
    animation-delay: 1.7s;
}

.budi-flowchart__steps-line.is-visible line:nth-child(18) {
    animation-delay: 1.8s;
}

.budi-flowchart__steps-line.is-visible line:nth-child(19) {
    animation-delay: 1.9s;
}

.budi-flowchart__steps-line.is-visible line:nth-child(20) {
    animation-delay: 2.0s;
}

.budi-flowchart__steps-line.is-visible line:nth-child(21) {
    animation-delay: 2.1s;
}

.budi-flowchart__steps-line.is-visible line:nth-child(22) {
    animation-delay: 2.2s;
}

.budi-flowchart__steps-line.is-visible line:nth-child(23) {
    animation-delay: 2.3s;
}

.budi-flowchart__steps-line.is-visible line:nth-child(24) {
    animation-delay: 2.4s;
}

.budi-flowchart__steps-line.is-visible line:nth-child(25) {
    animation-delay: 2.5s;
}

.budi-flowchart__steps-line.is-visible line:nth-child(26) {
    animation-delay: 2.6s;
}

.budi-flowchart__steps-line.is-visible line:nth-child(27) {
    animation-delay: 2.7s;
}

.budi-flowchart__steps-line.is-visible line:nth-child(28) {
    animation-delay: 2.8s;
}

.budi-flowchart__steps-line.is-visible line:nth-child(29) {
    animation-delay: 2.9s;
}

.budi-flowchart__steps-line.is-visible line:nth-child(30) {
    animation-delay: 3.0s;
}

@keyframes drawLine {
    from {
        stroke-dasharray: 0 1000;
        stroke-dashoffset: 1000;
    }

    to {
        stroke-dasharray: 1 1;
        stroke-dashoffset: 0;
    }
}

.budi-flowchart__step {
    width: fit-content;
    text-align: center;
    position: relative;
    z-index: 2;
    /* Initial state for fade-in animation */
    opacity: 0;
    transform: scale(0.8);
}

.budi-flowchart__step[data-step="1"] {
    margin-left: auto;
    margin-right: 0;
    right: 30px;
}

.budi-flowchart__step[data-step="3"],
.budi-flowchart__step[data-step="5"] {
    margin-right: 0;
    margin-left: auto;
    right: 40px;
}

.budi-flowchart__step[data-step="4"] {
    margin-left: 10px;
}


.budi-flowchart__step-icon-wrapper {
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    margin-bottom: 0.5rem;
    background-color: var(--color-main, #0B3753);
    border-radius: 100%;
    box-sizing: content-box;
    position: relative;
}

.budi-flowchart__step-icon-wrapper::before {
    content: '';
    position: absolute;
    width: calc(100% + 12px);
    height: calc(100% + 12px);
    border-radius: 100%;
    background-color: #0B37531A;
    top: -6px;
    left: -6px;
    z-index: -1;
}

.budi-flowchart__step-icon {
    max-width: 30px;
    max-height: 30px;
    width: auto;
    height: auto;
    transition: all 0.3s ease;
}

.budi-flowchart__step-title {
    width: fit-content;
    margin: 0 auto;
    padding: 6px 7px;
    background-color: #fff;
    border-radius: 5px;
    font-size: 12px;
    color: var(--color-main, #0B3753);
    box-shadow: 0px 4px 15px 0px #0000001A;
    font-weight: 400;
    position: relative;
    top: -10px;
}

/* Animation Classes - Controlled by JavaScript */
.budi-flowchart__item.is-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.budi-flowchart__step.is-visible {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Stagger animation delays for items */
.budi-flowchart__item:nth-child(1).is-visible {
    transition-delay: 0.1s;
}

.budi-flowchart__item:nth-child(2).is-visible {
    transition-delay: 0.2s;
}

.budi-flowchart__item:nth-child(3).is-visible {
    transition-delay: 0.3s;
}

.budi-flowchart__item:nth-child(4).is-visible {
    transition-delay: 0.4s;
}

/* Stagger animation delays for steps */
.budi-flowchart__step:nth-child(1).is-visible {
    transition-delay: 0.1s;
}

.budi-flowchart__step:nth-child(2).is-visible {
    transition-delay: 0.2s;
}

.budi-flowchart__step:nth-child(3).is-visible {
    transition-delay: 0.3s;
}

.budi-flowchart__step:nth-child(4).is-visible {
    transition-delay: 0.4s;
}

.budi-flowchart__step:nth-child(5).is-visible {
    transition-delay: 0.5s;
}

/* Responsive Design */
@media (max-width: 899px) {
    .budi-flowchart__steps{
        width: 100%;
        max-width: 290px;
    }
    /* Hide desktop items layout */
    .budi-flowchart__items--left,
    .budi-flowchart__items--right {
        display: none;
    }
    
    /* Show mobile items */
    .budi-flowchart__mobile-items {
        display: block;
        margin-top: 30px;
    }
    
    /* Adjust main layout for mobile */
    .budi-flowchart__layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (min-width: 900px) {
    /* Hide mobile items on desktop */
    .budi-flowchart__mobile-items {
        display: none;
    }
}

/* Mobile Items Swiper Styles */

.budi-flowchart__mobile-swiper {
    padding-bottom: 55px !important;
}

.budi-flowchart__mobile-swiper .swiper-slide {
    height: auto;
    padding: 0 0.5rem;
}

.budi-flowchart__mobile-swiper .budi-flowchart__item {
    height: 100%;
    margin: 0 auto;
}

.budi-flowchart__mobile-swiper .budi-flowchart__item-icon-wrapper {
    margin-bottom: 25px;
}

.budi-flowchart__mobile-pagination {
    position: relative;
    margin-top: 1.5rem;
    top: auto !important;
    bottom: 0 !important;
}

.budi-flowchart__mobile-pagination .swiper-pagination-bullet {
    background: var(--color-sub);
    margin-inline: 5px !important;
    opacity: 0.3;
    transition: all 0.3s ease;
    width: 10px;
    height: 10px;
    border-radius: 10px;
}

.budi-flowchart__mobile-pagination .swiper-pagination-bullet-active {
    width: 22px;
    opacity: 1;
}