


.gallery-header {
    background: linear-gradient(0deg, rgba(0,0,0,0.55), rgba(0,0,0,0.55)), url('../images/GalleryBanner.webp') center/cover no-repeat;
    color: white;
    padding: 8rem 0 4rem;
    margin-top: 70px;
    position: relative;
    overflow: hidden;
    min-height: 400px;
}

.gallery-header::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"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.gallery-header-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.gallery-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 120px;
}

.stat-item i {
    font-size: 2rem;
    opacity: 0.8;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}


.gallery-controls {
    background: var(--bg-secondary);
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 70px;
    z-index: 100;
}

.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.search-filter {
    flex: 1;
    max-width: 400px;
}

.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 3rem;
    border: 2px solid var(--border-light);
    border-radius: 25px;
    font-size: 1rem;
    background: var(--bg-card);
    transition: var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.clear-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.clear-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.view-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-tabs {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-card);
    padding: 0.5rem;
    border-radius: 20px;
    border: 1px solid var(--border-light);
}

.filter-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 15px;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-secondary);
    font-weight: 500;
}

.filter-tab:hover,
.filter-tab.active {
    background: var(--primary-color);
    color: white;
}

.filter-tab i {
    font-size: 0.9rem;
}

.view-mode {
    display: flex;
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.view-btn {
    background: transparent;
    border: none;
    padding: 0.8rem;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-secondary);
}

.view-btn:hover,
.view-btn.active {
    background: var(--primary-color);
    color: white;
}


.gallery-content {
    padding: 4rem 0;
    background: var(--bg-primary);
    min-height: 60vh;
}


.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.gallery-grid.masonry {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    grid-auto-rows: 20px;
    grid-auto-flow: dense;
}


.gallery-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    cursor: pointer;
    border: 1px solid var(--border-light);
}

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

.gallery-item-image {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.gallery-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
    border-radius: 0;
}

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

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    opacity: 0;
    transition: var(--transition-normal);
    display: flex;
    align-items: flex-end;
    padding: 1rem;
}

.gallery-item:hover .image-overlay {
    opacity: 1;
}

.overlay-content {
    color: white;
}

.overlay-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.overlay-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.overlay-stats span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

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

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

.gallery-item-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gallery-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.gallery-item-category {
    background: var(--bg-secondary);
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-weight: 500;
    color: var(--primary-color);
}

.gallery-item-stats {
    display: flex;
    gap: 1rem;
}

.gallery-item-stats span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}


.lightbox-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

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

.lightbox-overlay {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.lightbox-container {
    background: var(--bg-card);
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
    box-shadow: 0 0 0 1px var(--border-color), var(--shadow-xl);
    position: relative;
    overflow: hidden;
}

.lightbox-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-light);
    position: relative;
}

#close-lightbox {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    z-index: 2001;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition-fast);
}

#close-lightbox:hover {
    background: rgba(0, 0, 0, 1);
    transform: scale(1.1);
}

.lightbox-header h3 {
    margin: 0;
    color: var(--text-primary);
    flex: 1;
}

.lightbox-controls {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    justify-content: flex-end;
}

.control-btn {
    background: var(--bg-secondary);
    border: none;
    padding: 0.8rem;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-secondary);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: var(--primary-color);
    color: white;
}

.lightbox-content {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    padding: 1rem;
}

.image-container {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-container img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 0;
}

.image-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
}

.image-loading.show {
    display: block;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-light);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.nav-arrow:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.prev-arrow {
    left: 1rem;
}

.next-arrow {
    right: 1rem;
}

.lightbox-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-light);
}

.image-info {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.info-item i {
    color: var(--primary-color);
}

.image-description p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.lightbox-footer,
.image-info,
.image-description {
    display: none !important;
}


.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 15px;
    padding: 3rem 2rem;
    text-align: center;
    background: var(--bg-secondary);
    transition: var(--transition-fast);
    cursor: pointer;
    margin-bottom: 1.5rem;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(74, 144, 226, 0.05);
}

.upload-content i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.upload-content h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.upload-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.upload-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.preview-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 1;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-remove {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.preview-remove:hover {
    background: var(--accent-color);
}


.fab-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.fab {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
}


.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 2rem;
}


.load-more-section {
    text-align: center;
    margin-top: 2rem;
}

.load-more-section .btn {
    padding: 1rem 2rem;
    font-size: 1rem;
}


@media (max-width: 768px) {
    .gallery-stats {
        gap: 1rem;
    }
    
    .stat-item {
        padding: 1rem;
        min-width: 100px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .controls-row {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .view-controls {
        justify-content: center;
    }
    
    .filter-tabs {
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    
    .filter-tab {
        flex-shrink: 0;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .lightbox-container {
        margin: 0;
        max-width: 100vw;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }
    
    .lightbox-content {
        padding: 0.5rem;
    }

    .image-container img {
        max-height: 85vh;
        width: 100%;
        height: auto;
    }
    
    .lightbox-header {
        padding: 1rem;
    }
    
    .lightbox-footer {
        padding: 1rem;
    }
    
    .image-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .nav-arrow {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .prev-arrow {
        left: 0.5rem;
    }
    
    .next-arrow {
        right: 3rem;
    }
    
    .fab-container {
        bottom: 1rem;
        right: 1rem;
    }
    
    .fab {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .gallery-header {
        padding: 6rem 0 3rem;
    }
    
    .gallery-stats {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-item-image {
        height: 200px;
    }
    
    .lightbox-overlay {
        padding: 0.5rem;
    }
    
    .lightbox-header h3 {
        font-size: 1.1rem;
    }
    
    .lightbox-controls {
        gap: 0.3rem;
    }
    
    .control-btn {
        width: 36px;
        height: 36px;
        padding: 0.6rem;
    }
}


.gallery-item {
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.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 {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.gallery-item.animate {
    opacity: 1;
    transform: translateY(0);
}


@media print {
    .navbar,
    .gallery-controls,
    .footer,
    .fab-container {
        display: none;
    }
    
    .gallery-header {
        background: none;
        color: black;
        padding: 2rem 0;
        margin-top: 0;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .gallery-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}