/* Brightness Buttons (Adjusted for smaller remote) */
.button-container {
    display: flex;
    justify-content: center;
    margin: 12px;
}

.button-3d {
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    border-width: 0;
    padding: 0 6px;
    min-width: 3em;
    min-height: 3em;
    box-sizing: border-box;
    background: transparent;
    font: inherit;
    cursor: pointer;
    margin: 8px;
    border-radius: 16px;
}

.button-top {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    padding: 6px 12px;
    transform: translateY(0);
    color: #fff;
    background-image: linear-gradient(145deg, #6a11cb, #2575fc);
    text-shadow: 0 -1px rgba(0, 0, 0, 0.25);
    border-radius: 16px;
    transition: transform 0.3s, border-radius 0.3s, background 10s;
}

.button-3d:active .button-top {
    border-radius: 8px 8px 6px 6px / 6px;
    transform: translateY(1.5px);
    background-image: linear-gradient(145deg, #2575fc, #6a11cb);
}

.button-bottom {
    position: absolute;
    z-index: 1;
    bottom: 3px;
    left: 3px;
    border-radius: 16px;
    padding-top: 4px;
    width: calc(100% - 6px);
    height: calc(100% - 8px);
    background-image: linear-gradient(145deg, #2575fc, #6a11cb);
    box-shadow: 0px 1.5px 2px 0px rgba(0, 0, 0, 0.5);
    transition: border-radius 0.2s, padding-top 0.2s;
}

.button-base {
    position: absolute;
    z-index: 0;
    top: 3px;
    left: 0;
    border-radius: 16px;
    width: 100%;
    height: calc(100% - 3px);
    background-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 0.75px 0.75px 0 rgba(255, 255, 255, 0.75),
        inset 0 1.5px 1.5px rgba(0, 0, 0, 0.25);
    transition: border-radius 0.2s, padding-top 0.2s;
}

.button-3d:active .button-bottom {
    border-radius: 8px 8px 6px 6px / 6px;
    padding-top: 0;
}

.button-3d:active .button-base {
    border-radius: 8px 8px 6px 6px / 6px;
}

/* Switch (Adjusted for smaller remote) */
#switch {
    visibility: hidden;
    clip: rect(0 0 0 0);
    position: absolute;
    left: 9999px;
}

.switch {
    display: block;
    width: 80px;
    height: 36px;
    margin: 8px auto;
    position: relative;
    background: #ced8da;
    background: linear-gradient(left, #ced8da 0%, #d8e0e3 29%, #ccd4d7 34%, #d4dcdf 62%, #fff9f4 68%, #e1e9ec 74%, #b7bfc2 100%);
    transition: all 0.2s ease-out;
    cursor: pointer;
    border-radius: 0.35em;
    box-shadow: 0 0 0.75px 1.5px rgba(0, 0, 0, 0.7),
        inset 0 1.5px 0 rgba(255, 255, 255, 0.6),
        inset 0 -0.75px 0 0.75px rgba(0, 0, 0, 0.3),
        0 6px 8px rgba(0, 0, 0, 0.15);
}

.switch:before {
    display: block;
    position: absolute;
    left: -20px;
    right: -20px;
    top: -15px;
    bottom: -15px;
    z-index: -2;
    content: "";
    border-radius: 0.4em;
    background: #d5dde0;
    background: linear-gradient(#d7dfe2, #bcc7cd);
    box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.6),
        inset 0 -0.75px 0.75px 0.75px rgba(0, 0, 0, 0.3),
        0 0 6px 1.5px rgba(0, 0, 0, 0.2),
        0 1.5px 3px 1.5px rgba(0, 0, 0, 0.1);
    pointer-events: none;
    transition: all 0.2s ease-out;
}

.switch:after {
    content: "";
    position: absolute;
    right: -15px;
    top: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #788b91;
    margin-top: -5px;
    z-index: -1;
    box-shadow: inset 0 -0.75px 6px rgba(0, 0, 0, 0.7),
        inset 0 -1.5px 1.5px rgba(0, 0, 0, 0.2),
        0 0.75px 0 white,
        0 -0.75px 0 rgba(0, 0, 0, 0.5),
        -25px 18px 8px 7px rgba(0, 0, 0, 0.25);
}

#switch:checked ~ .switch {
    background: #b7bfc2;
    background: linear-gradient(to right, #b7bfc2 0%, #e1e9ec 26%, #fff9f4 32%, #d4dcdf 38%, #ccd4d7 66%, #d8e0e3 71%, #ced8da 100%);
}

#switch:checked ~ .switch:after {
    background: #b1ffff;
    box-shadow: inset 0 -0.75px 6px rgba(0, 0, 0, 0.7),
        inset 0 -1.5px 1.5px rgba(0, 0, 0, 0.2),
        0 0.75px 0 white,
        0 -0.75px 0 rgba(0, 0, 0, 0.5),
        -65px 18px 8px 7px rgba(0, 0, 0, 0.25);
}

/* Responsive adjustments for switch */
@media (min-width: 768px) {
    .switch {
        width: 100px;
        height: 46px;
    }
    .switch:before {
        left: -25px;
        right: -25px;
        top: -20px;
        bottom: -20px;
    }
    .switch:after {
        right: -20px;
        width: 12px;
        height: 12px;
        margin-top: -6px;
        box-shadow: inset 0 -0.75px 6px rgba(0, 0, 0, 0.7),
            inset 0 -1.5px 1.5px rgba(0, 0, 0, 0.2),
            0 0.75px 0 white,
            0 -0.75px 0 rgba(0, 0, 0, 0.5),
            -35px 24px 11px 10px rgba(0, 0, 0, 0.25);
    }
    #switch:checked ~ .switch:after {
        box-shadow: inset 0 -0.75px 6px rgba(0, 0, 0, 0.7),
            inset 0 -1.5px 1.5px rgba(0, 0, 0, 0.2),
            0 0.75px 0 white,
            0 -0.75px 0 rgba(0, 0, 0, 0.5),
            -85px 24px 11px 10px rgba(0, 0, 0, 0.25);
    }
}

/* Custom styles for enhanced UI */
.remote {
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    visibility: visible !important; /* Ensure the remote is always visible */
    opacity: 1 !important; /* Prevent fading out */
    display: block !important; /* Prevent display: none */
    transition: none !important; /* Disable any transitions that might hide the remote */
    position: absolute !important; /* Ensure position is not overridden */
    bottom: 4rem !important; /* Match Tailwind's bottom-4 */
    right: 4rem !important; /* Match Tailwind's right-4 */
    z-index: 10 !important; /* Ensure it stays above other elements */
}

.scene-btn {
    background: linear-gradient(145deg, #4a4a4a, #2a2a2a);
    border: 1px solid rgba(255, 255, 253, 0.2);
}

.scene-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    background: linear-gradient(145deg, #5a5a5a, #3a3a3a);
}

.scene-btn:active {
    transform: scale(0.95);
}

.scene-img {
    transition: opacity 0.1s ease-in-out; /* Fast transition for real-time feel */
}