.demo-container{
    width: 100%;
    font-family: var(--main-font);
}

.demo-wrapper{
    display: flex;
    align-items: center;
    gap: 4%;
    margin: 0 auto;
    width: min(1680px, 80%);
}

.demo-section{
    flex: 1;
}

.demo-header{
    opacity: 0;
    transform: translateX(-50%);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out; /* Make sure to define transition for all elements */
}

.demo-header h2{
    padding-bottom: 10px;
    transform: translateY(-3px);
}

.demo-header h2::after{
    content: '';
    position: absolute;
    background-color: var(--primary-color);
    width: 100%;
    left: 0;
    bottom: 0;
}

.demo-content{
    margin: 5% 0;
    margin-bottom: 7%;
    padding: 2%;
    background-color: #444;
    border-radius: 6px;
    opacity: 0;
    transform: translateX(-50%);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out; /* Make sure to define transition for all elements */
}

.demo-content p{
    font-size: calc(var(--margin-l) + 0.15rem);
    font-weight: 400;
    color: whitesmoke;
    line-height: 1.8;
}

.order-demo-button {
    text-decoration: none;
    color: whitesmoke;
    font-weight: 500;
    text-wrap: wrap;
    border-radius: 6px;
    font-size: calc(var(--margin-l) + 0.2rem);
    text-transform: capitalize;
    
    padding: 12px 18px;
    background-color: var(--primary-color);
    transition: all 0.2s ease;

    /* Initially hidden state */
    opacity: 0; /* Hidden */
    transform: translateX(-50%); /* Start off to the left */
}

.order-demo-button:hover{
    transform: scale(1.05);
    background-color: var(--primary-color-dark-10);
}

.order-demo-button:active{
    transform: scale(1);
    background-color: var(--primary-color-dark-20);
}

.demo-image-container{
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: auto;
    transition: opacity 0.5s ease-out, transform 0.5s ease-out; /* Transition for both properties */
}

.demo-image-wrapper{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: auto;
    opacity: 0; /* Hidden initially */
    transform: translateX(50%); /* Start off to the right */
}

.demo-image-container img{
    width: 70%;
    height: auto;
}

.demo-header,
.demo-content,
.order-demo-button,
.demo-image-wrapper {
    transition: opacity 0.5s ease-out, transform 0.5s ease-out, background-color 0.2s ease; /* Make sure to define transition for all elements */
}

.visible {
    opacity: 1; /* Show the element */
    transform: translateX(0); /* Move to initial position */
}


@media screen and (max-width: 1680px){
/* 
    .demo-header{
        width: fit-content;
        padding: 10px 12px;
        border-radius: 6px;
        background-color: #444;
    } */
    
    .demo-header h2{
        padding-bottom: 5px;
        transform: translateY(-2px);
    }
    
    .demo-content p{
        font-size: calc(var(--margin-l) - 0.1rem);
    }

    .order-demo-button {
        font-size: calc(var(--margin-l) + 0.05rem);
    }
}

@media screen and (max-width: 1280px){
    .demo-wrapper{
        gap: 10px;
    }

    .demo-header{
        padding: 8px 12px;
        border-radius: 6px;
    }

    .demo-header h2{
        padding-bottom: 5px;
        transform: translateY(-2px);
    }
    
    .demo-header h2::after{
        content: '';
        position: absolute;
        background-color: var(--primary-color);
        width: 100%;
        left: 0;
        bottom: 0;
    }

    .demo-content{
        margin: 35px 0;
        padding: 8px 12px;
        background-color: #444;
        border-radius: 6px;
    }

    .demo-content p{
        font-size: clamp(0.95rem, 1vw, 1.2rem);
    }

    .order-demo-button{
        text-decoration: none;
        color: whitesmoke;
        font-weight: 500;
        border-radius: 6px;
        font-size: clamp(0.9rem, 0.8vw, 1.2rem);
        
        padding: 8px 10px;
        background-color: var(--primary-color);
        transition: all 0.2s ease;
    }
}

@media screen and (max-width: 800px){
    .demo-container{
        overflow-x: hidden;
    }

    .demo-wrapper{
        display: flex;
        flex-direction: column-reverse;
        align-items: center;
        gap: 0%;
        margin: 0 auto;
        width: 100%;
    }

    .demo-header{
        width: 100%;
        border-radius: 6px;
        padding: 15px 25px;
    }

    .demo-header h2{
        padding-bottom: 7px;
        transform: translateY(-4px);
    }

    .demo-content{
        padding: 15px 25px;
    }

    .demo-content p{
        font-size: calc(var(--margin-l) + 0.1rem);
    }

    .demo-section:nth-of-type(1){
        position: relative;
        z-index: 3;
        width: 90%;
    }

    .demo-section:nth-of-type(2){
        position: relative;
        z-index: 2;
        width: 90%;
    }

    .demo-image-container{
        position: relative;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        margin: 0 auto;
        width: auto;
        height: 100%;
        margin-top: -20%;
    }

    .demo-image-wrapper{
        transform: translateX(100%); /* Start off to the right */
    }

    .visible {
        opacity: 1; /* Show the element */
        transform: translateX(0); /* Move to initial position */
    }
    
    .demo-image-container img{
        width: 90%;
        height: 100%;
        transform: translateY(30%);
    }

    .order-demo-button{
        text-align: center;
        display: flex;
        justify-content: center;
        border-radius: 6px;
        font-size: calc(var(--margin-l) - 0rem);
        
        padding: 12px 0px;
    }
}

@media screen and (max-width: 500px){
    .demo-header{
        width: 100%;
        border-radius: 6px;
        padding: 10px 18px;
    }

    .demo-content{
        padding: 10px 18px;
    }

    .demo-header h2{
        width: fit-content;
        padding-bottom: 6px;
        font-size: 1.2rem;
        transform: translateY(-2px);
    }

    .demo-content p{
        font-size: clamp(1rem, 3vw, 1.5rem);
    }

    .order-demo-button{
        border-radius: 6px;
        font-size: clamp(1rem, 3vw, 1.5rem);
        
        padding: 12px 0px;
    }
}

@media screen and (max-width: 375px){
    .demo-header h2{
        font-size: calc(var(--margin-xm) - 0rem);
    }

    .demo-content p{
        font-size: clamp(1rem, 3vw, 1.5rem);
    }

    .order-demo-button{
        text-align: center;
        border-radius: 6px;
        font-size: 0.9rem;
        
        padding: 12px 0px;
    }
}