﻿.switch {
    position: relative;
    display: inline-block;
}

/* Tamaño pequeño (sm) */
.switch-sm {
    width: 40px;
    height: 20px;
}

    .switch-sm .slider {
        border-radius: 20px;
    }

        .switch-sm .slider:before {
            height: 16px;
            width: 16px;
            left: 2px;
            bottom: 2px;
        }

    .switch-sm input:checked + .slider:before {
        transform: translateX(20px);
    }

/* Tamaño mediano (md) */
.switch-md {
    width: 60px;
    height: 30px;
}

    .switch-md .slider {
        border-radius: 30px;
    }

        .switch-md .slider:before {
            height: 22px;
            width: 22px;
            left: 4px;
            bottom: 4px;
        }

    .switch-md input:checked + .slider:before {
        transform: translateX(30px);
    }

/* Tamaño grande (lg) */
.switch-lg {
    width: 80px;
    height: 44px;
}

    .switch-lg .slider {
        border-radius: 44px;
    }

        .switch-lg .slider:before {
            height: 36px;
            width: 36px;
            left: 4px;
            bottom: 4px;
        }

    .switch-lg input:checked + .slider:before {
        transform: translateX(36px);
    }

/* Estilos comunes */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: 0.4s;
    transition: 0.4s;
}

    .slider:before {
        position: absolute;
        content: "";
        background-color: white;
        -webkit-transition: 0.4s;
        transition: 0.4s;
        border-radius: 50%;
    }

input:checked + .slider {
    background-color: #2196f3;
}

input:focus + .slider {
    box-shadow: 0 0 1px #2196f3;
}




.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 25px;
    cursor: pointer;
}

    .toggle-switch input[type="checkbox"] {
        display: none;
    }

.toggle-switch-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ddd;
    border-radius: 20px;
    box-shadow: inset 0 0 0 2px #ccc;
    transition: background-color 0.3s ease-in-out;
}

.toggle-switch-handle {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 17px;
    height: 17px;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease-in-out;
}

.toggle-switch::before {
    content: "";
    position: absolute;
    top: -25px;
    right: -15px;
    font-size: 12px;
    font-weight: bold;
    color: #aaa;
    text-shadow: 1px 1px #fff;
    transition: color 0.3s ease-in-out;
}

.toggle-switch input[type="checkbox"]:checked + .toggle-switch-handle {
    transform: translateX(45px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2), 0 0 0 3px #05c46b;
}

.toggle-switch input[type="checkbox"]:checked + .toggle-switch-background {
    background-color: #05c46b;
    box-shadow: inset 0 0 0 2px #04b360;
}

.toggle-switch input[type="checkbox"]:checked:disabled + .toggle-switch-background {
    background-color: #9ca3af;
    box-shadow: inset 0 0 0 2px #d1d5db;
}

.toggle-switch input[type="checkbox"]:checked + .toggle-switch:before {
    content: "On";
    color: #05c46b;
    right: -5px;
}

.toggle-switch input[type="checkbox"]:checked + .toggle-switch-background .toggle-switch-handle {
    transform: translateX(25px);
}

.input-group-prepend {
    margin-right: -1px;
}

.input-group-append, .input-group-prepend {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
}