:root {
  --primary-color: #106eea;
  --secondary-color: #444444;
  --light-color: #f6f9fe;
  --dark-color: #0d0d0d;
}

/* OVERRIDE main.css hero styles */
.hero {
  background-size: cover;
  color: white;
  position: relative;
  overflow: hidden;
  height: 80vh !important;
  min-height: 600px !important;
  padding: 0 !important;
  display: block !important;
  align-items: normal !important;
}

.carousel {
  height: 100%;
}

.carousel-inner {
  height: 100%;
}

.carousel-item {
  height: 100%;
  position: relative;
}

.carousel-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 8s ease;
  opacity: 1; /* Make sure images are fully visible */
}

.carousel-item.active .carousel-image {
  transform: scale(1.05);
}

.carousel-indicators {
  bottom: 30px;
  z-index: 15;
  gap: 20px;
}

.carousel-indicators button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  border: none;
  margin: 0 5px;
  transition: all 0.3s ease;
}

.carousel-indicators button.active {
  background-color: var(--primary-color);
  transform: scale(1.2);
}

.carousel-indicators button:hover {
  background-color: rgba(255, 255, 255, 0.8);
}

.carousel-control-prev,
.carousel-control-next {
  width: 50px;
  height: 50px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 15;
}

.hero:hover .carousel-control-prev,
.hero:hover .carousel-control-next {
  opacity: 1;
}

.carousel-control-prev {
  left: 20px;
}

.carousel-control-next {
  right: 20px;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  background-size: 20px 20px;
}

/* Progress bar for auto-slide indication */
.carousel-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background-color: var(--primary-color);
  width: 0%;
  z-index: 15;
  transition: width 0.1s linear;
}

/* Loading animation */
.carousel-image::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    45deg,
    rgba(16, 110, 234, 0.1) 0%,
    transparent 50%,
    rgba(16, 110, 234, 0.1) 100%
  );
  opacity: 0;
  transition: opacity 0.5s ease;
}

.carousel-item.active .carousel-image::after {
  opacity: 1;
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    background-position: -100% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Mobile-First Responsive Design */
@media (max-width: 768px) {
  .hero {
    height: 250px !important;
        min-height: 250px !important;
        padding-top: 23px !important;
  }

  .carousel-control-prev,
  .carousel-control-next {
    width: 35px;
    height: 35px;
    opacity: 0.7; /* Always visible on mobile for better UX */
    background-color: rgba(255, 255, 255, 0.2);
  }

  .carousel-control-prev {
    left: 10px;
  }

  .carousel-control-next {
    right: 10px;
  }

  .carousel-control-prev-icon,
  .carousel-control-next-icon {
    background-size: 15px 15px;
  }

  .carousel-indicators {
    bottom: 15px;
    gap: 10px;
  }

  .carousel-indicators button {
    width: 8px;
    height: 8px;
    margin: 0 3px;
  }

  .carousel-indicators button.active {
    transform: scale(1.1);
  }

  .carousel-item.active .carousel-image {
    transform: scale(1.02); /* Less zoom on mobile for better performance */
  }

  /* Optimize animations for mobile */
  .carousel-image::after {
    animation: shimmer-mobile 4s ease-in-out infinite;
  }

  @keyframes shimmer-mobile {
    0% {
      background-position: -50% 0;
    }
    100% {
      background-position: 150% 0;
    }
  }
}

/* Extra Small Devices */
@media (max-width: 576px) {
  .hero {
    height: 250px !important;
        min-height: 250px !important;
        padding-top: 23px !important;
  }

  .carousel-control-prev,
  .carousel-control-next {
    width: 30px;
    height: 30px;
  }

  .carousel-control-prev-icon,
  .carousel-control-next-icon {
    background-size: 12px 12px;
  }

  .carousel-indicators {
    bottom: 10px;
  }

  .carousel-indicators button {
    width: 6px;
    height: 6px;
  }

  /* Reduce animation intensity for better performance */
  .carousel-item.active .carousel-image {
    transform: none;
    transition: transform 4s ease;
  }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 992px) {
  .hero {
    min-height: 500px !important;
  }
  
  .carousel-control-prev,
  .carousel-control-next {
    opacity: 0.5; /* Semi-visible on tablet by default */
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .carousel-control-prev,
  .carousel-control-next {
    opacity: 0.7 !important; /* Always visible on touch devices */
  }
  
  .hero:hover .carousel-control-prev,
  .hero:hover .carousel-control-next {
    opacity: 0.7 !important;
  }
}

.carousel-indicators [data-bs-target] {
    height: 10px;
    width: 10px;
}

/* Mobile-specific performance optimizations */
@media (max-width: 768px) {
  .carousel-image {
    /* Reduce animation complexity for better mobile performance */
    transition: transform 4s ease;
  }
  
  /* Prevent layout shifts */
  .hero {
    will-change: transform;
    contain: layout style paint;
  }
}