/*
 * 🎬 SEMPI ANIMATIONS
 * Advanced animations for timeline, sections and interactive elements
 */

/* ==========================================
   ⏱️ TIMELINE ANIMATIONS
   ========================================== */

.timeline {
  position: relative;
}

/* Animated vertical line for timeline */
.timeline::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #f16926 0%, #FF9A5C 100%);
  opacity: 0.3;
  animation: growLine 1.5s ease-out forwards;
}

@keyframes growLine {
  from {
    height: 0;
    opacity: 0;
  }
  to {
    height: 100%;
    opacity: 0.3;
  }
}

/* Timeline step animations */
.timeline-step {
  position: relative;
  opacity: 0;
  transform: translateX(-30px);
  animation: slideInTimeline 0.6s ease-out forwards;
  animation-delay: calc(var(--index, 0) * 0.2s);
}

.timeline-step:nth-child(1) { --index: 1; }
.timeline-step:nth-child(2) { --index: 2; }
.timeline-step:nth-child(3) { --index: 3; }
.timeline-step:nth-child(4) { --index: 4; }

@keyframes slideInTimeline {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Pulsing dot for timeline steps */
.timeline-step::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 24px;
  width: 16px;
  height: 16px;
  background: #f16926;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 0 rgba(241, 105, 38, 0.7);
  animation: pulse 2s infinite;
  z-index: 2;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(241, 105, 38, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(241, 105, 38, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(241, 105, 38, 0);
  }
}

/* Highlighted timeline steps */
.timeline-step[style*="border-left: 3px solid #f16926"]::before,
.timeline-step[style*="border-left: 3px solid #FF9A5C"]::before {
  width: 20px;
  height: 20px;
  left: -10px;
  animation: pulse 1.5s infinite, glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    box-shadow: 0 0 5px rgba(241, 105, 38, 0.5);
  }
  to {
    box-shadow: 0 0 20px rgba(241, 105, 38, 0.8), 0 0 30px rgba(255, 154, 92, 0.6);
  }
}

/* ==========================================
   🎯 SCROLL REVEAL ANIMATIONS
   ========================================== */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger animation for cards */
.cards-grid .card {
  transition-delay: calc(var(--card-index, 0) * 0.1s);
}

.cards-grid .card:nth-child(1) { --card-index: 1; }
.cards-grid .card:nth-child(2) { --card-index: 2; }
.cards-grid .card:nth-child(3) { --card-index: 3; }
.cards-grid .card:nth-child(4) { --card-index: 4; }
.cards-grid .card:nth-child(5) { --card-index: 5; }
.cards-grid .card:nth-child(6) { --card-index: 6; }

/* ==========================================
   🎨 PILLAR ANIMATIONS
   ========================================== */

/* Animated icons for pillars */
.card[style*="border: 2px solid rgba(241,105,38,0.15)"] {
  position: relative;
  overflow: hidden;
}

.card[style*="border: 2px solid rgba(241,105,38,0.15)"]::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #f16926, transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Hover effect for pillar cards */
.card[style*="border: 2px solid rgba(241,105,38,0.15)"]:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(241, 105, 38, 0.2);
  transition: all 0.3s ease;
}

/* ==========================================
   📊 COUNTER ANIMATIONS
   ========================================== */

/* Animated counter for stats */
.stat-number {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  animation: countUp 2s ease-out forwards;
}

@keyframes countUp {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ==========================================
   🎬 VIDEO PLACEHOLDER ANIMATIONS
   ========================================== */

.video-placeholder {
  position: relative;
  background: linear-gradient(135deg, rgba(241,105,38,0.1), rgba(255,154,92,0.05));
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
}

.video-placeholder::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(241,105,38,0.1) 50%, transparent 70%);
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.video-placeholder:hover {
  transform: scale(1.02);
  box-shadow: 0 20px 60px rgba(241, 105, 38, 0.3);
}

.video-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background: rgba(241, 105, 38, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: breathe 2s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
  }
}

.video-play-button:hover {
  background: #f16926;
  transform: translate(-50%, -50%) scale(1.15);
}

.video-play-button::after {
  content: '';
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 15px 0 15px 25px;
  border-color: transparent transparent transparent white;
  margin-left: 5px;
}

/* ==========================================
   📱 MOBILE OPTIMIZATIONS
   ========================================== */

@media (max-width: 768px) {
  .timeline::before {
    left: 10px;
  }

  .timeline-step::before {
    left: -6px;
    width: 12px;
    height: 12px;
  }

  .video-play-button {
    width: 60px;
    height: 60px;
  }

  .video-play-button::after {
    border-width: 10px 0 10px 18px;
  }
}

/* ==========================================
   🌟 FLOATING ELEMENTS
   ========================================== */

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

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

/* Badge pulse */
.badge {
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* ==========================================
   🎆 GRADIENT ANIMATIONS
   ========================================== */

.animated-gradient {
  background: linear-gradient(270deg, #f16926, #FF9A5C, #f16926);
  background-size: 400% 400%;
  animation: gradientFlow 8s ease infinite;
}

@keyframes gradientFlow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* ==========================================
   ✨ HOVER EFFECTS
   ========================================== */

.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* ==========================================
   🎯 FOCUS STATES (Accessibility)
   ========================================== */

.btn:focus-visible,
a:focus-visible {
  outline: 3px solid #f16926;
  outline-offset: 3px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
