/* Lightbox General Styles */
#custom-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#custom-lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    text-align: center;
    max-width: 70%;
    max-height: 70%;
    display: flex;
    flex-direction: column; /* Ensure the counter is positioned correctly */
    justify-content: center;
    align-items: center;
}

/* Ensure images are always contained within the screen size */
#lightbox-image {
    max-width: 60%; /* Image will not exceed 80% of the viewport width */
    max-height: 60%; /* Image will not exceed 80% of the viewport height */
    width: auto; /* Maintain aspect ratio */
    height: auto; /* Maintain aspect ratio */
    margin: 0 auto;
    display: block;
    object-fit: contain;
}

/* Counter at the bottom of the screen */
#lightbox-counter {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 5px;
    z-index: 1001;
}

/* Close button at the top-right */
#lightbox-close {
    position: fixed;
    top: 10px;
    right: 10px;
    font-size: 32px;
    color: white;
    cursor: pointer;
    z-index: 1001;
}

/* Navigation Buttons */
#lightbox-prev,
#lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px;
    font-size: 24px;
    cursor: pointer;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

#lightbox-prev {
    left: 10px;
}

#lightbox-next {
    right: 10px;
}

/* Adjustments for smaller screens */
@media (max-width: 768px) {
    #lightbox-prev,
    #lightbox-next {
        width: 30px;
        height: 30px;
        font-size: 20px;
    }

    #lightbox-close {
        font-size: 28px;
        top: 5px;
        right: 5px;
    }

    #lightbox-counter {
        font-size: 14px;
        bottom: 5px;
        padding: 3px 8px;
    }
}

@media (max-width: 480px) {
    #lightbox-prev,
    #lightbox-next {
        width: 25px;
        height: 25px;
        font-size: 16px;
    }

    #lightbox-close {
        font-size: 24px;
        top: 5px;
        right: 5px;
    }

    #lightbox-counter {
        font-size: 12px;
        bottom: 5px;
        padding: 2px 6px;
    }
}
