/*
    Author of this APU SFF 2.0 Website/Project/System/Maintainer: Khoo Lay Bin TP083872 (https://khoolb.com), Khoo Lay Yang TP070513 (https://www.dkly.net)
    Date: 2025-12-19
    Description: Create a toggle swtich css design like iOS style that can be use for all checkbox
*/


.checkbox-switch {
    display: inline-block;
}


.checkbox-switch input[type="checkbox"] {
    display: none;
}


.checkbox-switch label {
    height: 24px;
    width: 48px;
    background-color: #ffffff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    transition: transform 0.4s;
    box-shadow:
        inset 0 0 3px 2px rgba(255, 255, 255, 1),
        inset 0 0 12px 0.6px rgba(0, 0, 0, 0.488),
        6px 12px 18px rgba(0, 0, 0, 0.096),
        inset 0 0 0 2px rgba(0, 0, 0, 0.3);
}


.checkbox-switch label:hover {
    transform: perspective(100px) rotateX(7deg) rotateY(-7deg);
}

.checkbox-switch input[type="checkbox"]:checked~label:hover {
    transform: perspective(100px) rotateX(-7deg) rotateY(7deg);
}


.checkbox-switch label::before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background-image: linear-gradient(130deg, #ffffff 11%, #726f6f 100%);
    left: 4px;
    box-shadow: 0 1.2px 0.6px rgba(0, 0, 0, 0.3), 6px 6px 6px rgba(0, 0, 0, 0.3);
    transition: 0.4s;
}


.checkbox-switch input[type="checkbox"]:checked~label::before {
    left: 20px;
    width: 24px;
    border-radius: 12px;
    background-image: linear-gradient(315deg, #000000 0%, #414141 70%);
    transition: 0.4s;
}


@media (max-width: 480px) {
    .checkbox-switch label {
        height: 20px;
        width: 40px;
        border-radius: 10px;
    }

    .checkbox-switch label::before {
        height: 12px;
        width: 12px;
    }

    .checkbox-switch input[type="checkbox"]:checked~label::before {
        left: 16px;
        width: 20px;
        border-radius: 10px;
    }
}