//1. checkbox style
//2. radio button style
//3. delete alert modal
//4. switcher


//------1. checkbox style-------
 .cfe-checkbox {
    input[type=checkbox] {
        display: none;
    }

    &.no-title label {
        height: 14px;
    }

    label {
        font-size: 12px;
        line-height: 14px;
        font-weight: 400;
        color: #7A8B9A;
        position: relative;
        padding-left: 29px;
        display: inline-block;
        text-transform: capitalize;

        &:before {
            content: "";
            position: absolute;
            left: 0;
            top: -3px;
            width: 18px;
            height: 18px;
            border-radius: 4px;
            border: 1px solid #E5E8F3;
            background-color: #f6f6f8;
            transition: all 0.3s ease;
        }
        &:after {
            content: "";
            position: absolute;
            left: 5px;
            top: 3px;
            width: 9px;
            height: 4px;
            transform: rotate(-45deg);
            border-bottom: 2px solid #fff;
            border-left: 2px solid #fff;
            transition: all 0.3s ease;
            opacity: 0;
            visibility: hidden;
        }
    }

    input[type=checkbox]:checked + label::before {
        background-color:$primary-color;
        border-color: $primary-color;
    }
    input[type=checkbox]:checked + label::after {
        opacity: 1;
        visibility: visible;
    }
}

//----2. radio button style-------
.cfe-radiobtn {

    input[type=radio] {
        display: none;
    }

    &.no-title label {
        height: 16px;
    }
    
    label {
        font-size: 12px;
        line-height: 14px;
        font-weight: 400;
        color: #7A8B9A;
        position: relative;
        padding-left: 29px;
        display: inline-block;
        text-transform: capitalize;

        &::before {
            content: "";
            position: absolute;
            left: 0;
            top: -3px;
            width: 18px;
            height: 18px;
            border-radius: 100%;
            background: #F7F7FA;
            border: 1px solid #E5E8F3;
            transition: all 0.3s ease;
        }
        &::after {
            content: "";
            position: absolute;
            left: 5px;
            top: 2px;
            width: 10px;
            height: 10px;
            border-radius: 100%;
            background: $primary-color;
            transform: scale(0);
            transition: all 0.3s ease;
        }
    }

    input[type="radio"]:checked + label::before {
        border-color: $primary-color;
    }
    input[type="radio"]:checked + label::after {
        transform: scale(1);
    }
    
}

//--------3. delete alert modal-----
.cfe-delete-alert-wrapper {
    position: fixed;
    top: 0;
    right: 0;
    padding: 15px;
    width: calc(100% - 160px);
    height: 100%;
    background: rgba(51, 51, 51, 0.2);
    z-index: 999;
    display: none;
    flex-flow: row wrap;
    align-items: center;
    justify-content: center;

    .cfe-delete-confirmation {
        background: #fff;
        box-shadow: 0 1px 34px rgba(0, 0, 0, 0.06);
        border-radius: 10px;
        padding: 30px 20px;
        width: 100%;
        max-width: 420px;
        text-align: center;
        animation: cfe-bounce .3s;

        h3 {
            font-size: 16px;
            font-weight: 500;
        }
    }

    .icon {
        width: 50px;
        height: 50px;
        border: 2px solid #e65555;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto 20px;
        border-radius: 100%;

        svg {
            width: 18px;
            height: 18px;

            path {
                stroke: #e65555;
            }
        }
    }

    .cfe-delete-confirm-btn {
        display: flex;
        flex-flow: row;
        align-items: center;
        justify-content: center;
        margin-top: 30px;

        li {
            margin: 0 10px;
        }

        .btn-default {
            height: 41px;
            line-height: 42px;
            padding: 0 20px;
            min-width: 110px;
            border-radius: 5px;

            &.yes {
                background-color: #e65555;

                &:hover {
                    background-color: #de6464;
                }
            }
            &.cancel {
                background-color: #eee;
                color: #333;
                
                &:hover {
                    background-color: #e2e2e2;
                }
            }
        }
    }
}

@keyframes cfe-bounce {
    0% {
        transform: scale(.7);
    }
    45% {
        transform: scale(1.05);
    }
    80% {
        transform: scale(.95);
    }
    100% {
        transform: scale(1);
    }
}


//------4. switcher ------
.cfe-switcher {
    position: relative;
    
    input[type="checkbox"] {
        display: none;
    }

    label {
        display: block;
        position: relative;
        cursor: pointer;
        outline: none;
        user-select: none;
        width: 50px;
        height: 25px;
        border-radius: 50px;
        background-color: #F7F7FA;
        border: 1px solid #E5E8F3;
        transition: all 0.3s ease;

        &:after {
            content: "";
            width: 15px;
            height: 15px;
            filter: drop-shadow(0px 2px 2px rgba(193, 193, 218, 0.45));
            background-color: #ffffff;
            border-radius: 100%;
            position: absolute;
            top: 4px;
            left: 4px;
            transition: all 0.3s ease;
        }
    }

    input[type="checkbox"]:checked + label{
        border-color: $primary-color;
        background-color: $primary-color;
    }
    input[type="checkbox"]:checked + label:after {
        margin-left: 26px;
        filter: none;
    }

}

.cfe-switcher.sm label {
    width: 33px;
    height: 18px;
}
.cfe-switcher.sm label:after {
    width: 10px;
    height: 10px;
    top: 3px;
    left: 3px;
}
.cfe-switcher.sm input[type="checkbox"]:checked + label:after {
    margin-left: 16px;
}
