
label[data-theme-toggle] {
    cursor: pointer;
    user-select: none;
    z-index: 1;
    position: absolute;
    top: 20px;
    right: 20px;

    height: 24px;
    font-size: 12px;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    text-transform: uppercase;

    opacity: 0.3;

    animation: 2500ms ease-out 0s 1 animateSlideIn;

    --transition-theme-toggle: all var(--theme-transition-time) ease-in-out;
    transition: var(--transition-theme-toggle);

    &:hover {
        opacity: 1;
    }

    /*hide box*/

    & input {
        opacity: 1;
        width: 0;
        margin: 0;
        padding: 0;
        border: none;
    }

    & span {
        position: relative;
        display: inline-block;
        margin: 0 8px;
        width: 40px;
        height: 24px;
        border-radius: 24px;
        transition: var(--transition-theme-toggle);

        &::before {
            content: "";
            top: 4px;
            position: absolute;
            border-radius: 50%;
            width: 16px;
            aspect-ratio: 1;
            transition: var(--transition-theme-toggle);
        }

        &::after {
            content: "";
            aspect-ratio: 1;
            border-radius: 50%;
            width: 16px;
            position: absolute;
            top: 4px;
            transition: var(--transition-theme-toggle);
        }
    }
}

[data-theme="dark"] {
    & [data-theme-toggle] {
        color: white;

        & span {
            background: white;

            &::before {
                background: black;
                left: 4px;
            }

            &::after {
                left: 30%;
                background: white;
            }
        }
    }
}

[data-theme="light"] {
    & label[data-theme-toggle] {
        color: black;

        & span {
            background: black;

            &::before {
                background: white;
                left: 20px;
            }

            &::after {
                background: white;
                left: 20px;
            }
        }
    }
}

@media only screen and (max-width: 650px) {
    label[data-theme-toggle] {
        font-size: 7px;
    }
}
