/* Оптимизация изображений */

/* Lazy loading стили */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

img.lazy-loaded {
    opacity: 1;
}

/* Оптимизация размеров изображений */
img {
    max-width: 100%;
    height: auto;
}

/* Предотвращение layout shift */
.image-container {
    position: relative;
    overflow: hidden;
    background-color: #f8f9fa;
}

.image-container::before {
    content: "";
    display: block;
    padding-bottom: 66.67%; /* Соотношение 3:2 */
}

.image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Оптимизация для постеров событий */
.event-poster {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #f8f9fa;
}

/* Оптимизация для аватаров */
.avatar {
    object-fit: cover !important;
    background-color: #f8f9fa;
    /* Размеры определены в style.css */
}

/* Оптимизация для логотипов клубов */
.club-logo {
    max-width: 100px;
    max-height: 100px;
    object-fit: contain;
}

/* Responsive images */
@media (max-width: 768px) {
    .event-poster {
        height: 150px;
    }
    
    .club-logo {
        max-width: 80px;
        max-height: 80px;
    }
}

/* Оптимизация галерей */
.gallery-thumbnail {
    width: 150px;
    height: 150px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.gallery-thumbnail:hover {
    transform: scale(1.05);
}

/* Placeholder для загрузки */
.image-placeholder {
    background: linear-gradient(90deg, #f8f9fa 25%, #e9ecef 50%, #f8f9fa 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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