@import url('colors.css');

.switch-container {
    font-size: 14px;
    position: relative;
    display: flex;
    padding: 0;
    position: relative;
    background: var(--color-switch-background);
    line-height: 35px;
    border-radius: 50px 50px 50px 50px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 15px;
    margin-top: 0px;

    border: solid;
    border-width: 1px;
    border-color: var(--color-borders);
}


.switch-container input {
    visibility: hidden;
    position: absolute;
    top: 0;
}

/* labels for the switch box*/
.switch-container label {
    width: 50%;
    padding: 0;
    margin: 0;
    text-align: center;
    cursor: pointer;
    color: var(--color-switch-label);
}

/* switch highlighters wrapper (sliding left / right).
wrapper neeed to enable even margins
*/
.switch-wrapper {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    padding: 0.15rem;
    z-index: 3;
    transition: transform .5s cubic-bezier(.77, 0, .175, 1);
}

/* switch box highlighter */
.switch {
    border-radius: 50px 50px 50px 50px;
    background: var(--color-switch-selected);
    height: 100%;
}

.switch div {
    width: 100%;
    text-align: center;
    opacity: 0;
    display: block;
    color: var(--color-switch-label-selected) ;
    transition: opacity .2s cubic-bezier(.77, 0, .175, 1) .125s;
    will-change: opacity;
    position: absolute;
    top: 0;
    left: 0;
}

/* slide the switch box from right to left */
.switch-container input:nth-of-type(1):checked~.switch-wrapper {
    transform: translateX(0%);
}

/* slide the switch box from left to right */
.switch-container input:nth-of-type(2):checked~.switch-wrapper {
    transform: translateX(95%);
}

/* toggle the switch box labels - first checkbox:checked -> shows first switch div */
.switch-container input:nth-of-type(1):checked~.switch-wrapper .switch div:nth-of-type(1) {
    opacity: 1;
}

/* toggle the switch box labels - second checkbox:checked -> shows second switch div */
.switch-container input:nth-of-type(2):checked~.switch-wrapper .switch div:nth-of-type(2) {
    opacity: 1;
}
