/* Gallery Masonry and Modal Styles */
.gallery-masonry {
    column-count: 3;
    column-gap: 20px;
    padding: 0 20px;
    max-height: none;
    position: relative;
}

.gallery-item {
    position: relative;
    break-inside: avoid;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.gallery-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15), 0 0 20px rgba(20, 143, 118, 0.3);
    z-index: 10;
}

/* This rule styles the overlay container */
.gallery-item-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
    z-index: 3;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);

    /* Background styles removed */

    /* Keep flex to center the icon */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* This rule styles the eye icon inside the box */
.gallery-item-overlay i {
    font-size: 2.5rem; /* Icon size */
    color: white;
    text-shadow: rgba(0, 0, 0, 0.5) 0px 2px 4px;
}

/* This rule handles the hover animation */
.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    transition: transform 0.3s ease;
    object-fit: cover;
    background: #f0f0f0;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.image-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.modal-content {
    display: block;
    max-width: 90%;
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    transform: scale(0.8);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.image-modal.active .modal-content {
    transform: scale(1);
}

.close-modal-btn {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #fff;
    font-size: 45px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1051;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;

    /* Background styles removed */
    /* background: rgba(255, 255, 255, 0.1); */
    /* border-radius: 50%; */
    /* backdrop-filter: blur(5px); */

    /* Added for visibility */
    text-shadow: 0px 0px 8px rgba(0, 0, 0, 0.7);
}

.close-modal-btn:hover {
    background: rgba(255, 255, 255, 0.2); /* Kept hover for feedback */
    border-radius: 50%; /* Added back for hover */
    transform: rotate(90deg);
}

.modal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    color: white;
    font-size: 24px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1051;
    display: flex;
    align-items: center;
    justify-content: center;

    /* Background styles removed */
    /* background: rgba(255, 255, 255, 0.1); */
    /* backdrop-filter: blur(5px); */
    /* border-radius: 50%; */

    /* Added for visibility */
    text-shadow: 0px 0px 8px rgba(0, 0, 0, 0.7);
}

.modal-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2); /* Kept hover for feedback */
    border-radius: 50%; /* Added back for hover */
    transform: translateY(-50%) scale(1.1);
}

.modal-prev-btn {
    left: 20px;
}

.modal-next-btn {
    right: 20px;
}

.modal-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(5px);
}

/* Responsive Design for Image Modal */
@media (max-width: 768px) {
    .gallery-masonry {
        column-count: 1;
        padding: 0 10px;
        column-gap: 0;
    }

    .modal-content {
        max-width: 95%;
    }

    .close-modal-btn {
        top: 10px;
        right: 20px;
        font-size: 35px;
        width: 45px;
        height: 45px;
    }

    .modal-nav-btn {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }

    .modal-counter {
        font-size: 12px;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .close-modal-btn {
        width: 40px;
        height: 40px;
        font-size: 30px;
    }
}
