
/* Modern Gallery Styles */
.gallery-card {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(74, 124, 89, 0.15);
    transition: all 0.4s ease;
    cursor: pointer;
    background: #fff;
    user-select: none;
}

.gallery-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(74, 124, 89, 0.25);
}


.gallery-card:hover .gallery-image {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        rgba(45, 90, 39, 0.85) 0%,
        rgba(74, 124, 89, 0.85) 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-direction: column;
}

.gallery-overlay::before {
    content: "🔍";
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.gallery-card:hover .gallery-overlay {
    opacity: 1;
}

.gallery-content h5 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.gallery-content p {
    font-size: 0.9rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Filter Buttons */
.filter-btn {
    transition: all 0.3s ease;
    border-radius: 25px;
    padding: 0.5rem 1.2rem;
    font-weight: 500;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 124, 89, 0.3);
}

.filter-btn.active {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 124, 89, 0.4);
}

.btn-outline.filter-btn:hover {
    background-color: #4a7c59 !important;
    color: #faf8f5 !important;
    border-color: #4a7c59 !important;
}

/* Gallery Animation and Masonry Layout */
.gallery-item {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(30px);
    break-inside: avoid;
    margin-bottom: 1.5rem;
}

/* Simple Bootstrap Grid - Fixed Layout */
.gallery-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.4s ease;
    cursor: pointer;
}

.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-item:nth-child(4) { animation-delay: 0.4s; }
.gallery-item:nth-child(5) { animation-delay: 0.5s; }
.gallery-item:nth-child(6) { animation-delay: 0.6s; }
.gallery-item:nth-child(7) { animation-delay: 0.7s; }
.gallery-item:nth-child(8) { animation-delay: 0.8s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Enhancements */
.modal-content {
    border-radius: 15px;
    overflow: hidden;
}

#modalImage {
    border-radius: 0;
    max-height: 80vh;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Ensure modal dialog adjusts to content */
.modal-dialog {
    display: flex;
    align-items: center;
    min-height: calc(100vh - 2rem);
}

.modal-content {
    width: auto;
    max-width: 90vw;
    margin: 0 auto;
}

.modal-body {
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .gallery-image {
        height: 220px;
    }
    
    .gallery-card {
        border-radius: 12px;
    }
    
    .gallery-card:hover {
        transform: translateY(-4px);
    }
    
    .gallery-card:hover .gallery-image {
        transform: scale(1.05);
    }
    
    .gallery-content h5 {
        font-size: 1rem;
    }
    
    .gallery-content p {
        font-size: 0.8rem;
    }
    
    .filter-btn {
        font-size: 0.85rem;
        padding: 0.4rem 1rem;
    }
    
    .modal-dialog {
        margin: 0.5rem;
        min-height: calc(100vh - 1rem);
    }
    
    #modalImage {
        max-height: 85vh;
        max-width: 95vw;
    }
    
    .modal-content {
        max-width: 95vw;
    }
}

@media (max-width: 576px) {
    .gallery-image {
        height: 200px;
    }
    
    .filter-btn {
        font-size: 0.8rem;
        padding: 0.35rem 0.8rem;
        margin-bottom: 0.5rem;
    }
    
    .gallery-content h5 {
        font-size: 0.9rem;
    }
    
    .gallery-content p {
        font-size: 0.75rem;
    }
}
