/* Gallery Container */
.ggallery-container {
    padding: 20px 0;
}

.ggallery-grid {
    column-count: auto;
    column-width: 300px;
    column-gap: 20px;
    margin-top: 30px;
}

/* Gallery Item */
.ggallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    break-inside: avoid;
    margin-bottom: 20px;
}

.ggallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.ggallery-item a {
    display: block;
    position: relative;
    text-decoration: none;
}

.ggallery-img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.ggallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ggallery-item:hover .ggallery-overlay {
    opacity: 1;
}

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

.ggallery-overlay i,
.ggallery-eye-icon {
    color: white;
    font-size: 32px;
    transform: scale(0);
    transition: transform 0.3s ease;
}

.ggallery-eye-icon {
    width: 32px;
    height: 32px;
    filter: brightness(0) invert(1);
}

.ggallery-item:hover .ggallery-overlay i,
.ggallery-item:hover .ggallery-eye-icon {
    transform: scale(1);
}

/* Loading State */
.gallery-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #666;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.upload-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #28a745;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1.5s linear infinite;
    margin: 0 auto 20px;
}

.gallery-loading small {
    display: block;
    margin-top: 10px;
    color: #999;
    font-style: italic;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* GLightbox Customization */
.glightbox-clean .gslide-description {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px;
    border-radius: 0 0 8px 8px;
}

.glightbox-clean .gslide-media {
    border-radius: 8px;
    overflow: hidden;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ggallery-item {
    animation: fadeIn 0.6s ease forwards;
}

.ggallery-item:nth-child(1) { animation-delay: 0.1s; }
.ggallery-item:nth-child(2) { animation-delay: 0.2s; }
.ggallery-item:nth-child(3) { animation-delay: 0.3s; }
.ggallery-item:nth-child(4) { animation-delay: 0.4s; }
.ggallery-item:nth-child(5) { animation-delay: 0.5s; }
.ggallery-item:nth-child(6) { animation-delay: 0.6s; }

/* Responsive Design */
@media (max-width: 768px) {
    .ggallery-grid {
        column-width: 250px;
        column-gap: 15px;
    }
    
    .ggallery-item {
        margin-bottom: 15px;
    }
    
    .ggallery-overlay i,
    .ggallery-eye-icon {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .ggallery-grid {
        column-count: 2;
        column-width: auto;
        column-gap: 10px;
    }
    
    .ggallery-item {
        margin-bottom: 10px;
    }
    
    .ggallery-overlay i,
    .ggallery-eye-icon {
        font-size: 24px;
    }
    
    .ggallery-eye-icon {
        width: 24px;
        height: 24px;
    }
}

/* Error State */
.ggallery-item[style*="display: none"] {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}


/* Smooth transitions for dynamic loading */
.ggallery-grid {
    transition: all 0.3s ease;
}

/* Accessibility improvements */
.ggallery-item a:focus {
    outline: 3px solid #007bff;
    outline-offset: 2px;
}

.ggallery-item a:focus .ggallery-overlay {
    opacity: 1;
}

.ggallery-item a:focus .ggallery-overlay i {
    transform: scale(1);
}
