/* ZiBumBaa Marketing - Advanced Animations & Effects */

/* ===== Scroll-Triggered Animations ===== */
.fade-in,
.slide-in-left,
.slide-in-right,
.slide-in-up,
.slide-in-down,
.zoom-in {
  opacity: 0;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in.animate-in {
  opacity: 1;
}

.slide-in-left {
  transform: translateX(-50px);
}

.slide-in-left.animate-in {
  opacity: 1;
  transform: translateX(0);
}

.slide-in-right {
  transform: translateX(50px);
}

.slide-in-right.animate-in {
  opacity: 1;
  transform: translateX(0);
}

.slide-in-up {
  transform: translateY(50px);
}

.slide-in-up.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.slide-in-down {
  transform: translateY(-50px);
}

.slide-in-down.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.zoom-in {
  transform: scale(0.9);
}

.zoom-in.animate-in {
  opacity: 1;
  transform: scale(1);
}

/* Stagger animation for children */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-children > *.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Sticky Header Effects ===== */
.header {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header.scrolled {
  padding: 0.75rem 0;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
}

.header.scrolled .logo {
  max-height: 35px;
}

.header.header-hidden {
  transform: translateY(-100%);
}

/* ===== Scroll Progress Indicator ===== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #0050B0 0%, #E00050 100%);
  width: 0%;
  z-index: 10000;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 10px rgba(0, 80, 176, 0.5);
}

/* ===== Advanced Card Hover Effects ===== */
.card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
  position: relative;
  overflow: visible;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0, 80, 176, 0.05), rgba(224, 0, 80, 0.05));
  opacity: 0;
  transition: opacity 0.4s ease;
  border-radius: 12px;
  pointer-events: none;
}

.card:hover::before {
  opacity: 1;
}

.card:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* ===== Button Ripple Effect ===== */
.btn {
  position: relative;
  overflow: hidden;
}

.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transform: scale(0);
  animation: ripple-animation 0.6s ease-out;
  pointer-events: none;
}

@keyframes ripple-animation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ===== Testimonial Carousel ===== */
.testimonial-carousel {
  position: relative;
  padding: 2rem 0;
}

.testimonial-item {
  opacity: 0;
  visibility: hidden;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(50px);
}

.testimonial-item.active {
  opacity: 1;
  visibility: visible;
  position: relative;
  transform: translateX(0);
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 2rem;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #D1D5DB;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.carousel-dot:hover {
  background-color: #9CA3AF;
  transform: scale(1.2);
}

.carousel-dot.active {
  background-color: var(--primary-blue);
  width: 30px;
  border-radius: 5px;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--bg-white);
  border: 2px solid var(--border-grey);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
}

.carousel-btn:hover {
  background-color: var(--primary-blue);
  border-color: var(--primary-blue);
  color: var(--bg-white);
  transform: translateY(-50%) scale(1.1);
}

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

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

.carousel-btn .material-icons {
  font-size: 24px;
}

/* ===== Lazy Loading Images ===== */
img[data-src] {
  filter: blur(10px);
  transition: filter 0.5s ease;
}

img[data-src].loaded {
  filter: blur(0);
}

/* ===== Pulse Animation for CTAs ===== */
@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(0, 80, 176, 0.7);
  }
  50% {
    box-shadow: 0 0 0 20px rgba(0, 80, 176, 0);
  }
}

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

/* ===== Floating Animation ===== */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

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

/* ===== Gradient Text Effect ===== */
.gradient-text {
  background: linear-gradient(135deg, #0050B0, #E00050);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 3s ease infinite;
  background-size: 200% 200%;
}

@keyframes gradient-shift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* ===== Glowing Effect ===== */
.glow {
  position: relative;
}

.glow::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #0050B0, #E00050, #0050B0);
  border-radius: inherit;
  opacity: 0;
  z-index: -1;
  filter: blur(10px);
  transition: opacity 0.3s ease;
  animation: glow-rotate 3s linear infinite;
  background-size: 200% 200%;
}

.glow:hover::after {
  opacity: 1;
}

@keyframes glow-rotate {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

/* ===== Skeleton Loading ===== */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

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

/* ===== Hover Lift Effect ===== */
.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);
}

/* ===== Typewriter Effect ===== */
.typewriter {
  overflow: hidden;
  border-right: 2px solid var(--primary-blue);
  white-space: nowrap;
  animation: typewriter 3.5s steps(40) 1s 1 normal both,
             blink 0.75s step-end infinite;
}

@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink {
  50% {
    border-color: transparent;
  }
}

/* ===== Shake Animation ===== */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

.shake {
  animation: shake 0.5s ease;
}

/* ===== Bounce Animation ===== */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-20px);
  }
  60% {
    transform: translateY(-10px);
  }
}

.bounce {
  animation: bounce 1s ease;
}

/* ===== Smooth Scale on Hover ===== */
.scale-hover {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.scale-hover:hover {
  transform: scale(1.05);
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
  .carousel-prev {
    left: -10px;
  }
  
  .carousel-next {
    right: -10px;
  }
  
  .carousel-btn {
    width: 35px;
    height: 35px;
  }
  
  .carousel-btn .material-icons {
    font-size: 20px;
  }
  
  /* Disable 3D effects on mobile for performance */
  .card {
    transform-style: flat !important;
  }
  
  .card:hover {
    transform: scale(1) !important;
  }
}

/* ===== Accessibility ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .scroll-progress {
    transition: none;
  }
}
