/* ===== ADVANCED ANIMATIONS ===== */

/* Keyframe Animations */
@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 {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

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

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

@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-180deg) scale(0.8);
  }
  to {
    opacity: 1;
    transform: rotate(0deg) scale(1);
  }
}

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translateY(0);
  }
  40%, 43% {
    transform: translateY(-20px);
  }
  70% {
    transform: translateY(-10px);
  }
  90% {
    transform: translateY(-4px);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
  }
  50% {
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.8);
  }
}

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

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

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

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

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

/* Glitch Animations */
@keyframes glitch {
  0%, 90%, 100% {
    transform: translate(0);
    filter: hue-rotate(0deg);
  }
  10% {
    transform: translate(-2px, 2px);
    filter: hue-rotate(90deg);
  }
  20% {
    transform: translate(-2px, -2px);
    filter: hue-rotate(180deg);
  }
  30% {
    transform: translate(2px, 2px);
    filter: hue-rotate(270deg);
  }
  40% {
    transform: translate(2px, -2px);
    filter: hue-rotate(360deg);
  }
  50% {
    transform: translate(-2px, 2px);
    filter: hue-rotate(90deg);
  }
  60% {
    transform: translate(-2px, -2px);
    filter: hue-rotate(180deg);
  }
  70% {
    transform: translate(2px, 2px);
    filter: hue-rotate(270deg);
  }
  80% {
    transform: translate(-2px, -2px);
    filter: hue-rotate(360deg);
  }
}

@keyframes textGlitch {
  0%, 90%, 100% {
    transform: translate(0);
  }
  20% {
    transform: translate(-2px, 2px);
  }
  40% {
    transform: translate(-2px, -2px);
  }
  60% {
    transform: translate(2px, 2px);
  }
  80% {
    transform: translate(2px, -2px);
  }
}

@keyframes colorShift {
  0% {
    filter: hue-rotate(0deg);
  }
  25% {
    filter: hue-rotate(90deg);
  }
  50% {
    filter: hue-rotate(180deg);
  }
  75% {
    filter: hue-rotate(270deg);
  }
  100% {
    filter: hue-rotate(360deg);
  }
}

/* Hologram Effects */
@keyframes hologramScan {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateY(100%);
    opacity: 0;
  }
}

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

@keyframes hologramGlitch {
  0%, 90%, 100% {
    opacity: 0;
  }
  91%, 99% {
    opacity: 0.1;
    transform: skew(2deg);
  }
}

/* Matrix Effects */
@keyframes matrixRain {
  0% {
    transform: translateY(-100vh);
  }
  100% {
    transform: translateY(100vh);
  }
}

@keyframes matrixGlow {
  0%, 100% {
    text-shadow: 0 0 5px #00FF41, 0 0 10px #00FF41, 0 0 15px #00FF41;
  }
  50% {
    text-shadow: 0 0 10px #00FF41, 0 0 20px #00FF41, 0 0 30px #00FF41;
  }
}

/* Particle Effects */
@keyframes particleFloat {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  33% {
    transform: translateY(-10px) rotate(120deg);
  }
  66% {
    transform: translateY(5px) rotate(240deg);
  }
}

@keyframes particlePulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
}

/* Loading Animations */
@keyframes loadingProgress {
  0% {
    width: 0%;
  }
  50% {
    width: 100%;
  }
  100% {
    width: 0%;
  }
}

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

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

/* Scroll Animations */
@keyframes scrollIndicator {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(0px);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
}

@keyframes progressBar {
  0% {
    width: 0%;
  }
  100% {
    width: var(--progress, 0%);
  }
}

/* Button Animations */
@keyframes buttonGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.6);
  }
}

@keyframes buttonPress {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}

/* Card Animations */
@keyframes cardHover {
  0% {
    transform: translateY(0) rotateX(0) rotateY(0);
  }
  100% {
    transform: translateY(-10px) rotateX(5deg) rotateY(5deg);
  }
}

@keyframes cardReveal {
  0% {
    opacity: 0;
    transform: translateY(50px) rotateX(10deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotateX(0);
  }
}

/* Timeline Animations */
@keyframes timelineSlide {
  0% {
    opacity: 0;
    transform: translateX(-50px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes timelineMarker {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* Skill Animations */
@keyframes skillBarFill {
  0% {
    width: 0%;
  }
  100% {
    width: var(--skill-level, 0%);
  }
}

@keyframes skillGlow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.6);
  }
}

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

/* Entrance Animations */
.animate-fade-in-up {
  animation: fadeInUp 0.8s ease-out;
}

.animate-fade-in-down {
  animation: fadeInDown 0.8s ease-out;
}

.animate-fade-in-left {
  animation: fadeInLeft 0.8s ease-out;
}

.animate-fade-in-right {
  animation: fadeInRight 0.8s ease-out;
}

.animate-slide-in-up {
  animation: slideInUp 0.6s ease-out;
}

.animate-scale-in {
  animation: scaleIn 0.5s ease-out;
}

.animate-rotate-in {
  animation: rotateIn 0.8s ease-out;
}

/* Continuous Animations */
.animate-bounce {
  animation: bounce 2s infinite;
}

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

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

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

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

.animate-shake {
  animation: shake 0.5s ease-in-out;
}

/* Glitch Effects */
.glitch-effect {
  animation: glitch 0.3s ease-in-out;
}

.text-glitch {
  animation: textGlitch 0.5s ease-in-out;
}

.color-shift {
  animation: colorShift 3s linear infinite;
}

/* Hologram Effects */
.hologram-scan {
  position: relative;
  overflow: hidden;
}

.hologram-scan::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #00D4FF, transparent);
  animation: hologramScan 3s linear infinite;
}

.hologram-flicker {
  animation: hologramFlicker 0.1s infinite;
}

.hologram-glitch {
  position: relative;
}

.hologram-glitch::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #00D4FF;
  mix-blend-mode: screen;
  animation: hologramGlitch 4s infinite;
}

/* Matrix Effects */
.matrix-text {
  font-family: 'JetBrains Mono', monospace;
  color: #00FF41;
  animation: matrixGlow 2s infinite;
}

/* Particle Effects */
.particle-float {
  animation: particleFloat 8s ease-in-out infinite;
}

.particle-pulse {
  animation: particlePulse 3s ease-in-out infinite;
}

/* Loading Effects */
.loading-progress {
  animation: loadingProgress 2s ease-in-out infinite;
}

.loading-pulse {
  animation: loadingPulse 1.5s ease-in-out infinite;
}

.loading-spin {
  animation: loadingSpin 1s linear infinite;
}

/* Interactive Effects */
.hover-glow:hover {
  animation: glow 0.3s ease-in-out;
}

.hover-float:hover {
  animation: float 1s ease-in-out;
}

.hover-shake:hover {
  animation: shake 0.5s ease-in-out;
}

.click-pulse:active {
  animation: pulse 0.3s ease-in-out;
}

/* Scroll-triggered Animations */
.scroll-reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s ease-out;
}

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

.scroll-slide-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.8s ease-out;
}

.scroll-slide-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.scroll-slide-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.8s ease-out;
}

.scroll-slide-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.scroll-scale {
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.8s ease-out;
}

.scroll-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger Animations */
.stagger-children > * {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease-out;
}

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

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

/* Special Effects */
.neon-glow {
  text-shadow: 
    0 0 5px currentColor,
    0 0 10px currentColor,
    0 0 15px currentColor,
    0 0 20px currentColor;
}

.glass-morphism {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.cyber-border {
  position: relative;
  border: 2px solid transparent;
  background: linear-gradient(45deg, #00D4FF, #FF0080) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .animate-bounce,
  .animate-pulse,
  .animate-glow,
  .animate-rotate,
  .animate-float,
  .particle-float,
  .particle-pulse,
  .loading-spin {
    animation: none !important;
  }
}

/* Dark Mode Adjustments */
@media (prefers-color-scheme: dark) {
  .glass-morphism {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .neon-glow {
    text-shadow: none;
    border: 2px solid currentColor;
  }
  
  .glass-morphism {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #fff;
  }
}

