/* N8 Casino Image Optimization Styles */

/* Base image styles */
img {
    max-width: 100%;
    height: auto;
    display: block;
    /* Optimize image rendering */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    /* Enable hardware acceleration */
    transform: translateZ(0);
    will-change: transform;
}

/* Responsive image containers */
.image-container {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
}

/* Picture element optimization */
picture {
    display: block;
    width: 100%;
}

picture img {
    width: 100%;
    height: auto;
    transition: opacity 0.3s ease;
}

/* Lazy loading states */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Loading placeholder */
.image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
    z-index: 1;
}

/* Shimmer animation */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Image loading states */
.image-loading {
    opacity: 0;
}

.image-loaded {
    opacity: 1;
}

.image-container-loaded .image-placeholder {
    display: none;
}

/* Responsive image sizing */
.responsive-image {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Logo specific styles */
.logo img {
    height: 60px;
    width: auto;
    max-width: 200px;
}

/* Hero image styles */
.hero-image {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Feature image styles */
.feature-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
}

/* Team image styles */
.team-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 50%;
    max-width: 300px;
    margin: 0 auto;
}

/* Error state for failed images */
.image-error {
    background: #ffebee;
    color: #c62828;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    font-size: 14px;
}

/* High DPI display optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .high-dpi-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Print styles */
@media print {
    img {
        max-width: 100% !important;
        height: auto !important;
        page-break-inside: avoid;
    }
    
    .image-placeholder {
        display: none !important;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .image-placeholder {
        animation: none;
    }
    
    img {
        transition: none;
    }
}

/* Dark mode image adjustments */
@media (prefers-color-scheme: dark) {
    .image-placeholder {
        background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
        color: #ccc;
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .logo img {
        height: 50px;
    }
    
    .hero-image {
        max-width: 100%;
        margin: 0 auto;
    }
    
    .feature-image {
        height: 150px;
    }
}

@media (max-width: 480px) {
    .logo img {
        height: 40px;
    }
    
    .feature-image {
        height: 120px;
    }
    
    .team-image {
        height: 200px;
        max-width: 200px;
    }
}
