* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    padding: 20px;
    padding-right: 350px; /* Space for floating image */
    background-color: #f5f5f5;
}

h1 {
    margin-bottom: 30px;
    color: #333;
}

/* Filename list styling */
#filename-list {
    list-style: none;
    max-width: 600px;
}

#filename-list li {
    padding: 0px;
    margin-bottom: 0px;
    background-color: #f5f5f5;
    /* border: 1px solid #ddd; */
    /* border-radius: 5px; */
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}
/*
#filename-list li:hover {
    background-color: #f0f0f0;
} */

#filename-list li.active {
    /* background-color: #e3f2fd; */
    /* border-color: #2196F3; */
    /* font-weight: bold; */
    filter: url(#displacement);
}

/* Floating container - TOP RIGHT */
#floating-container {
    position: fixed;
    top: 0px;
    right: 0px;
    width: 300px;
    min-width: 100px;
    max-width: 90vw;
    background-color: white;
    border: 0px solid #333;
    border-radius: 0px;
    box-shadow: 0 0px 0px rgba(0, 0, 0, 0.3);
    padding: 0px;
    z-index: 1000;
    display: none; /* Hidden initially */
    filter: url(#displacement_02);
}

#floating-container.visible {
    display: block;
}

#filename-display {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 0px;
    color: #2196F3;
    text-align: center;
}

#floating-image {
    width: 100%;
    height: auto;
    border-radius: 0px;
    display: block;
    cursor: pointer;
    transition: transform 0.001s ease;
    filter: url(#displacement_03);
}

#floating-image.flipped {
    transform: rotate(180deg);
}

#resize-handle {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 18px;
    height: 18px;
    cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 40%, #aaa 40%, #aaa 50%, transparent 50%, transparent 65%, #aaa 65%, #aaa 75%, transparent 75%);
}

/* Add some bottom padding so you can scroll past last item */
body::after {
    content: '';
    display: block;
    height: 100vh;
}

/* Mobile: full-screen background image, list scrolls on top */
@media (max-width: 600px) {
    body {
        padding-right: 20px;
        padding-top: 20px;
        background-color: #f5f5f5;
    }

    #floating-container {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw !important;
        max-width: 100%;
        height: 100vh;
        overflow: hidden;
        background-color: transparent;
        z-index: 0;
    }

    #floating-image {
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: center center;
        mix-blend-mode: multiply;
    }

    #filename-list {
        position: relative;
        z-index: 1;
    }

    #filename-list li {
        font-size: 14px;
        background-color: transparent;
    }

    #resize-handle {
        display: none;
    }
}