/* Gallery Page Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
    padding-top: 80px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Page Hero Section */
.page-hero {
    background: linear-gradient(135deg, #2c5530 0%, #4a7c59 100%);
    padding: 6rem 0 4rem;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="40" r="1.5" fill="rgba(255,255,255,0.1)"/></svg>');
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.hero-overlay {
    position: relative;
    z-index: 2;
}

.page-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.page-hero p {
    font-size: 1.3rem;
    opacity: 0.9;
}

/* Gallery Filter */
.gallery-filter {
    background: white;
    padding: 2rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 80px;
    z-index: 100;
}

.filter-controls {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.8rem 1.5rem;
    background: white;
    color: #2c5530;
    border: 2px solid #2c5530;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    background: #2c5530;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(44, 85, 48, 0.3);
}

.filter-btn.active {
    background: linear-gradient(45deg, #2c5530, #4a7c59);
    color: white;
    box-shadow: 0 4px 15px rgba(44, 85, 48, 0.3);
}

/* Gallery Section */
.gallery-section {
    padding: 4rem 0;
    background: #f8f9fa;
    min-height: 70vh;
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 3rem 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #2c5530;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Gallery Stats */
.gallery-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 3rem;
    padding: 1.5rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #2c5530;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.gallery-item {
    position: relative;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    aspect-ratio: 4/3;
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.8) 100%);
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    opacity: 0;
    transition: all 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-info {
    color: white;
    width: 100%;
}

.gallery-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.gallery-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    opacity: 0.9;
}

.gallery-category {
    background: rgba(255, 107, 53, 0.8);
    padding: 0.2rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.gallery-date {
    font-size: 0.8rem;
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin-top: 2rem;
}

.load-more-btn {
    padding: 1rem 2rem;
    background: linear-gradient(45deg, #2c5530, #4a7c59);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(44, 85, 48, 0.3);
}

.load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.no-results h3 {
    color: #2c5530;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.no-results p {
    color: #666;
}

/* Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.lightbox-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    margin: 2% auto;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    animation: lightboxSlideIn 0.3s ease-out;
}

@keyframes lightboxSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
    z-index: 10;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background: #ff6b35;
    transform: scale(1.1);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
}

.nav-btn {
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: all;
}

.nav-btn:hover {
    background: #2c5530;
    transform: scale(1.1);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.lightbox-image {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
}

.lightbox-caption {
    padding: 2rem;
    background: white;
}

.lightbox-caption h3 {
    font-size: 1.5rem;
    color: #2c5530;
    margin-bottom: 1rem;
}

.lightbox-caption p {
    color: #666;
    margin-bottom: 0.5rem;
}

.lightbox-caption p:first-of-type {
    color: #ff6b35;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .page-hero {
        padding: 4rem 0 3rem;
    }
    
    .page-hero h1 {
        font-size: 2rem;
    }
    
    .page-hero p {
        font-size: 1.1rem;
    }
    
    .filter-controls {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.8rem;
        flex-shrink: 0;
    }
    
    .gallery-stats {
        gap: 1.5rem;
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .gallery-overlay {
        padding: 1rem;
    }
    
    .gallery-title {
        font-size: 1rem;
    }
    
    .lightbox-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .lightbox-caption {
        padding: 1rem;
    }
    
    .lightbox-caption h3 {
        font-size: 1.2rem;
    }
    
    .lightbox-nav {
        padding: 0 10px;
    }
    
    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .lightbox-close {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
        top: 10px;
        right: 10px;
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .gallery-stats {
        gap: 2rem;
    }
}

/* Animation for gallery items */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-item {
    animation: slideInUp 0.5s ease-out both;
}

.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; }

/* Masonry-like layout for varying heights */
@supports (display: grid) {
    .gallery-grid {
        grid-auto-rows: 250px;
    }
    
    .gallery-item:nth-child(5n+1) {
        grid-row-end: span 1;
    }
    
    .gallery-item:nth-child(5n+2) {
        grid-row-end: span 1;
    }
    
    .gallery-item:nth-child(5n+3) {
        grid-row-end: span 1;
    }
}