/* Image fallback styles */
.image-fallback {
    opacity: 0.7;
    filter: grayscale(20%);
    transition: opacity 0.3s ease, filter 0.3s ease;
    position: relative;
}

.image-fallback:hover {
    opacity: 1;
    filter: grayscale(0%);
}

.image-fallback::after {
    content: "Image not available";
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-fallback:hover::after {
    opacity: 1;
}

/* Loading state for images */
img[data-fallback="true"] {
    transition: opacity 0.3s ease;
}

img[data-fallback="true"]:not([src*="placeholder-vehicle.svg"]) {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* Placeholder image styling */
img[src*="placeholder-vehicle.svg"] {
    background-color: #f8f9fa;
    border: 2px dashed #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Carousel specific styles */
.carousel-item img.image-fallback {
    object-fit: cover;
    min-height: 300px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .carousel-item img.image-fallback {
        min-height: 200px;
    }
}