@use "../abstracts/variables" as vars;

/* ===========================
   Work Process 2 (Zigzag)
   =========================== */
.work-process2 {
    overflow: hidden;
    background: vars.$color-white;

    &__wrap {
        display: flex;
        flex-direction: column;
        gap: vars.rem(60);
        margin: 0 auto;
        position: relative;
    }

    &__item {
        position: relative;
        display: flex;
        align-items: center;
        width: 100%;
        max-width: vars.rem(770);
        margin-left: auto; // Default (Odd): Push to right

        @media (max-width: 991px) {
            max-width: 100%;
            margin-left: 0;
        }

        // Default Light State (1, 3, 4)
        .work-process2__number {
            background-color: #121117;
            color: vars.$color-white;
            left: -25px;

            @media (max-width: 991px) {
                left: 5px;
            }
        }

        // Default Card (Light)
        .work-process2__card {
            background-color: vars.$color-white;
            border-color: #0073E6;
            padding-left: vars.rem(50);
            padding-right: vars.rem(45);
        }

        // Connecting Zigzag Line (Desktop only)
        &:not(:last-child)::after {
            content: "";
            position: absolute;
            top: vars.rem(160);
            left: vars.rem(37);
            width: vars.rem(148); // Adjusted for new width
            height: 2px;
            background-color: #0073E6;
            z-index: 1;
            transform-origin: left center;
            transform: rotate(26deg);
            pointer-events: none;

            @media (max-width: 1199px) {
                display: none;
            }

        }

        // Reverse Strategy (Even Items)
        &--reverse {
            margin-left: 0;
            margin-right: auto; // Push to left

            // Connecting Zigzag Line (Desktop only)

            &:after {
                display: none;
            }

            &:not(:last-child)::before {
                content: "";
                position: absolute;
                top: vars.rem(225);
                right: vars.rem(37);
                width: vars.rem(148); // Adjusted for new width
                height: 2px;
                background-color: #0073E6;
                z-index: 1;
                transform-origin: left center;
                transform: rotate(-26deg);
                pointer-events: none;

                @media (max-width: 1199px) {
                    display: none;
                }

            }

            .work-process2__card {
                background-color: #121117;
                border-color: #121117;
                flex-direction: row-reverse;
                padding-right: vars.rem(50);
                padding-left: vars.rem(40);

                .work-process2__title,
                .work-process2__desc {
                    color: vars.$color-white;
                }



                .work-process2__separator {
                    background-color: #D9D9D980;
                }
            }

            .work-process2__number {
                left: auto;
                right: 0;
                background-color: #0073E6;

                @media (max-width: 991px) {
                    right: 5px;
                }
            }

            &::after {
                left: auto;
                right: vars.rem(37);
                transform-origin: right center;
                transform: rotate(-26deg);

                @media (max-width: 1199px) {
                    transform: rotate(-30deg);
                }
            }
        }


        // Hover Effect (Make any card look like card 2)
        &:hover {
            .work-process2__card {
                background-color: #121117 !important;
                border-color: #121117 !important;
                box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
                transform: translateY(-5px);

                .work-process2__title,
                .work-process2__desc {
                    color: vars.$color-white !important;
                }


                .work-process2__separator {
                    background-color: rgba(255, 255, 255, 0.1) !important;
                }
            }

            .work-process2__number {
                background-color: #0073E6 !important;
                color: vars.$color-white !important;
            }
        }
    }

    &__number {
        position: absolute;
        z-index: 5;
        width: vars.rem(50);
        height: vars.rem(70);
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: vars.rem(100);
        font-family: vars.$font-family-base;
        font-weight: 700;
        font-size: vars.rem(18);
        line-height: 100%;
        letter-spacing: 0%;
        text-align: center;
        text-transform: uppercase;
        transition: all 0.3s ease;
    }

    &__card {
        width: 98%;
        border: 2px solid #0073E6;
        border-radius: vars.rem(25);
        display: flex;
        align-items: center;
        transition: all 0.3s ease;
        gap: vars.rem(40);
        position: relative;
        z-index: 3;
        padding: vars.rem(30) 0;

        @media (max-width: 991px) {
            width: 100%;
            flex-direction: column !important;
            padding: vars.rem(40) !important;
            gap: vars.rem(20);
            text-align: center;
        }
    }

    &__left {
        display: flex;
        align-items: center;
        gap: vars.rem(20);
        flex-shrink: 0;

        @media (max-width: 991px) {
            flex-direction: column;
            gap: vars.rem(10);
        }
    }

    &__title {
        font-family: vars.$font-family-base;
        font-weight: 700;
        font-size: vars.rem(24);
        line-height: 100%;
        letter-spacing: -2%;
        color: vars.$color-heading;
        margin: 0;
        transition: color 0.3s ease;
        text-align: end;

        @media (max-width: 991px) {
            font-size: vars.rem(20);
        }
    }

    &__icon {
        width: vars.rem(70);
        height: vars.rem(70);
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;

        img {
            max-width: 100%;
            height: auto;
            transition: all 0.3s ease;
        }
    }

    &__separator {
        width: 2px;
        height: vars.rem(100);
        background-color: #D9D9D9;
        flex-shrink: 0;
        transition: background-color 0.3s ease;

        @media (max-width: 991px) {
            width: 100%;
            height: 1px;
        }

        @media (max-width: 767px) {
            height: 1px;
            width: 80%;
        }
    }

    &__right {
        flex-grow: 1;
    }

    &__desc {
        font-family: vars.$font-family-base;
        font-weight: 500;
        font-size: vars.rem(16);
        line-height: 28px;
        letter-spacing: 0%;
        color: vars.$color-text2;
        margin: 0;
        transition: color 0.3s ease;

        @media (max-width: 991px) {
            font-size: vars.rem(14);
            line-height: 24px;
        }

        @media (max-width: 767px) {
            font-size: vars.rem(12);
            line-height: 22px;
        }
    }
}