.hero {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

#hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  mix-blend-mode: screen;
}

.hero-slider {
  width: 100%;
  height: 100%;
  position: relative;
}

.hero-slide {
  position: absolute;
  width: 100%;
  height: 100%;
  display: block; /* Show all slides but with opacity 0 */
  opacity: 0;
  transition: opacity 1.2s ease-in-out,
    transform 1.2s cubic-bezier(0.165, 0.84, 0.44, 1);
  transform: scale(1.08);
  z-index: 1;
}

.hero-slide.active {
  opacity: 1;
  transform: scale(1);
  z-index: 2;
}

.hero-slide.prev {
  opacity: 0;
  transform: scale(0.95);
}

.hero-slide.next {
  opacity: 0;
  transform: scale(1.08);
}

.hero-bg {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background-position: center;
  background-size: cover;
  z-index: 1;
  transition: transform 8s ease-out;
  transform: scale(1.1);
}

.active .hero-bg {
  transform: scale(1); /* Subtle zoom effect on active slide */
}

.hero-mask {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(1px) brightness(0.65);
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.25) 0%,
    rgba(0, 0, 0, 0.15) 100%
  );
  z-index: 1;
  overflow: hidden;
}

/* Add beautiful particle effect to hero-mask */
.hero-mask::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background-image: radial-gradient(
      circle at 30% 20%,
      rgba(255, 255, 255, 0.05) 0%,
      transparent 8%
    ),
    radial-gradient(
      circle at 70% 60%,
      rgba(255, 255, 255, 0.05) 0%,
      transparent 12%
    ),
    radial-gradient(
      circle at 40% 80%,
      rgba(255, 255, 255, 0.05) 0%,
      transparent 10%
    ),
    radial-gradient(
      circle at 80% 10%,
      rgba(255, 255, 255, 0.08) 0%,
      transparent 8%
    ),
    radial-gradient(
      circle at 15% 60%,
      rgba(255, 255, 255, 0.08) 0%,
      transparent 6%
    ),
    radial-gradient(
      circle at 90% 90%,
      rgba(255, 255, 255, 0.05) 0%,
      transparent 14%
    );
  animation: particleMovement 60s infinite linear;
  pointer-events: none;
}

.hero-mask::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    125deg,
    rgba(42, 71, 89, 0.12) 0%,
    rgba(0, 0, 0, 0.1) 40%,
    rgba(0, 0, 0, 0.18) 70%
  );
  mix-blend-mode: overlay;
}

@keyframes particleMovement {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Enhanced active slide mask effect */
.active .hero-mask {
  backdrop-filter: blur(1px) brightness(0.68) contrast(1.05);
}

.hero-content {
  position: relative;
  z-index: 4; /* Increase z-index to be above canvas */
  width: 100%;
  height: 100%;
  padding: 0;
  padding-top: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero-content-left {
  position: relative;
  width: 50vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: var(--text-color-2);
  z-index: 5;
  overflow: hidden;
}

.hero-text {
  height: 240px;
  width: 100%;
  padding-left: 120px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out 0.3s, transform 0.8s ease-out 0.3s;
}

.active .hero-text {
  opacity: 1;
  transform: translateY(0);
}

.hero-title {
  position: relative;
  width: 100%;
  font-size: 3rem;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out 0.5s, transform 0.8s ease-out 0.5s;
}

.active .hero-title {
  opacity: 1;
  transform: translateY(0);
}

.hero-description {
  width: 100%;
  position: relative;
  font-size: 1.2rem;
  margin-bottom: 2rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out 0.7s, transform 0.8s ease-out 0.7s;
}

.active .hero-description {
  opacity: 1;
  transform: translateY(0);
}

.hero-buttons {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out 0.9s, transform 0.8s ease-out 0.9s;
}

.active .hero-buttons {
  opacity: 1;
  transform: translateY(0);
}

.hero-btn {
  position: relative;
  width: 160px;
  height: 50px;
  z-index: 6;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: auto;
  background-color: var(--primary-color);
  color: var(--text-color-2);
  text-decoration: none;
  border-radius: 12px;
  transition: 0.3s;
  overflow: hidden;
}

.hero-btn:before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: transform 0.6s;
  transform: skewX(-25deg);
}

.hero-btn:hover:before {
  transform: skewX(-25deg) translateX(200%);
}

.hero-btn:hover {
  background-color: var(--primary-color-2);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  transform: translateY(-3px);
}

.hero-image {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(10px) brightness(0.7);
}

/* Updated slider controls with modern design */
.hero-controls {
  position: absolute;
  width: calc(100% - 60px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 10; /* Keep controls on top */
  display: flex;
  justify-content: space-between;
  padding: 0 30px;
  pointer-events: none; /* Make the container pass through clicks */
}

.hero-prev,
.hero-next {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.4);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-color-2);
  font-size: 18px;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  pointer-events: auto; /* Allow clicks on buttons */
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.hero-prev:hover,
.hero-next:hover {
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.3);
  transform: translateY(-3px);
}

.hero-prev:active,
.hero-next:active {
  transform: scale(0.95);
}

.hero-prev i,
.hero-next i {
  transform: scale(1);
  transition: transform 0.3s ease;
}

.hero-prev:hover i,
.hero-next:hover i {
  transform: scale(1.2);
}

/* Add slider indicators */
.hero-indicators {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 10;
}

.hero-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
}

.hero-indicator.active {
  background: var(--primary-color);
  transform: scale(1.2);
}

@media (max-width: 1200px) {
  .hero-title {
    font-size: 2.5rem;
  }

  .hero-text {
    padding-left: 80px;
  }
}

@media (max-width: 992px) {
  .hero-content-left {
    width: 70vw;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .hero-description {
    font-size: 1.1rem;
  }

  .hero-text {
    height: auto;
    padding-left: 60px;
  }

  .hero-prev,
  .hero-next {
    width: 50px;
    height: 50px;
  }

  .consultation-content {
    flex-direction: column;
  }

  .consultation-text,
  .consultation-form {
    width: 100%;
  }

  /* Adjust particle effect for smaller screens */
  .hero-mask::before {
    animation-duration: 80s;
    background-size: 30% 30%;
  }
}

@media (max-width: 768px) {
  .hero {
    height: 100vh;
  }

  .hero-content {
    align-items: flex-start;
    padding-top: 120px;
  }

  .hero-content-left {
    width: 100%;
    height: 100%;
    justify-content: center;
    padding-bottom: 100px;
  }

  .hero-text {
    padding-left: 100px;
    padding-right: 100px;
    text-align: flex-start;
  }

  .hero-title {
    font-size: 2rem;
    width: 100%;
  }

  .hero-description {
    font-size: 1rem;
    width: 100%;
  }

  .hero-buttons {
    display: flex;
    justify-content: center;
    width: 100%;
  }

  .hero-btn {
    width: 140px;
    height: 45px;
  }

  .hero-controls {
    width: 100%;
    padding: 0 15px;
  }

  .hero-prev,
  .hero-next {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }
}

@media (max-width: 576px) {
  .hero {
    height: 100vh;
  }

  .hero-content {
    padding-top: 90px;
  }

  .hero-content-left {
    padding-bottom: 70px;
  }

  .hero-text {
    padding-left: 20px;
    padding-right: 20px;
  }

  .hero-title {
    font-size: 1.8rem;
    margin-bottom: 0.7rem;
  }

  .hero-description {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }

  .hero-btn {
    width: 130px;
    height: 40px;
    font-size: 0.9rem;
  }

  .hero-controls {
    top: auto;
    bottom: 20px;
    transform: none;
    justify-content: center;
    gap: 100px;
  }

  .hero-prev,
  .hero-next {
    width: 36px;
    height: 36px;
    font-size: 12px;
    opacity: 0.7;
  }

  /* Simplify particle effect for mobile */
  .hero-mask::before {
    opacity: 0.7;
  }
}

@media (max-height: 600px) and (min-width: 577px) {
  .hero-content {
    padding-top: 80px;
  }

  .hero-content-left {
    justify-content: flex-start;
    padding-top: 60px;
  }

  .hero-text {
    height: auto;
  }

  .hero-title {
    font-size: 1.8rem;
  }

  .hero-description {
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  .hero {
    height: auto;
    min-height: 100vh;
  }

  .hero-content {
    padding-top: 70px;
    padding-bottom: 30px;
  }

  .hero-content-left {
    height: auto;
    min-height: 100vh;
  }

  .hero-text {
    padding-top: 30px;
  }

  .hero-controls {
    bottom: 10px;
    top: auto;
    transform: none;
  }
}
