/* Gallery specific styles */

.gallery-item {
    transition: all 0.3s ease;
    cursor: pointer;
    padding-bottom: 3rem; /* Increased bottom padding */
    margin-bottom: 2rem; /* Add margin between items */
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-item img {
    transition: all 0.3s ease;
    padding: 1rem; /* Add padding around the images */
    border-radius: 0.75rem; /* Increase border radius */
    position: relative;
    width: 100%; /* Make image fit container width */
    height: 100%; /* Make image fit container height */
    object-fit: contain; /* Maintain aspect ratio without cropping */
    max-height: 100%; /* Ensure image doesn't exceed container height */
}

.gallery-item:hover img {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Image container with hover effect */
.gallery-item .img-container {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.gallery-item .img-container::after {
    content: "\f00e"; /* Magnifying glass icon */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 60px;
    height: 60px;
    background: rgba(30, 64, 175, 0.8); /* Primary color with opacity */
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    font-size: 24px;
    z-index: 5;
}

.gallery-item .img-container:hover::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.gallery-item .img-container:hover img {
    filter: brightness(0.9);
}

/* Content styling */
.gallery-item-content {
    padding: 1.5rem; /* Add more padding to the content section */
}

/* Modal styles */
#gallery-modal {
    transition: opacity 0.3s ease;
}

#gallery-modal.visible {
    display: flex;
    animation: fadeIn 0.3s ease forwards;
}

/* Modal content transitions */
#modal-image {
    transition: all 0.3s ease;
    width: auto; /* Allow image to maintain its natural proportions */
    max-width: 100%; /* Limit width to container */
    height: auto; /* Maintain aspect ratio */
    max-height: 75vh; /* Limit height to 75% of viewport height */
    margin: 0 auto; /* Center the image */
    object-fit: contain; /* Ensure entire image is visible */
}

#modal-title, 
#modal-description-1, 
#modal-description-2 {
    transition: opacity 0.2s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .gallery-item {
        padding-bottom: 2rem;
        margin-bottom: 1rem;
    }
    
    .gallery-item img {
        padding: 0.5rem;
        border-radius: 0.5rem;
    }
    
    .gallery-item-content {
        padding: 1rem 1.5rem 2rem;
    }
    
    #prev-btn, #next-btn {
        font-size: 2rem;
        margin: 0;
        padding: 1rem;
        background-color: rgba(0, 0, 0, 0.3);
        border-radius: 50%;
        width: 3rem;
        height: 3rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    #prev-btn {
        left: 1rem;
    }
    
    #next-btn {
        right: 1rem;
    }
    
    #close-modal {
        top: 1rem;
        right: 1rem;
        margin: 0;
    }
}

/* Animation for modal */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.fade-out {
    animation: fadeOut 0.3s ease forwards;
}