/* Image Thumbnail and Popup Styles */

/* Thumbnail hover effects */
.image-thumbnail {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.image-thumbnail:hover {
    border-color: #3b82f6;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Popup overlay */
#image-popup-overlay {
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Popup content */
#image-popup-overlay .relative {
    animation: slideIn 0.3s ease;
    max-width: 90vw;
    max-height: 90vh;
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
    to { 
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Close button */
#image-popup-overlay button {
    transition: all 0.2s ease;
}

#image-popup-overlay button:hover {
    transform: scale(1.1);
    background-color: rgba(0, 0, 0, 0.7);
}

/* Image in popup */
#image-popup-overlay img {
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Thumbnail grid styles for multiple images */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.image-grid-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.image-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

/* Loading state for thumbnails */
.image-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    #image-popup-overlay .relative {
        max-width: 95vw;
        max-height: 95vh;
        margin: 1rem;
    }
    
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.5rem;
    }
}
