/* ===== Enhanced YouTube Section Intro Animations ===== */

/* Base section styling */
.cinematic-about {
  position: relative;
  overflow: hidden;
}

/* Animation elements - initial hidden state with enhanced effects */
.youtube-intro-video,
.youtube-intro-title,
.youtube-intro-text,
.youtube-intro-button {
  opacity: 0;
  visibility: hidden;
  transition: all 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform, opacity, filter;
}

/* Video container specific initial state - slide up with scale and blur */
.youtube-intro-video {
  transform: translateY(60px) translateX(-20px) scale(0.9);
  filter: blur(4px) brightness(0.8);
  transition-duration: 1.4s;
}

/* Title specific initial state - slide from right with rotation */
.youtube-intro-title {
  transform: translateY(40px) translateX(30px) rotate(2deg);
  filter: blur(1px);
  transition-duration: 1.3s;
}

/* Text specific initial state - slide up with fade */
.youtube-intro-text {
  transform: translateY(35px) scale(0.95);
  filter: blur(1px);
  transition-duration: 1.2s;
}

/* Button specific initial state - slide up with scale and glow effect */
.youtube-intro-button {
  transform: translateY(25px) scale(0.85);
  filter: blur(1px) brightness(0.7);
  transition-duration: 1.1s;
}

/* Enhanced animated states when visible */
.youtube-intro-video.animate-in {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) translateX(0) scale(1);
  filter: blur(0px) brightness(1);
  transition-delay: 0.2s;
}

.youtube-intro-title.animate-in {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) translateX(0) rotate(0deg);
  filter: blur(0px);
  transition-delay: 0.6s;
}

.youtube-intro-text.animate-in {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  filter: blur(0px);
  transition-delay: 1s;
}

.youtube-intro-button.animate-in {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  filter: blur(0px) brightness(1);
  transition-delay: 1.4s;
}

/* Staggered character animation for title (optional enhancement) */
.youtube-intro-title.animate-in {
  animation: titleGlow 2s ease-out 0.6s both;
}

@keyframes titleGlow {
  0% { text-shadow: none; }
  50% { text-shadow: 0 0 20px rgba(74, 144, 226, 0.3); }
  100% { text-shadow: none; }
}

/* Modern button styling - improved blue design with stronger specificity */
.about-section-enhanced .btn-modern-blue,
.btn-modern-blue {
  background: linear-gradient(135deg, #4A90E2 0%, #357ABD 50%, #2E5984 100%) !important;
  border: 2px solid transparent !important;
  color: white !important;
  padding: 14px 32px !important;
  border-radius: 50px !important;
  font-weight: 600 !important;
  font-size: 1rem !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  position: relative !important;
  overflow: hidden !important;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 4px 20px rgba(74, 144, 226, 0.3) !important;
  text-transform: none !important;
  letter-spacing: 0.5px !important;
  min-width: 160px !important;
  vertical-align: middle !important;
  line-height: 1.2 !important;
  /* Additional centering properties */
  flex-direction: row !important;
  gap: 8px !important;
}

/* Button hover effects */
.about-section-enhanced .btn-modern-blue:hover,
.btn-modern-blue:hover {
  background: linear-gradient(135deg, #5BA0F2 0%, #4A90E2 50%, #357ABD 100%) !important;
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 30px rgba(74, 144, 226, 0.4) !important;
  color: white !important;
  text-decoration: none !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

.btn-modern-blue:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
}

.btn-modern-blue:focus {
  outline: none;
  box-shadow: 0 4px 20px rgba(74, 144, 226, 0.3), 0 0 0 3px rgba(74, 144, 226, 0.2);
}

/* Button shimmer effect */
.btn-modern-blue::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s ease;
}

.btn-modern-blue:hover::before {
  left: 100%;
}

/* Button icon spacing and alignment */
.about-section-enhanced .btn-modern-blue i,
.btn-modern-blue i {
  margin-left: 0 !important;
  transition: transform 0.3s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  vertical-align: middle !important;
  line-height: 1 !important;
}

.about-section-enhanced .btn-modern-blue:hover i,
.btn-modern-blue:hover i {
  transform: translateX(3px) !important;
}

/* Ensure button content wrapper is centered */
.about-section-enhanced .btn-modern-blue > *,
.btn-modern-blue > * {
  display: inline-flex !important;
  align-items: center !important;
  vertical-align: middle !important;
}

/* Video container enhanced styling */
.video-container-modern {
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-container-modern:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

.video-container-modern .ratio {
  border-radius: 16px;
  overflow: hidden;
}

.video-container-modern iframe {
  border-radius: 16px;
  transition: transform 0.3s ease;
}

/* Enhanced text styling */
.youtube-intro-title {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.youtube-intro-text {
  color: #5a6c7d;
  line-height: 1.7;
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

/* Enhanced responsive adjustments */
@media (max-width: 768px) {
  /* Mobile-optimized initial states with gentler animations */
  .youtube-intro-video {
    transform: translateY(40px) scale(0.95);
    filter: blur(2px) brightness(0.9);
    transition-duration: 1.2s;
  }
  
  .youtube-intro-title {
    transform: translateY(30px) translateX(15px);
    filter: blur(0.5px);
    transition-duration: 1.1s;
  }
  
  .youtube-intro-text {
    transform: translateY(25px) scale(0.98);
    filter: blur(0.5px);
    transition-duration: 1s;
  }
  
  .youtube-intro-button {
    transform: translateY(20px) scale(0.9);
    filter: blur(0.5px) brightness(0.8);
    transition-duration: 0.9s;
  }
  
  /* Mobile animated states with adjusted delays */
  .youtube-intro-video.animate-in {
    transition-delay: 0.1s;
  }
  
  .youtube-intro-title.animate-in {
    transition-delay: 0.4s;
  }
  
  .youtube-intro-text.animate-in {
    transition-delay: 0.7s;
  }
  
  .youtube-intro-button.animate-in {
    transition-delay: 1s;
  }
  
  .about-section-enhanced .btn-modern-blue,
  .btn-modern-blue {
    padding: 12px 28px !important;
    font-size: 0.95rem !important;
    min-width: 140px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 8px !important;
  }
  
  .youtube-intro-text {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }
  
  /* Mobile: center align text */
  .cinematic-about .about-text-content {
    text-align: center !important;
  }
  
  .cinematic-about .about-text-content h2 {
    text-align: center !important;
  }
  
  .cinematic-about .about-text-content p {
    text-align: center !important;
  }
}

@media (max-width: 576px) {
  .about-section-enhanced .btn-modern-blue,
  .btn-modern-blue {
    padding: 10px 24px !important;
    font-size: 0.9rem !important;
    min-width: 120px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 6px !important;
  }
  
  .youtube-intro-title {
    font-size: 1.5rem;
  }
  
  .youtube-intro-text {
    font-size: 0.95rem;
  }
}

/* Performance optimizations */
.youtube-intro-video,
.youtube-intro-title,
.youtube-intro-text,
.youtube-intro-button {
  backface-visibility: hidden;
  perspective: 1000px;
  transform-style: preserve-3d;
}

/* Intersection observer trigger zone */
.cinematic-about {
  scroll-margin-top: 100px;
}

/* Enhanced hover effects for interactive elements */
.youtube-intro-button:hover {
  transform: translateY(-2px) scale(1.02);
  transition-duration: 0.3s;
}

.video-container-modern:hover {
  transform: translateY(-3px) scale(1.01);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .youtube-intro-video,
  .youtube-intro-title,
  .youtube-intro-text,
  .youtube-intro-button {
    transition: opacity 0.3s ease;
    transform: none !important;
    filter: none !important;
    will-change: auto;
  }
  
  .youtube-intro-video.animate-in,
  .youtube-intro-title.animate-in,
  .youtube-intro-text.animate-in,
  .youtube-intro-button.animate-in {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
  }
  
  .btn-modern-blue {
    transition: none;
  }
  
  .btn-modern-blue::before {
    display: none;
  }
  
  @keyframes titleGlow {
    0%, 100% { text-shadow: none; }
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .btn-modern-blue {
    background: #0066cc;
    border: 2px solid #ffffff;
  }
  
  .btn-modern-blue:hover {
    background: #0052a3;
  }
}

/* Focus visible for better accessibility */
.btn-modern-blue:focus-visible {
  outline: 3px solid #4A90E2;
  outline-offset: 2px;
}

/* Loading state for video */
.video-container-modern.loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

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

/* Section background enhancements */
.cinematic-about::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, rgba(74, 144, 226, 0.02) 0%, rgba(74, 144, 226, 0.05) 50%, rgba(74, 144, 226, 0.02) 100%);
  transform: rotate(-45deg);
  animation: parallaxFloat 20s ease-in-out infinite;
  pointer-events: none;
}

@keyframes parallaxFloat {
  0%, 100% { transform: rotate(-45deg) translateX(0) translateY(0); }
  50% { transform: rotate(-45deg) translateX(20px) translateY(-20px); }
}

/* Text content positioning */
.cinematic-about .about-text-content {
  position: relative;
  z-index: 2;
}

/* Desktop right-align text */
@media (min-width: 769px) {
  .cinematic-about .about-text-content {
    text-align: right;
  }
  
  .cinematic-about .about-text-content h2 {
    text-align: right;
  }
  
  .cinematic-about .about-text-content p {
    text-align: right;
  }
  
  .cinematic-about .about-text-content .btn {
    margin-left: auto;
    display: inline-block;
  }
}
