.leadsms-widget-container {
    position: fixed;
    z-index: 9999999;
    right: 20px;

    &.widget-opened {
        .leadsms-widget {
            display: flex;
        }
    }
}

.leadsms-widget {

    display: none;
    flex-direction: column;
    z-index: 2147483000;
    position: fixed;
    bottom: 84px;
    right: 20px;
    height: min(580px, 100% - 124px);
    min-height: 280px;
    width: 400px;
    min-width: 280px;
    max-height: 580px;
    box-shadow: rgba(0, 0, 0, 0.16) 0px 5px 40px;
    border-radius: 6px;
    overflow: hidden;
    opacity: 1;
    transform-origin: right bottom;
    transition: width 200ms ease 0s, height 200ms ease 0s, max-height 200ms ease 0s, transform 300ms cubic-bezier(0, 1.2, 1, 1) 0s, opacity 83ms ease-out 0s;
    pointer-events: all;
    background-color: #F7F7F9;
    overflow-y: auto;

    /* width */
    &::-webkit-scrollbar {
        width: 6px;
    }
    
    /* Track */
    &::-webkit-scrollbar-track {
        background: #f1f1f1; 
    }
    
    /* Handle */
    &::-webkit-scrollbar-thumb {
        background: #c4c4c4; 
        border-radius: 6px;
    }
  
    /* Handle on hover */
    &::-webkit-scrollbar-thumb:hover {
        background: #555; 
    }

    @media screen and (max-width: 512px), screen and (max-device-width: 512px) {
        width: 100% !important;
        right: 0 !important;
        max-height: 100% !important;
        top: 0 !important;
        height: 90vh !important;
    }

    /* Header */

    .leadsms-widget-header {
        background-color: #2A9AD6;
        border-top-left-radius: 6px;
        border-top-right-radius: 6px;
        padding: 20px;
    }

    .leadsms-widget-header p {
        color: #ffff;
        text-align: center;
        font-size: 15px;
        position: relative;
        margin-top: 20px;
        white-space: break-spaces;
    }

    /* Main Content */

    .leadsms-widget-main {
        flex-grow: 1;
    }

    .leadsms-widget-main-form-top {
        background-color: #2A9AD6;
        height: 40px;
    }

    .leadsms-widget-main-form {
        background-color: #ffff;
        padding: 30px;
        margin: -40px 0 auto;
        border-top-right-radius: 6px;
        border-top-left-radius: 6px;
        margin-left: 30px;
        margin-right: 30px;
        margin-bottom: 2px;

        &.invalid .has-error {
            > label {
                color: red;
            }
            > input, textarea {
                border-color: red;
            }
        }

        .leadsms-form-field {
            margin-bottom: 20px;
        }

        .text-error {
            color: red;
        }
    }

    .leadsms-widget-main-form input,
    .leadsms-widget-main-form textarea {
        background: #FFFFFF;
        border: 1px solid rgba(228, 228, 228, 0.86);
        border-radius: 2px;
        width: 100%;
        font-size: 14px;
        padding: 8px;
    }

    .leadsms-widget-main-form textarea {
        resize: none;
    }

    .leadsms-widget-main-form textarea:focus {
        border-color: #75868f;
    }

    .leadsms-widget-main-form p,
    .leadsms-widget-main-form label {
        font-size: 14px;
        font-weight: 500;
        margin-bottom: 5px;
    }

    .leadsms-widget-main-form .small-text {
        font-size: 10px;
        font-style: italic;
        font-weight: 300;
    }

    /* Submit Btn */
    .leadsms-widget-main-form .submit-btn {
        margin-top: 5px;
    }

    .leadsms-widget-main-form .submit-btn button {
        text-align: center;
        color: #2A9AD6;
        background: #FFFFFF;
        border: 2px solid #2A9AD6;
        border-radius: 5px;
        padding: 8px 10px;
        font-size: 14px;
        font-weight: 500;
        width: 100%;
        cursor: pointer;
    }

    .leadsms-button-link {
        color: #2A9AD6;
        text-decoration: underline;
    }

    /* Footer */

    .leadsms-widget-footer {
        color: #000;
        text-align: center;
        font-size: 10px;
        font-weight: 300;
        padding: 6px 0;

        a {
            text-decoration: none;
        }

        a:hover {
            text-decoration: underline;
        }
    }

    .no-margin-bottom {
        margin-bottom: 0 !important;
    }
}

.leadsms-widget-launcher {
    position: fixed;
    z-index: 2147483003;
    bottom: 20px;
    right: 20px;

    .hidden {
        display: none !important;
    }

    div.leadsms-widget-prompt {
        position: absolute;
        bottom: 72px;
        right: 0;
        width: 310px;
        max-width: 318px;
        animation: fadeIn .5s ease;

        
        
        > div.content {
            border: 1px solid #e8e9eb;
            box-shadow: 0 8px 20px 0 rgba(0,0,0,.24);
            position: relative;
            background: #fff;
            border-radius: 13px;
            box-sizing: border-box;
            display: -webkit-box;
            display: -webkit-flex;
            display: flex;
            -webkit-box-orient: horizontal;
            -webkit-box-direction: normal;
            -webkit-flex-direction: row;
            flex-direction: row;
            padding: 15px 5px 15px 20px;
            width: 100%;
            z-index: 99999;
            font-size: 16px;

            > .close-button {
                float: right;
                padding: 2px 10px;
                cursor: pointer;
                border-radius: 14px;
                margin-bottom: 4px;
                color: #787c82;
                font-size: 14px;
            }

            &:after {
                content: "";
                width: 20px;
                height: 20px;
                position: absolute;
                bottom: -6px;
                right: 18px;
                background: #fff;
                border-radius: 4px;
                z-index: -1;
                -webkit-transform: rotate(45deg);
                transform: rotate(45deg);
            }
        }
    }

    div.leadsms-widget-bubble {
        padding: 0 15px !important;
        margin: 0 !important;
        border: none;
        width: auto;
        min-width: 80px;
        max-height: 48px;
        height: 48px;
        border-radius: 50px;
        background-color: #F89928;
        cursor: pointer;
        transition: transform 167ms cubic-bezier(0.33, 0.00, 0.00, 1.00);
        box-sizing: content-box;
        box-shadow: 0 10px 20px rgba(0,0,0,.2);
        -webkit-animation: fadeIn .25s ease;
        animation: fadeIn .5s ease;
        
        &:hover {
            opacity: 0.8;
        }

        > div.leadsms-widget-launcher-icon {
            display: flex;
            flex-direction: row-reverse;
            gap: 8px;
            align-items: center;
            justify-content: center;
            height: 48px;
            transition: transform 100ms linear, opacity 80ms linear;
    
            label {
                color: #FFF;
                cursor: pointer;
                padding-bottom: 2px;
                font-size: 16px;
                margin-left: 6px;
            }
    
            .leadsms-widget-launcher-icon-message,
            .leadsms-widget-launcher-icon-close {
                display: flex;
                width: 24px;
                justify-content: center;
            }
        }
    }
}

.leadsms-widget-preview-text {
    position: fixed;
    right: 190px;
    bottom: 23px;
    font-size: 20px;
    background-color: #91ffb7;
    padding: 6px 30px;
}

.leadsms-widget-loading-icon {
    width: 16px;
    height: 16px;
    margin-right: 8px;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
      }
    100% {
      opacity: 1;
    }
  }
  
  @keyframes fadeOut {
    0% {
      opacity: 1;
    }
    100% {
      opacity: 0;
    }
  }