@use 'variables' as *;


.wp-dark-mode-switch-24 {
    display: flex;
    align-items: center;
    gap: scaled(12px);
    cursor: default;
    transition: all 0.3s ease;

    &:hover {
        & ._thumb {
            transform: scale(1.1);
            box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
        }
    }

    & ._track {
        width: scaled(65px);
        height: scaled(35px);
        background-color: #84b2f7;
        border-radius: scaled(50px);
        position: relative;
        overflow: hidden;
        transition: all 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55);
        cursor: pointer;
    }

    & ._thumb {
        display: flex;
        width: scaled(23px) !important;
        height: scaled(23px) !important;
        background-color: #fff;
        border-radius: scaled(50px);
        position: absolute;
        top: scaled(6px) !important;
        left: scaled(6px) !important;
        transition: all 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55);

        & svg {
            fill: #fff;
            width: 100%;
            height: 100%;
            transform: rotate(-100deg);
            transition: all 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55);
        }
    }

    &.active {
        & ._track {
            background: #000;
        }

        & ._thumb {
            transform: translateX(scaled(30px));
            background: rgba(0, 0, 0, 0);

            & svg {
                opacity: 100;
            }
        }

        & ._label:first-child {
            color: #666;
        }

        & ._label:last-child {
            color: #fff;
        }
    }

    &:not(.active) {
        & ._label:last-child {
            color: #aaa;
        }
    }

    & ._label {
        font-size: scaled(15px);
        font-weight: 600;
        color: #000;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
        transition: color 0.2s ease;
        cursor: pointer;
        letter-spacing: 0.5px;

        &:last-child {
            color: #888;
        }
    }


    ._circles {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;

        & span {
            position: absolute;
            width: scaled(8px);
            height: scaled(8px);
            background: #fff;
            border-radius: 50%;
            transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);

            &:first-child {
                right: scaled(10px);
                top: scaled(8px);
                transition-delay: 0.05s;
            }

            &:last-child {
                width: scaled(4px);
                height: scaled(4px);
                right: scaled(20px);
                top: scaled(17px);
                transition-delay: 0.15s;
            }
        }
    }

    ._stars {
        svg {
            position: absolute;
            width: scaled(8px);
            height: scaled(8px);
            color: #fff;
            border-radius: 50%;
            transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
            opacity: 0;
            transform: translateX(50px) scale(0.3) rotate(180deg);

            // 5 starts, different sizes, different location at the left.
            &:nth-child(1) {
                width: scaled(7px);
                height: scaled(7px);
                left: scaled(10px);
                top: scaled(8px);
                transition-delay: 0.1s;
            }

            &:nth-child(2) {
                width: scaled(5px);
                height: scaled(5px);
                left: scaled(25px);
                top: scaled(21px);
                transition-delay: 0.2s;
            }

            &:nth-child(3) {
                width: scaled(3px);
                height: scaled(3px);
                left: scaled(28px);
                top: scaled(8px);
                transition-delay: 0.25s;
            }

            &:nth-child(4) {
                width: scaled(3px);
                height: scaled(3px);
                left: scaled(23px);
                top: scaled(13px);
                transition-delay: 0.3s;
            }

            &:nth-child(5) {
                width: scaled(3px);
                height: scaled(3px);
                left: scaled(9px);
                top: scaled(22px);
                transition-delay: 0.35s;
            }

        }
    }

    &.active {
        & ._circles span {
            transform: translateX(-50px);
            opacity: 0;
        }
    
        & ._stars svg {
            transform: translateX(0) scale(1) rotate(0deg);
            opacity: 1;
        }
    }
}
