/* Image Optimization and Performance Styles */

/* Note: loading="lazy" should be set as HTML attribute, not CSS */
/* Example: <img src="image.jpg" loading="lazy" alt="description"> */

/* Image Placeholder Styles */
.image-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    min-height: 100px;
    border-radius: 0.5rem;
}

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

/* Optimized Image Container */
.optimized-image {
    position: relative;
    overflow: hidden;
    background: #f3f4f6;
    border-radius: 0.5rem;
}

.optimized-image img {
    transition: opacity 0.3s ease;
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.optimized-image img.loaded {
    opacity: 1;
}

.optimized-image img.loading {
    opacity: 0;
}

/* Responsive Images */
.responsive-image {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Performance Optimizations */
.menu-item-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 0.5rem;
    background: #f3f4f6;
    transition: transform 0.2s ease;
}

.menu-item-image:hover {
    transform: scale(1.05);
}

/* Thumbnail Styles */
.thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 0.25rem;
}

/* Critical Image Loading - Note: loading and priority are HTML attributes */
.critical-image {
    /* loading: eager; */ /* Set via HTML attribute */
    /* priority: high; */ /* Set via HTML attribute */
}

/* WebP Support */
@supports (format('webp')) {
    .webp-image {
        background-image: url('image.webp');
    }
}

/* Image Compression Hints */
.compressed-image {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Preload Critical Images */
.preload-critical {
    content: url('../images/kerala-meals.jpg');
}

/* Memory Management */
.image-container {
    contain: layout style paint;
}

/* Smooth Loading */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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