/* --- Hero Slider --- */
.hero {
  position: relative;
  width: 100%;
  height: 85vh; /* เหมาะสมสำหรับ Desktop */
  min-height: 500px;
  overflow: hidden;
  background-color: #0f172a;
}

.hero-slide {
  position: absolute;
  width: 100%;
  height: 100%;
  background-size: cover; /* ขยายเต็มพื้นที่ */
  background-position: center center; /* จัดให้อยู่กึ่งกลาง */
  background-repeat: no-repeat;
  object-fit: cover; /* ปรับให้ภาพคงสัดส่วน */
  opacity: 0;
  animation: fadeSlide 25s infinite;
}

.hero-slide:nth-child(1) {
  background-image: url("hero/1.png");
  animation-delay: 0s;
}
.hero-slide:nth-child(2) {
  background-image: url("hero/2.png");
  animation-delay: 5s;
}
.hero-slide:nth-child(3) {
  background-image: url("hero/3.png");
  animation-delay: 10s;
}
.hero-slide:nth-child(4) {
  background-image: url("hero/4.png");
  animation-delay: 15s;
}
.hero-slide:nth-child(5) {
  background-image: url("hero/5.png");
  animation-delay: 20s;
}

@keyframes fadeSlide {
  0%,
  20% {
    opacity: 1;
  }
  25%,
  100% {
    opacity: 0;
  }
}

@media (max-width: 1024px) {
  .hero {
    height: 60vh;
    min-height: 400px;
  }
}

@media (max-width: 768px) {
  .hero {
    height: 50vh;
    min-height: 300px;
  }
  .hero-slide {
    background-size: cover; 
    background-position: top center; /* Prevents heads/text from being cut off on mobile */
  }
}

@media (max-width: 480px) {
  .hero {
    height: 40vh;
    min-height: 250px;
  }
  .hero-slide {
    background-size: cover;
    background-position: center center;
  }
}

/* --- ปุ่มลอยกลาง Hero (transparent + animation) --- */
.hero .hero-button {
  position: absolute;
  bottom: 25%; /* อยู่เหนือด้านล่าง 25% */
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.15); /* Glass effect */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 700;
  padding: 18px 32px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  opacity: 0; /* เริ่มจากโปร่งใส */
  animation: slideUpFade 1.5s ease-out forwards;
  z-index: 10;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ไอคอนในปุ่ม */
.hero .hero-button i {
  font-size: 1.5rem;
}

/* Hover effect */
.hero .hero-button:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

/* --- Animation --- */
@keyframes slideUpFade {
  0% {
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
  }
  100% {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .hero .hero-button {
    font-size: 1rem;
    padding: 12px 20px;
  }
}
