/* Animations for Cybersecurity Portfolio */

/* Fade In Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Slide Up Animation */
@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Slide In From Left Animation */
@keyframes slideInLeft {
  from {
    transform: translateX(-50px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Slide In From Right Animation */
@keyframes slideInRight {
  from {
    transform: translateX(50px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Scale In Animation */
@keyframes scaleIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Typing Animation */
@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}

@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: var(--primary-color) }
}

/* Glow Animation */
@keyframes glow {
  0% {
    box-shadow: 0 0 5px rgba(13, 202, 240, 0.2);
  }
  50% {
    box-shadow: 0 0 20px rgba(13, 202, 240, 0.6);
  }
  100% {
    box-shadow: 0 0 5px rgba(13, 202, 240, 0.2);
  }
}

/* Rotate Animation */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Apply animations to elements */
.animate-on-scroll {
  opacity: 1; /* Changed from 0 to 1 to make content visible by default */
  transform: translateY(0); /* Reset default position */
  transition: all 0.8s ease;
}

.animate-on-scroll.animated {
  /* Animation will be applied when 'animated' class is added by JS */
  opacity: 1;
  transform: translateY(0);
}

.animate-on-scroll.fade-in {
  animation: fadeIn 1s ease forwards;
}

.animate-on-scroll.slide-up {
  animation: slideUp 0.8s ease forwards;
}

.animate-on-scroll.slide-left {
  animation: slideInLeft 0.8s ease forwards;
}

.animate-on-scroll.slide-right {
  animation: slideInRight 0.8s ease forwards;
}

.animate-on-scroll.scale-in {
  animation: scaleIn 0.8s ease forwards;
}

/* Typing effect for hero text */
.typing-effect {
  overflow: hidden;
  white-space: nowrap;
  border-right: 3px solid var(--primary-color);
  width: 0;
  animation: 
    typing 3.5s steps(40, end) forwards,
    blink-caret 0.75s step-end infinite;
}

/* Typing animation for hero section */
.typing-animation {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  border-right: 3px solid var(--primary-color);
  animation: blink-caret 0.75s step-end infinite;
  line-height: 1.2;
  font-weight: bold;
  font-size: 2.15rem;
}

/* Glow effect for cards and buttons */
.glow-on-hover:hover {
  animation: glow 2s infinite;
}

/* Rotate icons on hover */
.rotate-on-hover:hover {
  animation: rotate 2s linear infinite;
}

/* Delayed animations for staggered effect */
.delay-1 {
  animation-delay: 0.2s;
}

.delay-2 {
  animation-delay: 0.4s;
}

.delay-3 {
  animation-delay: 0.6s;
}

.delay-4 {
  animation-delay: 0.8s;
}

.delay-5 {
  animation-delay: 1s;
}

/* Intersection Observer Animation Classes */
.animate-fade-in {
  opacity: 1; /* Changed from 0 to 1 to make content visible by default */
}

.animate-fade-in.animated {
  animation: fadeIn 1s ease forwards;
}

.animate-slide-up {
  opacity: 1; /* Changed from 0 to 1 to make content visible by default */
  transform: translateY(0); /* Reset default position */
}

.animate-slide-up.animated {
  animation: slideUp 0.8s ease forwards;
}

/* Floating animation for icons */
@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0px);
  }
}

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

/* Pulse animation for buttons */
@keyframes buttonPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.btn-pulse:hover {
  animation: buttonPulse 1.5s infinite;
}

/* Media queries for responsive animations */
@media (max-width: 768px) {
  .animate-on-scroll {
    animation-duration: 0.6s;
  }
  
  .typing-effect {
    animation: none;
    width: 100%;
    border-right: none;
  }
}
.typing-animation {
  font-weight: bold;
  font-size: 1.8rem;
}
/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}