.library-slider {
    width: 100%;
    font-family: Arial, sans-serif;
    overflow: hidden; /* Ensure overflow is hidden to hide extra items */
}

.library-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 5px;
}

.library-title {
    font-size: 1.6rem;
    font-weight: bold;
}

.library-tools {
    display: flex;
    align-items: center;
}

.library-controls {
    display: flex;
    align-items: center;
    margin-right: 1rem;
}

.library-controls > i {
    font-size: 3rem;
    margin-right: 0.4rem;
    color: #563A52;
}

.library-controls > i:hover {
    cursor: pointer;
}

.library-button > a {
    border: 1px solid #999999;
    border-radius: 5px;
    padding: 6px;
    color: #444444;
    background-color: #fafafa;
}

.library-button > a:hover {
    cursor: pointer;
}

.library-body {
    width: 100%;
    overflow: hidden; /* Ensure overflow is hidden to hide extra items */
    position: relative; /* Needed for absolute positioning of items */
}

.library-container {
    width: 100%;
    display: flex; /* Ensure items are in a flex container */
}

.library-content {
    display: flex;
    transition: transform 0.5s ease; /* Smooth transition for sliding effect */
}

.library-item {
    flex: 0 0 calc(100% / 3); /* Set each item to occupy one-third of the container */
    max-width: calc(100% / 3); /* Ensure each item is not wider than one-third of the container */
    padding: 5px; /* Add some padding between items */
    box-sizing: border-box; /* Ensure padding doesn't increase item width */
}

.library-item > img {
    border-radius: 6px;
    width: 100%; /* Make sure images fill their respective containers */
    height: 100%; /* Preserve aspect ratio */
}

@media (max-width: 768px) {
    .library-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .library-title {
        width: 100%;
        margin-bottom: 10px;
    }

    .library-tools {
        width: 100%;
        justify-content: space-between;
    }

    .library-controls {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .library-controls > i {
        font-size: 2.5rem; /* Adjust size for mobile if needed */
    }

    .library-button {
        width: 100%;
        display: flex;
        justify-content: flex-end;
    }
    
    .library-item {
        flex: 0 0 100%; /* Set each item to occupy one-third of the container */
        max-width: 100%; /* Ensure each item is not wider than one-third of the container */
        padding: 5px; /* Add some padding between items */
        box-sizing: border-box; /* Ensure padding doesn't increase item width */
    }
}

@media (min-width: 769px) and (max-width: 990px) {

    .library-item {
        flex: 0 0 calc(100% / 2); /* Set each item to occupy one-third of the container */
        max-width: calc(100% / 2); /* Ensure each item is not wider than one-third of the container */
        padding: 5px; /* Add some padding between items */
        box-sizing: border-box; /* Ensure padding doesn't increase item width */
    }
}