/* Gallery Styles */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 5px 20px var(--shadow-light);
    border: 1px solid var(--border-color);
    transition: all 0.4s ease;
    opacity: 0;
    transform: scale(0.9);
    animation: galleryFadeIn 0.8s ease forwards;
}

.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; }
.gallery-item:nth-child(9) { animation-delay: 0.9s; }

.gallery-item:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 15px 40px var(--shadow-medium);
    border-color: var(--accent-blue);
}

.gallery-item img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    color: white;
    padding: 2rem 1.5rem 1.5rem;
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-overlay h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--accent-green);
    font-weight: 600;
}

.gallery-overlay p {
    font-size: 0.9rem;
    line-height: 1.4;
    opacity: 0.9;
}

/* Gallery Filter Buttons */
.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--primary-white);
    color: var(--dark-text);
    border: 2px solid var(--primary-green);
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.filter-btn:hover,
.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-green), var(--light-green));
    color: var(--primary-white);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(45, 125, 50, 0.3);
}

/* Lightbox styles */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.lightbox img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: rgba(0,0,0,0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.lightbox-close:hover {
    background: var(--primary-green);
    color: var(--primary-white);
}

/* Loading animation for images */
.gallery-item.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmerLoad 1.5s infinite;
}

@keyframes galleryFadeIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmerLoad {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Masonry layout for varied image sizes */
.gallery-masonry {
    columns: 3;
    column-gap: 1.5rem;
}

.gallery-masonry .gallery-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
}

.gallery-masonry .gallery-item img {
    height: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .gallery-item img {
        height: 220px;
    }
    
    .gallery-filters {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .gallery-masonry {
        columns: 2;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-item img {
        height: 200px;
    }
    
    .gallery-masonry {
        columns: 1;
    }
    
    .lightbox-content {
        max-width: 95%;
        max-height: 85%;
    }
}
