/* =============================================================================
   ADVANCED ANIMATION EFFECTS: Timeline, Count-up, Fade-in, Delay
   ============================================================================= */

/* CSS Custom Properties for timing and easing */
:root {
  --timeline-duration: 0.8s;
  --fade-duration: 1.2s;
  --delay-base: 0.2s;
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-elastic: cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

/* =============================================================================
   FADE-IN ANIMATIONS WITH DELAYS
   ============================================================================= */

.fade-in {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp var(--fade-duration) var(--ease-smooth) forwards;
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-50px);
  animation: fadeInLeft var(--fade-duration) var(--ease-smooth) forwards;
}

.fade-in-right {
  opacity: 0;
  transform: translateX(50px);
  animation: fadeInRight var(--fade-duration) var(--ease-smooth) forwards;
}

.fade-in-scale {
  opacity: 0;
  transform: scale(0.8);
  animation: fadeInScale var(--fade-duration) var(--ease-bounce) forwards;
}

/* Delay classes */
.delay-1 { animation-delay: calc(var(--delay-base) * 1); }
.delay-2 { animation-delay: calc(var(--delay-base) * 2); }
.delay-3 { animation-delay: calc(var(--delay-base) * 3); }
.delay-4 { animation-delay: calc(var(--delay-base) * 4); }
.delay-5 { animation-delay: calc(var(--delay-base) * 5); }
.delay-6 { animation-delay: calc(var(--delay-base) * 6); }
.delay-7 { animation-delay: calc(var(--delay-base) * 7); }
.delay-8 { animation-delay: calc(var(--delay-base) * 8); }

/* =============================================================================
   TIMELINE ANIMATIONS
   ============================================================================= */

.timeline-container {
  position: relative;
  opacity: 0;
  animation: fadeInUp 1s var(--ease-smooth) forwards;
}

.timeline-item {
  opacity: 0;
  transform: translateX(-100px);
  animation: slideInTimeline var(--timeline-duration) var(--ease-elastic) forwards;
}

.timeline-item:nth-child(even) {
  transform: translateX(100px);
  animation: slideInTimelineReverse var(--timeline-duration) var(--ease-elastic) forwards;
}

.timeline-connector {
  position: relative;
  overflow: hidden;
}

.timeline-connector::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 0;
  background: linear-gradient(180deg, #e3941e, #fa7617);
  animation: growLine 2s ease-out forwards;
  animation-delay: 0.5s;
}

/* =============================================================================
   COUNT-UP ANIMATIONS
   ============================================================================= */

.count-up {
  font-weight: bold;
  font-variant-numeric: tabular-nums;
  position: relative;
  overflow: hidden;
}

.count-up::before {
  content: attr(data-target);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, currentColor 50%, transparent 100%);
  background-size: 200% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  animation: shimmer 2s ease-in-out infinite;
}

.count-up-highlight {
  display: inline-block;
  padding: 8px 16px;
  background: linear-gradient(45deg, #e3941e, #fa7617);
  border-radius: 25px;
  color: white;
  box-shadow: 0 4px 15px rgba(227, 148, 30, 0.3);
  transform: scale(0);
  animation: popIn 0.8s var(--ease-bounce) forwards;
}

/* =============================================================================
   SCROLL-TRIGGERED ANIMATIONS
   ============================================================================= */

.scroll-reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s var(--ease-smooth);
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.scroll-reveal-stagger {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s var(--ease-smooth);
}

.scroll-reveal-stagger.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays for multiple elements */
.scroll-reveal-stagger:nth-child(1).revealed { transition-delay: 0s; }
.scroll-reveal-stagger:nth-child(2).revealed { transition-delay: 0.1s; }
.scroll-reveal-stagger:nth-child(3).revealed { transition-delay: 0.2s; }
.scroll-reveal-stagger:nth-child(4).revealed { transition-delay: 0.3s; }
.scroll-reveal-stagger:nth-child(5).revealed { transition-delay: 0.4s; }
.scroll-reveal-stagger:nth-child(6).revealed { transition-delay: 0.5s; }

/* =============================================================================
   ENHANCED HOVER EFFECTS
   ============================================================================= */

.hover-lift {
  transition: all 0.3s var(--ease-smooth);
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.hover-glow {
  position: relative;
  transition: all 0.3s ease;
}

.hover-glow::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  background: linear-gradient(45deg, #e3941e, #fa7617);
  opacity: 0;
  z-index: -1;
  filter: blur(20px);
  transition: opacity 0.3s ease;
}

.hover-glow:hover::before {
  opacity: 0.7;
}

/* =============================================================================
   LOADING ANIMATIONS
   ============================================================================= */

.loading-dots {
  display: inline-flex;
  gap: 4px;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e3941e;
  animation: loadingBounce 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

.progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(227, 148, 30, 0.2);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.progress-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #e3941e, #fa7617);
  animation: progressSlide 2s ease-in-out infinite;
}

/* =============================================================================
   KEYFRAME DEFINITIONS
   ============================================================================= */

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

@keyframes fadeInLeft {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInScale {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInTimeline {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInTimelineReverse {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes growLine {
  to {
    height: 100%;
  }
}

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

@keyframes popIn {
  0% {
    transform: scale(0) rotate(-180deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.2) rotate(-90deg);
    opacity: 0.8;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes loadingBounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

@keyframes progressSlide {
  0% {
    left: -100%;
  }
  50% {
    left: 0%;
  }
  100% {
    left: 100%;
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(227, 148, 30, 0.7);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(227, 148, 30, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(227, 148, 30, 0);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

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

/* =============================================================================
   UTILITY ANIMATION CLASSES
   ============================================================================= */

.animate-pulse {
  animation: pulse 2s infinite;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-rotate {
  animation: rotate 2s linear infinite;
}

/* =============================================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================================= */

@media (max-width: 768px) {
  :root {
    --timeline-duration: 0.6s;
    --fade-duration: 1s;
    --delay-base: 0.15s;
  }
  
  .fade-in, .fade-in-left, .fade-in-right {
    transform: translateY(20px);
  }
  
  .timeline-item {
    transform: translateY(30px);
    animation: fadeInUp var(--timeline-duration) var(--ease-smooth) forwards;
  }
  
  .timeline-item:nth-child(even) {
    transform: translateY(30px);
    animation: fadeInUp var(--timeline-duration) var(--ease-smooth) forwards;
  }
}

/* =============================================================================
   MEDIA GALLERY STYLES (Videos & Audio)
   ============================================================================= */

.video-gallery, .audio-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  padding: 2rem 0;
}

.video-item, .audio-item {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  transition: all 0.3s var(--ease-smooth);
  position: relative;
  overflow: hidden;
}

.video-item.loading, .audio-item.loading {
  opacity: 0.7;
}

.video-item.loading::before, .audio-item.loading::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 1.5s infinite;
  z-index: 1;
}

.video-item.loaded, .audio-item.loaded {
  opacity: 1;
  animation: bounceInUp 0.6s var(--ease-bounce);
}

.video-item video, .audio-item audio {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.video-title, .audio-title {
  margin: 1rem 0 0.5rem 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
}

.video-description, .audio-description {
  margin: 0.5rem 0 0 0;
  color: #666;
  line-height: 1.5;
}

/* Container for media pages */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.container h1 {
  text-align: center;
  margin-bottom: 3rem;
  font-size: 2.5rem;
  color: #333;
  position: relative;
}

.container h1::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(45deg, #667eea, #764ba2);
  border-radius: 2px;
  animation: slideInUp 0.8s var(--ease-smooth) 0.5s forwards;
  opacity: 0;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .video-item, .audio-item {
    background: #2a2a2a;
    color: #fff;
  }
  
  .video-title, .audio-title {
    color: #fff;
  }
  
  .video-description, .audio-description {
    color: #ccc;
  }
  
  .container h1 {
    color: #fff;
  }
}
