/*
 * ULTRA-MODERN ANIMATIONS & EFFECTS (2025) - PMC/PIHS
 * Advanced CSS animations, micro-interactions, and modern effects
 * Includes glassmorphism, floating elements, and smooth transitions
 */

/* ==========================================
   MODERN KEYFRAME ANIMATIONS
   ========================================== */

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translate3d(0, -50px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 50px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ==========================================
   SCROLL REVEAL ANIMATIONS
   ========================================== */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.active {
  opacity: 1;
  transform: translateX(0);
}

/* ==========================================
   FLOATING 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);
  }
}

.float {
  animation: float 6s ease-in-out infinite;
}

.float-slow {
  animation: floatSlow 8s ease-in-out infinite;
}

/* ==========================================
   PULSE ANIMATIONS
   ========================================== */

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

@keyframes pulseRing {
  0% {
    transform: scale(0.9);
    opacity: 1;
  }
  100% {
    transform: scale(1.3);
    opacity: 0;
  }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* ==========================================
   GRADIENT ANIMATIONS
   ========================================== */

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.gradient-animate {
  background-size: 200% 200%;
  animation: gradientShift 10s ease infinite;
}

/* ==========================================
   SHIMMER EFFECT
   ========================================== */

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.shimmer {
  position: relative;
  overflow: hidden;
}

.shimmer::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 3s infinite;
}

/* ==========================================
   BOUNCE ON SCROLL
   ========================================== */

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.bounce-in {
  animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ==========================================
   ROTATE & SCALE
   ========================================== */

@keyframes rotateScale {
  0%, 100% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.1);
  }
}

.rotate-scale {
  animation: rotateScale 20s linear infinite;
}

/* ==========================================
   DECORATIVE SHAPES
   ========================================== */

.shape-blob {
  position: absolute;
  border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
  background: linear-gradient(135deg, rgba(0, 102, 204, 0.1) 0%, rgba(0, 191, 166, 0.1) 100%);
  filter: blur(40px);
  pointer-events: none;
  z-index: -1;
}

.shape-blob-1 {
  width: 400px;
  height: 400px;
  top: 10%;
  right: 10%;
  animation: floatSlow 15s ease-in-out infinite;
}

.shape-blob-2 {
  width: 500px;
  height: 500px;
  bottom: 10%;
  left: 10%;
  animation: floatSlow 20s ease-in-out infinite reverse;
}

.shape-circle {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(0, 102, 204, 0.1);
  pointer-events: none;
  z-index: -1;
}

/* ==========================================
   GLOWING EFFECT
   ========================================== */

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(0, 102, 204, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(0, 102, 204, 0.6), 0 0 60px rgba(0, 191, 166, 0.4);
  }
}

.glow {
  animation: glow 3s ease-in-out infinite;
}

/* ==========================================
   TEXT GRADIENT ANIMATION
   ========================================== */

@keyframes textGradient {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.text-gradient-animate {
  background: linear-gradient(
    90deg,
    #0066cc 0%,
    #00bfa6 25%,
    #0066cc 50%,
    #00bfa6 75%,
    #0066cc 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: textGradient 8s linear infinite;
}

/* ==========================================
   STAGGER ANIMATIONS (for lists)
   ========================================== */

.stagger-item {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-item.active {
  opacity: 1;
  transform: translateY(0);
}

.stagger-item:nth-child(1).active { transition-delay: 0.1s; }
.stagger-item:nth-child(2).active { transition-delay: 0.2s; }
.stagger-item:nth-child(3).active { transition-delay: 0.3s; }
.stagger-item:nth-child(4).active { transition-delay: 0.4s; }
.stagger-item:nth-child(5).active { transition-delay: 0.5s; }
.stagger-item:nth-child(6).active { transition-delay: 0.6s; }

/* ==========================================
   PARALLAX ELEMENTS
   ========================================== */

.parallax {
  transition: transform 0.3s ease-out;
}

/* ==========================================
   MAGNETIC HOVER EFFECT
   ========================================== */

.magnetic {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.magnetic:hover {
  transform: scale(1.05);
}

/* ==========================================
   RIPPLE EFFECT
   ========================================== */

@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

.ripple-effect {
  position: relative;
  overflow: hidden;
}

.ripple-effect::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100px;
  height: 100px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
}

.ripple-effect:active::after {
  animation: ripple 0.6s ease-out;
}

/* ==========================================
   LOADING SKELETON
   ========================================== */

@keyframes skeleton-loading {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    #f0f0f0 0px,
    #e0e0e0 40px,
    #f0f0f0 80px
  );
  background-size: 200px 100%;
  animation: skeleton-loading 1.5s infinite;
}

/* ==========================================
   SCROLL PROGRESS INDICATOR
   ========================================== */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, #0066cc 0%, #00bfa6 100%);
  transform-origin: left;
  z-index: 9999;
  transition: transform 0.1s ease-out;
}

/* ==========================================
   TYPEWRITER EFFECT
   ========================================== */

@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink {
  50% {
    border-color: transparent;
  }
}

.typewriter {
  overflow: hidden;
  border-right: 3px solid;
  white-space: nowrap;
  animation:
    typewriter 3s steps(40) 1s 1 normal both,
    blink 0.75s step-end infinite;
}

/* ==========================================
   CARD FLIP EFFECT
   ========================================== */

.flip-card {
  perspective: 1000px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius-xl);
}

.flip-card-back {
  transform: rotateY(180deg);
}

/* ==========================================
   GLASSMORPHISM CARDS
   ========================================== */

.glass-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* ==========================================
   NEUMORPHISM ELEMENTS
   ========================================== */

.neumorphism {
  background: #f0f0f0;
  box-shadow:
    8px 8px 16px rgba(163, 177, 198, 0.6),
    -8px -8px 16px rgba(255, 255, 255, 0.5);
}

.neumorphism-inset {
  background: #f0f0f0;
  box-shadow:
    inset 8px 8px 16px rgba(163, 177, 198, 0.6),
    inset -8px -8px 16px rgba(255, 255, 255, 0.5);
}
