.carousel-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin: 35px 0;
  z-index: 1;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
  position: relative;
  z-index: 2;
}

.carousel-item {
  flex: 0 0 350px;
  margin: 0 12px;
  position: relative;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-color);
  z-index: 3;
}

.carousel-item img,
.carousel-item video {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  box-shadow: 0 3px 8px var(--card-shadow);
  margin: 0;
  position: relative;
  z-index: 4;
}

.carousel-item img {
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.carousel-item img:hover {
  transform: scale(1.05);
}

.carousel-item video {
  object-fit: contain;
  background-color: black;
  cursor: pointer;
}

.carousel-item .video-container {
  width: 100%;
  height: 100%;
  margin: 0;
  background-color: black;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  z-index: 4;
}

.carousel-item .video-container iframe {
  width: 100%;
  height: 100%;
  border-radius: 12px;
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  padding: 0;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #1a1a1a;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  opacity: 0;
  z-index: 10;
  transition: opacity 0.25s ease, background 0.2s ease, transform 0.15s ease;
}

.carousel-container:hover .carousel-nav,
.carousel-nav:focus-visible {
  opacity: 1;
}

.carousel-nav:hover {
  background: rgba(255, 255, 255, 0.95);
}

.carousel-nav:active {
  transform: translateY(-50%) scale(0.9);
}

.carousel-nav svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.carousel-prev {
  left: 16px;
}

.carousel-next {
  right: 16px;
}

.dark-mode .carousel-nav {
  color: #fff;
  background: rgba(30, 30, 30, 0.6);
}

.dark-mode .carousel-nav:hover {
  background: rgba(20, 20, 20, 0.9);
}

/* On touch devices there is no hover, so keep the arrows visible */
@media (hover: none) {
  .carousel-nav {
    opacity: 1;
  }
}

/* Carousel videos act as click-to-open thumbnails with a play badge */
.carousel-item:has(video)::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 56px;
  height: 56px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55) url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23fff"><path d="M8 5v14l11-7z"/></svg>') center / 22px no-repeat;
  pointer-events: none;
  z-index: 6;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.carousel-item:has(video):hover::after {
  transform: translate(-50%, -50%) scale(1.08);
  background-color: rgba(0, 0, 0, 0.7);
}

.carousel-fade-left,
.carousel-fade-right {
  position: absolute;
  top: 0;
  width: 100px;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.carousel-fade-left {
  left: 0;
  background: linear-gradient(to right, var(--bg-color) 0%, transparent 100%);
}

.carousel-fade-right {
  right: 0;
  background: linear-gradient(to left, var(--bg-color) 0%, transparent 100%);
}

@media (max-width: 768px) {
  .carousel-item {
    flex: 0 0 300px;
    height: 220px;
  }
}

@media (max-width: 480px) {
  .carousel-item {
    flex: 0 0 240px;
    height: 180px;
  }
} 