﻿/* The switch - the outer container */
.switch {
    position: relative;
    display: inline-block;
    width: 100px;
    height: 34px;
}

    /* Hide default HTML checkbox */
    .switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

/* The slider */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

    .slider:before {
        position: absolute;
        content: "";
        height: 26px;
        width: 46px;
        left: 4px;
        bottom: 4px;
        background-color: white;
        transition: 0.4s;
        border-radius: 34px;
    }

/* When the checkbox is checked */
input:checked + .slider {
    background-color: #4caf50;
}

    input:checked + .slider:before {
        transform: translateX(48px);
    }

/* Yes/No text labels */
.switch-label {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: white;
    pointer-events: none;
}

.switch-label-no {
    left: 60px;
    color: black;
}

.switch-label-yes {
    right: 60px;
    color: black;
}

/* Hide the "No" label initially */
.switch input:not(:checked) ~ .switch-label-yes {
    display: none;
}

/* Hide the "Yes" label when checked */
.switch input:checked ~ .switch-label-no {
    display: none;
}

/* Show "No" label when checked */
.switch input:checked ~ .switch-label-yes {
    display: block;
}
