.gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 1000px; 
    margin: 0 auto; 
    margin-top: 50px;
    margin-bottom: 100px;
}

.thumbnails img {
    margin: 5px;
    cursor: pointer;
    width: 200px;
    margin-left: 30px;
    transition: transform 0.3s ease-in-out;
}

.thumbnails img:hover {
    transform: scale(1.1);
}

.modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
}

.modal-contents {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

#expandedImg {
    width: auto;
    height: auto;
    max-width: 80%;
    max-height: 80%;
    display: block;
    margin: 0 auto;
}

.prev, .next {
    position: absolute;
    top: 50%;
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.5);
    color: black;
    font-weight: bold;
    font-size: 20px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.prev:hover, .next:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

.prev {
    left: 20px;
}

.next {
    right: 20px;
}