.media-slider {
    width: 100%;
    font-family: Arial, sans-serif;
    overflow: hidden; /* Ensure overflow is hidden to hide extra items */
}

.media-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 5px;
}

.media-controls {
    display: flex;
    align-items: center;
    margin-right: 1rem;
}

.cbutton{
    font-size: 20px;
    color: #FFF;
    background-color: #1A0D76;
    border: 1px solid #1A0D76;
    border-radius: 5px;
    margin-right: 5px;
    padding: 2px 10px;
}

.cbutton :hover {
    cursor: pointer;
}

.media-button > a {
    border: 1px solid #1A0D76;
    border-radius: 5px;
    padding: 6px;
    color: #FFF;
    background-color: #1A0D76;
    font-size: 14px;
}

.media-button > a:hover {
    cursor: pointer;
}

.media-body {
    width: 100%;
    overflow: hidden; /* Ensure overflow is hidden to hide extra items */
    position: relative; /* Needed for absolute positioning of items */
}

.media-container {
    width: 100%;
    display: flex; /* Ensure items are in a flex container */
}

.media-content {
    display: flex;
    transition: transform 0.5s ease; /* Smooth transition for sliding effect */
}

.media-item {
    flex: 0 0 calc(100% / 4); /* Set each item to occupy one-third of the container */
    max-width: calc(100% / 4); /* 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 */
    overflow: hidden;
}

.media-item > img {
    border-radius: 6px;
    width: 100%; /* Make sure images fill their respective containers */
    height: 100%; /* Preserve aspect ratio */
    border: 1px solid #000;
}

.media-item > img:hover {
    cursor: pointer;
}

#imageModal {
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    text-align: center;
    padding-top: 60px;
}

#imageModal img {
    margin: auto;
    display: block;
    max-width: 80%;
    max-height: 90%;
}

#imageModal span {
    position: absolute;
    top: 15px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
}

@media screen and (max-width: 479px) {
    .media-controls {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .media-controls > i {
        font-size: 2.5rem; /* Adjust size for mobile if needed */
    }

    .media-button {
        width: 100%;
        display: flex;
        justify-content: flex-end;
    }
    
    .media-item {
        flex: 0 0 100%;
        max-width: 90%; 
        height: 420px;
    }
    
    .media-item > img {
        min-height: 400px; /* Preserve aspect ratio */
    }
}

@media screen and (min-width: 480px) and (max-width: 767px) {
    .media-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .media-controls {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .media-controls > i {
        font-size: 2.5rem; /* Adjust size for mobile if needed */
    }

    .media-button {
        width: 100%;
        display: flex;
        justify-content: flex-end;
    }
    
    .media-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 */
        height: 300px;
    }
}

@media screen and (min-width: 768px) and (max-width: 990px)  {

    .media-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 */
        height: 350px;
    }
}

@media (min-width: 991px) {
    .media-item {
        flex: 0 0 calc(100% / 4); /* Set each item to occupy one-third of the container */
        max-width: calc(100% / 4); /* 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 */
        height: 370px;
    }
    
    .media-item > img {
        min-height: 360px; /* Preserve aspect ratio */
    }
}