
/* Optimized Image Loading Styles for The Naughty Rooster */

/* High-quality logo rendering */
.logo-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    filter: contrast(1.1) brightness(1.05);
    transition: all 0.3s ease;
}

/* Enhanced rooster mascot display */
.rooster-mascot-img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    filter: contrast(1.1) brightness(1.05) saturate(1.1);
    transition: all 0.3s ease;
}

/* Gallery image optimizations */
.gallery-item {
    overflow: hidden;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    image-rendering: -webkit-optimize-contrast;
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: brightness(0.95) contrast(1.05);
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.gallery-item:hover img {
    transform: scale(1.05);
    filter: brightness(1) contrast(1.1);
}

/* Progressive image loading with shimmer effect */
.gallery-item.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, transparent 37%, #f0f0f0 63%);
    background-size: 400% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    min-height: 250px;
}

.gallery-item.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #d4af37;
    border-top: 3px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 2;
}

.gallery-item.loaded {
    animation: fadeIn 0.5s ease-in-out;
}

.gallery-item.error {
    background: #f5f5f5;
    border: 2px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
}

.gallery-item.error::after {
    content: '📷 Image not available';
    color: #999;
    font-size: 14px;
    text-align: center;
}

/* Loading animations */
@keyframes shimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: -100% 50%; }
}

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

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

/* Ultra-Quality Event card icon optimizations */
.event-card-icon {
    width: 80px;
    height: 80px;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
    filter: contrast(1.15) brightness(1.05) drop-shadow(2px 2px 4px rgba(0,0,0,0.2));
    transition: all 0.3s ease;
}

.event-card:hover .event-card-icon {
    transform: scale(1.1) rotateY(5deg);
    filter: contrast(1.2) brightness(1.1) drop-shadow(3px 3px 6px rgba(0,0,0,0.3));
}

/* Hero background image optimizations */
.hero-bg-img {
    image-rendering: -webkit-optimize-contrast;
    filter: contrast(1.05) brightness(1.02);
}

/* Responsive image optimizations */
@media (max-width: 768px) {
    .gallery-item img {
        height: 200px;
    }
    
    .gallery-item.loading {
        min-height: 200px;
    }
    
    .rooster-mascot-img {
        max-width: 250px;
    }
}

/* WebP support detection and fallback */
.no-webp .gallery-item img[src$=".webp"] {
    content: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'><text>WebP not supported</text></svg>");
}

/* Preload critical images */
.critical-image {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Gallery filter animations */
.gallery-item {
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.gallery-item.filtered-out {
    opacity: 0;
    transform: scale(0.8);
    visibility: hidden;
}

.gallery-item.filtered-in {
    opacity: 1;
    transform: scale(1);
    visibility: visible;
}

/* Image modal optimizations */
.modal img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
}

/* Print optimizations */
@media print {
    .gallery-item img {
        image-rendering: -webkit-optimize-contrast;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    .gallery-item.loading {
        background: linear-gradient(90deg, #333 25%, transparent 37%, #333 63%);
    }
    
    .gallery-item.error {
        background: #2a2a2a;
        border-color: #555;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .gallery-item img,
    .gallery-item,
    .rooster-mascot-img,
    .logo-img,
    .event-card-icon {
        transition: none;
        animation: none;
    }
    
    .gallery-item.loading {
        animation: none;
        background: #f0f0f0;
    }
}

/* Performance hint for browser */
.gallery-item img,
.rooster-mascot-img,
.logo-img {
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}
