/* ===================================
   GALLERY SECTION STYLES
   =================================== */

.gallery-section {
    padding: 4rem 2rem;
    background: #f8f9fa;
    min-height: 60vh;
}

/* Gallery Stats Bar */
.gallery-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.stat-item {
    background: white;
    padding: 1rem 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
    min-width: 100px;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #F6AD55;
    margin-bottom: 0.3rem;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #718096;
}

/* Gallery Search */
.gallery-search {
    max-width: 500px;
    margin: 2rem auto;
}

.gallery-search input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
}

.gallery-search input:focus {
    outline: none;
    border-color: #F6AD55;
    box-shadow: 0 0 0 3px rgba(246,173,85,0.1);
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 0;
    gap: 1rem;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #F6AD55;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* No Results Message */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: #718096;
    font-size: 1.2rem;
}

/* Load More Container */
.load-more-container {
    text-align: center;
    margin-top: 3rem;
    padding: 2rem 0;
}

/* Admin Upload Section */
.admin-upload-section {
    background: #fff;
    padding: 3rem 2rem;
    margin-top: 2rem;
    border-top: 3px solid #F6AD55;
}

.admin-upload-section .container {
    max-width: 800px;
    margin: 0 auto;
}

.admin-upload-section h3 {
    color: #2D3748;
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2D3748;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #F6AD55;
}

/* Delete Button in Gallery Overlay */
.delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.delete-btn:hover {
    background: rgba(255, 0, 0, 1);
}

/* Lightbox Meta Info */
.lightbox-info {
    text-align: center;
    padding: 1rem 0;
}

.lightbox-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    color: #ccc;
    font-size: 0.9rem;
}

.lightbox-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gallery-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Gallery Filter Buttons */
.gallery-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
}

.gallery-filter-btn {
    padding: 0.8rem 1.5rem;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: #4A5568;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-filter-btn:hover {
    border-color: #F6AD55;
    color: #F6AD55;
    transform: translateY(-2px);
}

.gallery-filter-btn.active {
    background: linear-gradient(135deg, #F6AD55, #ED8936);
    color: white;
    border-color: #ED8936;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 300px;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Gallery Overlay */
.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 1.5rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-overlay h3 {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}

.gallery-overlay p {
    color: #F6AD55;
    font-size: 0.9rem;
}

/* Hidden items for filtering */
.gallery-item.hidden {
    display: none;
}

/* Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    z-index: 10000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    overflow: auto;
}

.lightbox.active {
    display: block;
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    animation: zoom 0.3s ease;
}

@keyframes zoom {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #f1f1f1;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #F6AD55;
}

.lightbox-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 20px 0;
    font-size: 1.2rem;
}

/* Lightbox Navigation */
.lightbox-prev,
.lightbox-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 30px;
    transition: 0.3s;
    background-color: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 5px;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background-color: #F6AD55;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .gallery-item {
        height: 250px;
    }
    
    .gallery-filter {
        gap: 0.5rem;
    }
    
    .gallery-filter-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .lightbox-content {
        max-width: 95%;
    }
    
    .lightbox-prev,
    .lightbox-next {
        font-size: 20px;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .gallery-section {
        padding: 3rem 1rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-item {
        height: 200px;
    }
}