/* Gallery Styles */
.gallery-intro {
    background: white;
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 3rem;
    text-align: center;
}

.gallery-filters {
    margin: 2rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.filter-btn {
    background: linear-gradient(135deg, #a8c090, #8fbc8f);
    border: 2px solid #6b8e23;
    color: #2f4f2f;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
}

.filter-btn:hover,
.filter-btn.active {
    background: linear-gradient(135deg, #6b8e23, #556b2f);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(107, 142, 35, 0.25);
}

/* Gallery Grid */
.gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 3rem;
    justify-content: center;
}

.admin-link {
    margin-left: auto;
    align-self: center;
}

.gallery-item {
    flex: 0 0 300px;
    max-width: 300px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    opacity: 1;
    transform: scale(1);
}

.gallery-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-hover);
}

.gallery-item.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

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

.gallery-item-info {
    padding: 1.5rem;
}

.gallery-item-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.gallery-item-category {
    font-size: 0.9rem;
    color: var(--secondary-color);
    font-style: italic;
}

.gallery-item-number {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 0.5rem;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.lightbox.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    font-size: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(0, 0, 0, 0.9);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.3s ease;
}

.lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.9);
}

.lightbox-prev {
    left: 1rem;
}

.lightbox-next {
    right: 1rem;
}

#lightbox-image {
    max-width: 100%;
    max-height: 70vh;
    display: block;
    margin: 0 auto;
}

.lightbox-caption {
    padding: 1.5rem;
    background: white;
}

.lightbox-caption h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
}

.lightbox-caption p {
    margin: 0;
    color: var(--secondary-color);
    font-style: italic;
}

/* Loading Animation */
.gallery-loading {
    text-align: center;
    padding: 3rem;
    color: var(--secondary-color);
}

.gallery-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .gallery-filters {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-btn {
        width: 200px;
    }
    
    .lightbox-content {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .lightbox-close {
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-item img {
        height: 200px;
    }
    
    .lightbox-nav {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}

/* Print Styles */
@media print {
    .gallery-filters,
    .lightbox {
        display: none;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .gallery-item {
        break-inside: avoid;
    }
}
