/*
 * ADVE - Animations & Visual Effects
 * Wszystkie spektakularne efekty wizualne zgodnie z briefem
 */

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

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

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

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


/* ========================================
   FADE IN & SLIDE UP ANIMATIONS
   ======================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

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

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

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(100px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Classes */
.fade-in-up {
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

.fade-in-up.delay-1 {
  animation-delay: 0.2s;
}

.fade-in-up.delay-2 {
  animation-delay: 0.4s;
}

.fade-in-up.delay-3 {
  animation-delay: 0.6s;
}

/* Scroll-triggered fade-in sections */
.fade-in-section {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in-section.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-section[data-delay="100"] {
  transition-delay: 0.1s;
}

.fade-in-section[data-delay="200"] {
  transition-delay: 0.2s;
}

.fade-in-section[data-delay="300"] {
  transition-delay: 0.3s;
}

.fade-in-section[data-delay="400"] {
  transition-delay: 0.4s;
}

.fade-in-section[data-delay="500"] {
  transition-delay: 0.5s;
}


/* ========================================
   FLOATING & PULSING ANIMATIONS
   ======================================== */

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

@keyframes floatSlow {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-30px) rotate(5deg);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(0.95);
  }
}

@keyframes pulseSlow {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
  }
  50% {
    box-shadow: 0 0 0 20px rgba(99, 102, 241, 0);
  }
}


/* ========================================
   SCROLL INDICATOR ANIMATION
   ======================================== */

@keyframes scrollPulse {
  0% {
    opacity: 1;
    transform: scaleY(1);
  }
  50% {
    opacity: 0.5;
    transform: scaleY(1.5);
  }
  100% {
    opacity: 1;
    transform: scaleY(1);
  }
}


/* ========================================
   CHART & LINE DRAWING ANIMATIONS
   ======================================== */

@keyframes drawLine {
  from {
    stroke-dashoffset: 400;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes drawCircle {
  from {
    stroke-dashoffset: 314;
  }
  to {
    stroke-dashoffset: 0;
  }
}


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

@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stat-number.counting {
  animation: countUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}


/* ========================================
   PROGRESS BAR ANIMATIONS
   ======================================== */

@keyframes progressFill {
  from {
    width: 0%;
  }
}

.progress-fill.animating {
  animation: progressFill 2s cubic-bezier(0.16, 1, 0.3, 1);
}


/* ========================================
   GLOW & SHIMMER EFFECTS
   ======================================== */

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(99, 102, 241, 0.3),
                0 0 10px rgba(99, 102, 241, 0.2),
                0 0 20px rgba(99, 102, 241, 0.1);
  }
  50% {
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5),
                0 0 20px rgba(99, 102, 241, 0.3),
                0 0 30px rgba(99, 102, 241, 0.2);
  }
}

@keyframes glowPulse {
  0%, 100% {
    filter: drop-shadow(0 0 5px rgba(99, 102, 241, 0.5));
  }
  50% {
    filter: drop-shadow(0 0 15px rgba(99, 102, 241, 0.8));
  }
}


/* ========================================
   ROTATE & SPIN ANIMATIONS
   ======================================== */

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

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

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}


/* ========================================
   SCALE & ZOOM ANIMATIONS
   ======================================== */

@keyframes scaleUp {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes scaleDown {
  from {
    transform: scale(1.1);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

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


/* ========================================
   BOUNCE & ELASTIC ANIMATIONS
   ======================================== */

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

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3) translateY(-100px);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes elastic {
  0%, 100% {
    transform: scale(1);
  }
  25% {
    transform: scale(0.95);
  }
  50% {
    transform: scale(1.05);
  }
  75% {
    transform: scale(0.98);
  }
}


/* ========================================
   SHAKE & WIGGLE ANIMATIONS
   ======================================== */

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

@keyframes wiggle {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-5deg);
  }
  75% {
    transform: rotate(5deg);
  }
}


/* ========================================
   RIPPLE & WAVE ANIMATIONS
   ======================================== */

@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

@keyframes wave {
  0%, 100% {
    transform: translateX(0) translateY(0);
  }
  25% {
    transform: translateX(5px) translateY(-5px);
  }
  50% {
    transform: translateX(0) translateY(0);
  }
  75% {
    transform: translateX(-5px) translateY(5px);
  }
}


/* ========================================
   BLUR & FOCUS ANIMATIONS
   ======================================== */

@keyframes blurIn {
  from {
    filter: blur(20px);
    opacity: 0;
  }
  to {
    filter: blur(0);
    opacity: 1;
  }
}

@keyframes blurOut {
  from {
    filter: blur(0);
    opacity: 1;
  }
  to {
    filter: blur(20px);
    opacity: 0;
  }
}


/* ========================================
   FLIP & ROTATE 3D ANIMATIONS
   ======================================== */

@keyframes flipInX {
  from {
    transform: perspective(400px) rotateX(90deg);
    opacity: 0;
  }
  to {
    transform: perspective(400px) rotateX(0deg);
    opacity: 1;
  }
}

@keyframes flipInY {
  from {
    transform: perspective(400px) rotateY(90deg);
    opacity: 0;
  }
  to {
    transform: perspective(400px) rotateY(0deg);
    opacity: 1;
  }
}


/* ========================================
   SLIDE ANIMATIONS
   ======================================== */

@keyframes slideInFromLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInFromRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInFromTop {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideInFromBottom {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}


/* ========================================
   TEXT ANIMATIONS
   ======================================== */

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

@keyframes blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

@keyframes textGlow {
  0%, 100% {
    text-shadow: 0 0 5px rgba(99, 102, 241, 0.5),
                 0 0 10px rgba(99, 102, 241, 0.3);
  }
  50% {
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.8),
                 0 0 20px rgba(99, 102, 241, 0.5),
                 0 0 30px rgba(99, 102, 241, 0.3);
  }
}


/* ========================================
   BACKGROUND ANIMATIONS
   ======================================== */

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

@keyframes gradientRotate {
  0% {
    filter: hue-rotate(0deg);
  }
  100% {
    filter: hue-rotate(360deg);
  }
}


/* ========================================
   LOADER & SPINNER ANIMATIONS
   ======================================== */

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes dotPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.5);
    opacity: 0.5;
  }
}

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


/* ========================================
   HOVER EFFECT UTILITIES
   ======================================== */

.hover-lift {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.hover-scale {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.hover-rotate {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-rotate:hover {
  transform: rotate(5deg);
}

.hover-glow {
  transition: box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4),
              0 0 40px rgba(99, 102, 241, 0.2);
}

.hover-brightness {
  transition: filter 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-brightness:hover {
  filter: brightness(1.1);
}


/* ========================================
   STAGGER ANIMATIONS
   ======================================== */

.stagger-fade-in > * {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.stagger-fade-in > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-fade-in > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-fade-in > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-fade-in > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-fade-in > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-fade-in > *:nth-child(6) { animation-delay: 0.6s; }


/* ========================================
   REVEAL ANIMATIONS (Intersection Observer)
   ======================================== */

[data-animate] {
  opacity: 0;
}

[data-animate].animated {
  animation-duration: 0.8s;
  animation-fill-mode: forwards;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-animate="fade-in"].animated {
  animation-name: fadeIn;
}

[data-animate="fade-up"].animated {
  animation-name: fadeInUp;
}

[data-animate="fade-down"].animated {
  animation-name: fadeInDown;
}

[data-animate="fade-left"].animated {
  animation-name: fadeInLeft;
}

[data-animate="fade-right"].animated {
  animation-name: fadeInRight;
}

[data-animate="scale-up"].animated {
  animation-name: scaleUp;
}

[data-animate="zoom-in"].animated {
  animation-name: zoomIn;
}

[data-animate="slide-up"].animated {
  animation-name: slideInUp;
}


/* ========================================
   TRANSITION UTILITIES
   ======================================== */

.transition-fast {
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.transition-normal {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.transition-slow {
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.transition-bounce {
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}


/* ========================================
   PARALLAX EFFECTS
   ======================================== */

.parallax-slow {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.parallax-medium {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.parallax-fast {
  transition: transform 0.1s linear;
}


/* ========================================
   LOADING STATES
   ======================================== */

.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: rgba(99, 102, 241, 1);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}


/* ========================================
   SKELETON LOADING
   ======================================== */

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

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


/* ========================================
   PERFORMANCE OPTIMIZATION
   ======================================== */

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

/* GPU Acceleration for smoother animations */
.gpu-accelerated {
  transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
}


/* ========================================
   CUSTOM TIMING FUNCTIONS
   ======================================== */

.ease-smooth {
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

.ease-bounce {
  animation-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.ease-elastic {
  animation-timing-function: cubic-bezier(0.68, -0.6, 0.32, 1.6);
}


/* ========================================
   TREND LINE ANIMATIONS
   ======================================== */

@keyframes trendDotPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.7;
  }
}

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

@keyframes trendArrowBounceDown {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(3px);
  }
}

.trend-dot-pulse {
  animation: trendDotPulse 2s ease-in-out infinite;
  transform-origin: center;
}

.trend-arrow-up {
  animation: trendArrowBounce 1.5s ease-in-out infinite;
  transform-origin: center;
}

.trend-arrow-down {
  animation: trendArrowBounceDown 1.5s ease-in-out infinite;
  transform-origin: center;
}
