body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000;
    background-image: none !important;
}

/* Fix injected sidebars inheriting 20% width from root style.css */
#left-sidebar-placeholder .left-nav,
#right-sidebar-placeholder .right-sidebar {
    width: 100% !important;
    float: none !important;
    box-sizing: border-box;
    margin: 0 !important;
}

#bg {
    position: absolute;
    top: -5vh;
    left: -5vw;
    width: 110vw;
    height: 110vh;
    background-image: url('motelwindow.png');
    background-size: cover;
    background-position: center;
    filter: blur(8px) brightness(0.6);
    z-index: 1;
    transition: transform 0.1s linear;
}

#particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

#container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
}

/* Skeuomorphic Image Frame */
.element {
    box-sizing: border-box;
    background: linear-gradient(135deg, #fdfdfd 0%, #e0e0e0 100%);
    border: 1px solid #888;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 
        0 15px 35px rgba(0,0,0,0.7),
        inset 0 1px 0 rgba(255,255,255,1),
        inset 0 -1px 0 rgba(0,0,0,0.2),
        inset 1px 0 0 rgba(255,255,255,0.5),
        inset -1px 0 0 rgba(0,0,0,0.1);
    position: absolute;
    cursor: grab;
    opacity: var(--depth-opacity, 1);
}

.element:active {
    cursor: grabbing;
}

/* The actual image inside the frame */
.element img {
    max-width: 220px;
    max-height: 220px;
    width: auto;
    height: auto;
    border-radius: 4px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.8);
    display: block;
    background-color: #000;
    transition: filter 0.3s ease;
}

/* Safe Hover Effect */
.element img:hover {
    filter: brightness(1.2) contrast(1.1);
}

/* Glossy Glass Overlay */
.element::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    height: 50%;
    background: linear-gradient(
        var(--gloss-angle, 180deg), 
        rgba(255,255,255,0.8) 0%, 
        rgba(255,255,255,0.15) 95%, 
        rgba(255,255,255,0) 100%
    );
    border-radius: 4px 4px 50% 50% / 4px 4px 15% 15%;
    pointer-events: none; 
    z-index: 2;
    opacity: var(--gloss-opacity, 1);
}

/* Fullscreen Modal */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.9);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.modal.show {
    display: block;
    opacity: 1;
}

.modal-content {
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(0,0,0,0.5));
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: color 0.3s ease;
}

.close-btn:hover,
.close-btn:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Hide sidebars on mobile devices */
@media (max-width: 768px) {
    #left-wrapper, #right-wrapper {
        display: none !important;
    }
}
