body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
}

.gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 10px;
}

.gallery-item {
    margin: 10px;
    flex: 1 1 calc(25% - 20px);
    max-width: calc(25% - 20px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: 0.3s;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
}

.gallery-item:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0, 0, 0);
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    position: relative;
    margin: auto;
    display: block;
    max-width: 80%;
    max-height: 80%;
}

#modalImage {
    width: 100%;
    height: auto;
}

/* Navigation Arrows */
.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 24px;
    transition: 0.3s;
    user-select: none;
}

.next {
    right: 0;
}

.prev {
    left: 0;
}

.prev:hover, .next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Thumbnails */
.thumbnails {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.thumbnails img {
    width: 50px;
    height: 50px;
    margin: 5px;
    cursor: pointer;
    opacity: 0.6;
    transition: 0.3s;
}

.thumbnails img:hover, .thumbnails img.active {
    opacity: 1;
    border: 2px solid white;
}
