/* Article Image Carousel Styles */
.article-images-carousel {
  background: #f8f9fa;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  width: 350px;
  max-width: 40%;
}

.article-carousel-image {
  height: 250px;
  object-fit: contain;
  object-position: center;
  background: #fff;
  border-radius: 10px;
}

/* Ensure all carousel images in article detail have rounded corners */
.article-images-carousel .carousel-item img,
.article-images-carousel img {
  border-radius: 10px;
}

/* Thumbnail-based carousel indicators */
.carousel-thumbnails {
  margin-left: 0 !important;
  margin-right: 0 !important;
  margin-bottom: 0;
  justify-content: flex-start;
  position: static;
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.25rem 0;
  scrollbar-width: thin;
  scrollbar-color: #ccc transparent;
  scroll-behavior: smooth;
}

/* Webkit scrollbar styling for thumbnails */
.carousel-thumbnails::-webkit-scrollbar {
  height: 6px;
}

.carousel-thumbnails::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
}

.carousel-thumbnails::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
}

.carousel-thumbnails::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.5);
}

.carousel-thumbnails .thumbnail-indicator {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.8);
  background: none;
  padding: 0;
  opacity: 0.7;
  transition: opacity 0.2s ease, border-color 0.2s ease;
  position: relative;
  flex: 0 0 auto;
  min-width: 60px;
}

.carousel-thumbnails .thumbnail-indicator:hover {
  opacity: 0.9;
  border-color: rgba(255, 255, 255, 0.9);
}

.carousel-thumbnails .thumbnail-indicator.active {
  opacity: 1;
  border-color: #2563eb;
  border-width: 3px;
}

.carousel-thumbnails .thumbnail-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Responsive thumbnail sizing */
@media (min-width: 1200px) {
  .carousel-thumbnails .thumbnail-indicator {
    width: 70px;
    height: 70px;
    min-width: 70px;
  }

  .article-images-carousel {
    width: 400px;
    max-width: 35%;
  }

  .article-carousel-image {
    height: 300px;
  }
}

@media (max-width: 1199.98px) and (min-width: 992px) {
  .carousel-thumbnails .thumbnail-indicator {
    width: 55px;
    height: 55px;
    min-width: 55px;
  }

  .article-images-carousel {
    width: 320px;
    max-width: 45%;
  }

  .article-carousel-image {
    height: 220px;
  }
}

/* Fallback for old-style indicators (if needed) */
.carousel-indicators:not(.carousel-thumbnails) [data-bs-target] {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.9);
}

.carousel-indicators:not(.carousel-thumbnails) .active {
  background-color: #2563eb;
}

.carousel-caption {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  border-radius: 0 0 12px 12px;
  padding: 1rem;
  margin-bottom: 0;
}

.carousel-caption p {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
}

.no-images {
  border: 2px dashed #dee2e6;
  border-radius: 12px;
  background: #f8f9fa;
}

.no-images i {
  color: #adb5bd;
  margin-bottom: 0.5rem;
}
