/* 
 * Sprout Advocates - Enhanced Hero Section Styles
 * Implements text animations, improved video handling, and interactive elements
 */

/* Hero Base Styles */
.hero {
  position: relative;
  height: 80vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

/* Video Background with Preloader */
.video-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
}

.video-background video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translateX(-50%) translateY(-50%);
  object-fit: cover;
}

.video-preloader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--primary-blue);
  z-index: 3;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease;
}

.video-preloader.loaded {
  opacity: 0;
  pointer-events: none;
}

.preloader-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-white);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Enhanced Overlay with Gradient */
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(26, 77, 128, 0.85) 0%,
    rgba(30, 102, 66, 0.85) 100%
  );
  z-index: 2;
}

/* Hero Content with Animations */
.hero-content {
  position: relative;
  z-index: 3;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

.hero h1 {
  color: var(--primary-white);
  margin-bottom: var(--spacing-md);
  font-size: 3rem;
  font-weight: 700;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(20px);
}

.hero p {
  color: var(--primary-white);
  font-size: 1.2rem;
  margin-bottom: var(--spacing-lg);
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(20px);
}

.hero-buttons {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
  opacity: 0;
  transform: translateY(20px);
}

/* Text Animation Classes */
.animate-fade-in {
  animation: fadeIn 1s ease forwards;
}

.animate-fade-in:nth-child(1) {
  animation-delay: 0.3s;
}

.animate-fade-in:nth-child(2) {
  animation-delay: 0.6s;
}

.animate-fade-in:nth-child(3) {
  animation-delay: 0.9s;
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  color: var(--primary-white);
  font-size: 2rem;
  cursor: pointer;
  animation: bounce 2s infinite;
  opacity: 0;
  transition: opacity 1s ease;
}

.scroll-indicator.visible {
  opacity: 1;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0) translateX(-50%);
  }
  40% {
    transform: translateY(-20px) translateX(-50%);
  }
  60% {
    transform: translateY(-10px) translateX(-50%);
  }
}

/* Featured Testimonial */
.hero-testimonial {
  position: absolute;
  bottom: 80px;
  right: 30px;
  max-width: 300px;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: var(--border-radius-md);
  padding: var(--spacing-md);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  z-index: 3;
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.5s ease;
}

.hero-testimonial.visible {
  opacity: 1;
  transform: translateX(0);
}

.hero-testimonial-text {
  font-style: italic;
  color: var(--dark-gray);
  font-size: 0.9rem;
  margin-bottom: var(--spacing-sm);
}

.hero-testimonial-author {
  font-weight: 600;
  color: var(--primary-blue);
  font-size: 0.8rem;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .hero {
    height: 70vh;
  }
  
  .hero h1 {
    font-size: 2.2rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .hero-buttons {
    flex-direction: column;
    gap: var(--spacing-sm);
  }
  
  .hero-testimonial {
    display: none;
  }
}

/* High-contrast Mode */
@media (forced-colors: active) {
  .hero-overlay {
    background: rgba(0, 0, 0, 0.7);
  }
  
  .hero h1,
  .hero p {
    color: white;
    text-shadow: none;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .animate-fade-in {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  
  .scroll-indicator {
    animation: none !important;
  }
}
