/**
 * DeMV Platform - Vehicle Card Image Fix
 * 
 * This stylesheet fixes the vehicle image display in car cards
 */

/* Fix for vehicle image container */
.vehicle-image-container {
  position: relative;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
  height: 220px !important; /* Fixed height */
  background-color: #121212;
}

/* Fix for vehicle image */
.vehicle-image {
  width: 100%;
  height: 100%;
  object-fit: cover !important; /* Ensure proper image scaling */
  object-position: center !important; /* Center the image */
  /* Removed transition for performance */
}

/* Ensure image covers the container properly */
.vehicle-image-container .vehicle-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Add a subtle gradient overlay to ensure text readability */
.vehicle-image-container::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 100%);
  z-index: 1;
}

/* Ensure badges are visible above the gradient */
.vehicle-image-container .badge {
  z-index: 2;
  position: relative;
}

/* Fix for image loading state */
.vehicle-image.loading {
  opacity: 0.6;
  filter: blur(5px);
}

/* Fix for image error state */
.vehicle-image.error {
  opacity: 0.8;
  filter: grayscale(100%);
}

/* Ensure image link covers the entire container */
.vehicle-image-link {
  display: block;
  width: 100%;
  height: 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .vehicle-image-container {
    height: 180px !important;
  }
}

@media (max-width: 480px) {
  .vehicle-image-container {
    height: 160px !important;
  }
}
