/**
 * Image Gallery Styles
 * Styles for the admin image gallery with lazy loading
 */

/* Gallery card hover effects */
.gallery-image-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: 1px solid #e0e0e0;
}

.gallery-image-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2) !important;
}

/* Lazy loading image states */
.lazy-image {
    background-color: #f0f0f0;
    background-image: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

.lazy-image.loaded {
    background-image: none;
    animation: none;
}

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

/* Gallery controls */
#imageGallerySection .btn-group {
    flex-wrap: wrap;
    gap: 0.5rem;
}

#imageGallerySection .btn-group .btn {
    border-radius: 0.25rem;
}

/* Image count text */
#galleryImageCount {
    font-size: 0.9rem;
    color: #6c757d;
}

/* Load more button */
#loadMoreImagesBtn {
    min-width: 200px;
    font-weight: 600;
}

/* Loading spinner */
#galleryLoading {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Image overlay effects */
.gallery-image-card .position-absolute.bottom-0 {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.gallery-image-card:hover .position-absolute.bottom-0 {
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #imageGallerySection .btn-group {
        width: 100%;
    }

    #imageGallerySection .btn-group .btn {
        flex: 1;
        font-size: 0.85rem;
    }

    .col-md-6.text-end {
        text-align: left !important;
        margin-top: 1rem;
    }
}

/* Admin-only button styling */
.admin-only-element .btn-light {
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}

.admin-only-element .btn-light:hover {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

/* Smooth scroll for section transitions */
#imageGallerySection {
    scroll-margin-top: 70px;
}

/* SweetAlert2 image modal customization */
.swal2-image {
    max-height: 70vh;
    object-fit: contain;
}

/* Gallery grid spacing */
#imageGalleryGrid {
    min-height: 200px;
}

#imageGalleryGrid:empty::before {
    content: "No images found";
    display: block;
    text-align: center;
    color: #6c757d;
    padding: 4rem;
    font-size: 1.2rem;
}

/* Material Icons alignment in buttons */
.material-icons {
    font-size: inherit;
    vertical-align: middle;
    margin-right: 0.25rem;
}

/* Filter button active state */
#imageGallerySection .btn-outline-primary.active {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

/* Card image container */
.gallery-image-card .position-relative {
    border-bottom: 1px solid #e0e0e0;
}

/* Ensure images cover the container properly */
.gallery-image-card img {
    transition: transform 0.3s ease-in-out;
}

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