/* ===============================
   CAROUSEL STYLES (Modular)
============================== */

.carousel-container {
  /* Removed absolute positioning */
  position: relative; 
  /* Center it in normal flow */
  margin: 80px auto 40px auto; /* top, right, bottom, left */
  /* Adjust height so carousel has space */
  width: 90%; 
  height: 500px; /* or however tall you want */
  perspective: 1000px;
  z-index: 1;
  /* Removed: top, left, transform */
}

.carousel {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  animation: rotate-continuous 20s linear infinite;
}

/* Each figure is positioned at a different angle */
.carousel figure {
  display: block;
  position: absolute;
  width: 300px;
  height: 225px;
  /* Center each figure in container */
  left: calc(50% - 150px);
  top: calc(50% - 112.5px);
  opacity: 0.9;
  margin: 0;
  transition: transform 1s ease-in-out;
}

/* Overlay effect on hover */
.carousel figure::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0,255,255,0.2), rgba(0,0,0,0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 10px;
}

.carousel figure:hover::after {
  opacity: 1;
}

.carousel figure:hover img {
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.8), 0 0 40px rgba(0, 255, 255, 0.5);
  transform: scale(1.05);
  transition: all 0.3s ease-in-out;
}

.carousel figure img {
  width: 100%;
  height: 100%;
  border-radius: 15px;
  object-fit: cover;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  animation: border-glow 2s infinite alternate;
}

@keyframes border-glow {
  0% {
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.8);
  }
  100% {
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
  }
}

/* Continuous Rotation */
@keyframes rotate-continuous {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(360deg); }
}

/* Individual figure positioning */
.carousel figure:nth-child(1) { transform: rotateY(0deg) translateZ(400px); }
.carousel figure:nth-child(2) { transform: rotateY(60deg) translateZ(400px); }
.carousel figure:nth-child(3) { transform: rotateY(120deg) translateZ(400px); }
.carousel figure:nth-child(4) { transform: rotateY(180deg) translateZ(400px); }
.carousel figure:nth-child(5) { transform: rotateY(240deg) translateZ(400px); }
.carousel figure:nth-child(6) { transform: rotateY(300deg) translateZ(400px); }

/* Responsive adjustments */
@media only screen and (max-width: 768px) {
  .carousel figure {
    width: 250px;
    height: 187px;
    left: calc(50% - 125px);
    top: calc(50% - 93.5px);
  }
  .carousel figure:nth-child(1) { transform: rotateY(0deg) translateZ(250px); }
  .carousel figure:nth-child(2) { transform: rotateY(60deg) translateZ(250px); }
  .carousel figure:nth-child(3) { transform: rotateY(120deg) translateZ(250px); }
  .carousel figure:nth-child(4) { transform: rotateY(180deg) translateZ(250px); }
  .carousel figure:nth-child(5) { transform: rotateY(240deg) translateZ(250px); }
  .carousel figure:nth-child(6) { transform: rotateY(300deg) translateZ(250px); }
}

/* Mobile (480px) Adjustments */
@media only screen and (max-width: 480px) {
  .carousel-container {
    height: 300px; /* smaller container for phones */
  }
  .carousel figure {
    width: 200px;
    height: 150px;
    left: calc(50% - 100px);
    top: calc(50% - 75px);
  }
  .carousel figure:nth-child(1) { transform: rotateY(0deg) translateZ(180px); }
  .carousel figure:nth-child(2) { transform: rotateY(60deg) translateZ(180px); }
  .carousel figure:nth-child(3) { transform: rotateY(120deg) translateZ(180px); }
  .carousel figure:nth-child(4) { transform: rotateY(180deg) translateZ(180px); }
  .carousel figure:nth-child(5) { transform: rotateY(240deg) translateZ(180px); }
  .carousel figure:nth-child(6) { transform: rotateY(300deg) translateZ(180px); }
}