/**
 * Image Helper Styles for Recipe Platform
 * Handles placeholder images and loading states
 */

/* Recipe image containers */
.recipe-image,
.recipe-thumb,
.card-img-top {
    transition: opacity 0.3s ease;
}

/* Recipe card specific image styling */
.recipe-card .card-img-top {
    height: 200px;
    object-fit: cover;
    width: 100%;
}

/* Index page recipe cards */
.recipe-card {
    transition: all 0.3s ease;
    border: 1px solid #dee2e6;
}

/* Removed hover effect per user request */

/* Loading state for images */
.recipe-image.loading {
    opacity: 0.7;
    background: linear-gradient(90deg, #f0f0f0 25%, transparent 37%, #f0f0f0 63%);
    background-size: 400% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

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

/* Placeholder styling */
.recipe-placeholder,
.recipe-thumb-placeholder {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #dee2e6;
    min-height: 200px;
    transition: all 0.3s ease;
}

.recipe-placeholder:hover,
.recipe-thumb-placeholder:hover {
    border-color: #adb5bd;
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

/* Avatar styling */
.user-avatar,
.user-avatar-tiny,
.user-avatar-small {
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.user-avatar:hover,
.user-avatar-small:hover {
    transform: scale(1.05);
}

/* Default avatar fallback */
.avatar-fallback {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Responsive image sizing */
.recipe-image {
    height: 200px;
    object-fit: cover;
    width: 100%;
}

.recipe-thumb {
    height: 80px;
    object-fit: cover;
    width: 100%;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .recipe-image {
        height: 180px;
    }
    
    .recipe-thumb {
        height: 60px;
    }
}

/* Image error state */
.image-error {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.image-error::before {
    content: '🖼️';
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
    width: 100%;
    text-align: center;
}

/* Lazy loading placeholder */
.image-lazy {
    background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 75%, #f0f0f0 75%, #f0f0f0),
                linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 75%, #f0f0f0 75%, #f0f0f0);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    animation: checkerboard 2s linear infinite;
}

@keyframes checkerboard {
    0% {
        background-position: 0 0, 10px 10px;
    }
    100% {
        background-position: 20px 20px, 30px 30px;
    }
}