@import url('/styles/fonts.css');

.banner {
  width: 100%;
  height: 100vh;
  text-align: center;
  overflow: hidden;
  position: absolute;
}

.banner .slider {
  position: absolute;
  width: 200px;
  height: 200px;
  top: 30%;
  left: calc(50% - 5vw);
  transform-style: preserve-3d;
  transform: perspective(1000px) rotateX(-16deg);
  transform-origin: center center;
  transition: transform 0.1s ease-out;
  z-index: 2;
  cursor: grab;
  user-select: none;
}

/* Tablet */
@media screen and (max-width: 1023px) {
  .banner .slider {
    transform: perspective(800px) rotateX(-12deg);
  }
}

/* Mobile */
@media screen and (max-width: 767px) {
  .banner .slider {
    transform: perspective(600px) rotateX(-8deg);
  }
}

.banner .slider:active {
  cursor: grabbing;
}

/* Auto-run animation - will be controlled by JavaScript */
@keyframes autoRun {
  from {
    transform: perspective(1000px) rotateX(-16deg) rotateY(0deg);
  }
  to {
    transform: perspective(1000px) rotateX(-16deg) rotateY(360deg);
  }
}

/* Animation class that can be toggled */
.banner .slider.auto-rotate {
  animation: autoRun 20s linear infinite;
}

.banner .slider .item {
  position: absolute;
  inset: 0 0 0 0;
  /* MODIFIED: translateZ is now dynamic */
  transform: rotateY(
      calc((var(--position) - 1) * (360 / var(--quantity)) * 1deg)
    )
    translateZ(calc(200px + var(--quantity) * 1vw));
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 1rem;
  pointer-events: none;

  /* border: 1px solid white; */
}

.banner .slider .item img {
  width: clamp(80px, 10vw, 130px);
  /* FIXED: Increased max-height to make images taller while maintaining proportions */
  max-height: clamp(100px, 12vw, 160px);
  object-fit: contain; /* Changed from cover to contain to prevent cropping */
  border-radius: 10px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  pointer-events: auto;
  user-select: none;
  cursor: pointer;
  /* Add background color to fill any gaps if needed */
  background-color: rgba(255, 255, 255, 0.1);
}

.banner .slider .item img:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
}

.banner .slider .item .item-title {
  color: white;
  font-family: 'Press Start 2P', cursive;
  font-weight: 400;
  font-size: 1rem; /* Default for desktop */
  margin-top: 15px;
  pointer-events: none;
  user-select: none;
  text-align: center;
  width: 100%;
}

@media screen and (min-width: 2000px) {
  .banner .slider {
    width: 18vw;
    height: 20vw;
    left: calc(50% - 10vw);
    top: 40%; /* Added: pushes the slider lower */
    transform: perspective(1000px) rotateX(-16deg);
  }

  .banner .slider .item {
    transform: rotateY(
        calc((var(--position) - 1) * (360 / var(--quantity)) * 1deg)
      )
      translateZ(calc(150px + var(--quantity) * 1vw)) rotateX(10deg);
  }

  .banner .content h1 {
    font-size: 20em;
  }

  .banner .content .author {
    max-width: unset;
    width: 100%;
    text-align: center;
    padding: 0 30px;
  }
}

/* Tablet */
@media screen and (max-width: 1023px) {
  .banner .slider .item .item-title {
    font-size: 0.85rem;
  }
}

/* Mobile */
@media screen and (max-width: 639px) {
  .banner .slider .item .item-title {
    font-size: 0.7rem;
  }
}

.banner .content {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(1400px, 100vw);
  height: max-content;
  padding-bottom: 100px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  z-index: 1;
}

.banner .content h1 {
  font-family: 'ICA Rubrik';
  font-size: 16em;
  line-height: 1em;
  color: #25283b;
  position: relative;
}

.banner .content h1::after {
  position: absolute;
  inset: 0 0 0 0;
  content: attr(data-content);
  z-index: 2;
  -webkit-text-stroke: 2px #d2d2d2;
  color: transparent;
}

.banner .content .author {
  font-family: Poppins;
  text-align: right;
  max-width: 200px;
}

.banner .content h2 {
  font-size: 3em;
}

.banner .content .model {
  /* background-image: url(images/model.png); */
  width: 100%;
  height: 75vh;
  position: absolute;
  bottom: 0;
  left: 0;
  background-size: auto 130%;
  background-repeat: no-repeat;
  background-position: top center;
  z-index: 1;
}

/* Tablet and small desktop */
@media screen and (max-width: 1023px) {
  .banner .slider {
    width: 24vw;
    height: 24vw;
    left: calc(50% - 12vw);
    transform: perspective(1000px) rotateX(-16deg);
  }

  .banner .slider .item {
    /* MODIFIED: translateZ is now dynamic for tablets */
    transform: rotateY(
        calc((var(--position) - 1) * (360 / var(--quantity)) * 1deg)
      )
      translateZ(calc(200px + var(--quantity) * 1vw));
  }

  .banner .content h1 {
    text-align: center;
    width: 100%;
    text-shadow: 0 10px 20px #000;
    font-size: 7em;
  }

  .banner .content .author {
    color: #fff;
    padding: 20px;
    text-shadow: 0 10px 20px #000;
    z-index: 2;
    max-width: unset;
    width: 100%;
    text-align: center;
    padding: 0 30px;
  }
}

/* Mobile */
@media screen and (max-width: 767px) {
  .banner .slider {
    width: 40vw;
    height: 40vw;
    left: calc(50% - 20vw);
    transform: perspective(1000px) rotateX(-16deg);
  }

  .banner .slider .item {
    transform: rotateY(
        calc((var(--position) - 1) * (360 / var(--quantity)) * 1deg)
      )
      translateZ(calc(120px + var(--quantity) * 1vw)) scale(0.7); /* Scale down to 70% */
  }

  .banner .content h1 {
    font-size: 5em;
  }
}

/* Mini Devices (e.g., iPhone SE / Mini - ≤ 375px) */
@media screen and (max-width: 375px) {
  .banner .slider {
    width: 50vw;
    height: 50vw;
    left: calc(50% - 25vw);
    transform: perspective(1000px) rotateX(-10deg);
  }

  .banner .slider .item {
    transform: rotateY(
        calc((var(--position) - 1) * (360 / var(--quantity)) * 1deg)
      )
      translateZ(calc(100px + var(--quantity) * 0.8vw)) scale(0.6); /* Scale down to 60% */
  }

  .banner .content h1 {
    font-size: 3.5em;
  }

  .banner .slider .item .item-title {
    font-size: 0.6rem;
  }

  .floating-text {
    font-size: 2rem;
  }
}

#carousel {
  position: relative;
  margin-top: 5vh; /* move it higher */
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
  cursor: grab;
}

@media screen and (max-width: 1023px) {
  #carousel {
    margin-top: 8vh;
  }
}

/* Mobile */
@media screen and (max-width: 639px) {
  #carousel {
    margin-top: 10vh;
  }
}

.floating-text-container {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
}

.floating-text {
  color: white;
  font-size: 1.5rem;
  font-family: 'Press Start 2P', cursive;
  white-space: nowrap;
  margin-left: -2px;
  pointer-events: none;
  text-shadow:
    0 2px 5px rgba(0, 0, 0, 0.7),
    0 0 15px #00ffff;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0); /* Only vertical movement */
  }
  50% {
    transform: translateY(-10px);
  }
}

@media (min-width: 245px) and (max-width: 550px) {
  .floating-text-container {
    top: 50px; /* 20px + 40px down */
  }
}

@media (min-width: 0px) and (max-width: 244px) {
  .floating-text-container {
    top: 70px; /* 20px + 40px down */
  }
}