/* Default styles for light mode (applied by default) */
:root {
    --lunia-theme-switch-background-color: #ccc;
    --lunia-theme-switch-ball-color: #fff;
}

/* Dark mode styles */
[data-theme="dark"] {
    --lunia-theme-switch-background-color: #333;
    --lunia-theme-switch-ball-color: #fff;
}

/* Base styles for the toggle */
.lunia-theme-switch-wrapper {
    display: flex;
    padding: 0.5vh 2vw 0;
}

.lunia-theme-switch-wrapper {
    padding: 0 1rem;
}

.lunia-theme-switch-wrapper label {
    margin-bottom: 0;
}

/* Toggle background */
.lunia-theme-switch-slider {
    display: inline-block;
    height: 34px;
    position: relative;
    width: 60px;
    background-color: var(--lunia-theme-switch-background-color) !important; /* Light mode background color */
    border-radius: 25px;
    transition: background-color 0.4s ease-in-out, transform 0.4s ease-in-out; /* Smooth transition */
}

/* Toggle ball */
.lunia-theme-switch-slider:before {
    content: "";
    background-color: var(--lunia-theme-switch-ball-color) !important; /* Light mode ball color */
    position: absolute;
    top: 4px;
    left: 4px;
    height: 26px;
    width: 26px;
    border-radius: 50%;
    transition: transform 0.4s ease-in-out, background-color 0.4s ease-in-out;
}

/* Hide the checkbox input */
.lunia-theme-switch-wrapper input {
    display: none;
}

/* When the checkbox is checked (dark mode), change the background color */
input:checked + .lunia-theme-switch-slider {
    background-color: var(--lunia-theme-switch-background-color) !important;
}

/* When the checkbox is checked (dark mode), move the ball */
input:checked + .lunia-theme-switch-slider:before {
    transform: translateX(26px);
}

/* Round the toggle background */
.lunia-theme-switch-slider.round {
    border-radius: 34px;
}

/* Round the toggle ball */
.lunia-theme-switch-slider.round:before {
    border-radius: 50%;
}

/* Additional responsiveness for smaller screens */
@media screen and (max-width: 576px) {
    .lunia-theme-switch-slider {
        display: inline-block;
        height: 26px;
        position: relative;
        width: 50px;
    }

    .lunia-theme-switch-slider:before {
        height: 18px;
        width: 18px;
    }
}
