
/* THEME SWITCH */
.theme-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

/* Hide actual checkbox */
.theme-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Switch body */
.theme-slider {
    position: relative;
    width: 68px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px;
    border-radius: 999px;
    background:
        rgba(30, 41, 59, 0.95);
    border: 1px solid
        rgba(148, 163, 184, 0.25);
    box-shadow:
        inset 0 0 10px
        rgba(0, 0, 0, 0.25);
    transition:
        background 0.3s ease;
}

/* Icons */
.theme-icon {
    position: relative;
    z-index: 2;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition:
        opacity 0.3s ease;
}

.sun {
    color: #facc15;
    opacity: 1;
}

.moon {
    color: #eca234;
    opacity: 1;
}

/* Moving knob */
.theme-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background:
        linear-gradient(
            135deg,
            #ffffff,
            #e2e8f0
        );
    box-shadow:
        0 2px 8px
        rgba(0, 0, 0, 0.35);
    transition:
        transform 0.3s ease;
}


/* When checked */
.theme-switch input:checked
+ .theme-slider {
    background:
        linear-gradient(
            90deg,
            #1e3a8a,
            #7c3aed
        );
    box-shadow:
        0 0 14px
        rgba(59, 130, 246, 0.35);
}

.theme-switch input:checked
+ .theme-slider
.theme-knob {
    transform:
        translateX(34px);
}