/* ============================================
   ANIMATION DEFINITIONS
   ============================================ */

/**
 * Cursor blink animation - used for terminal aesthetic
 */
@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/**
 * Easter egg animation - subtle scale pop effect
 */
@keyframes egg-pop {
  0% {
    transform: scale(1);
  }

  60% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

/**
 * Fade in animation - used for section transitions
 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/**
 * Slide up animation - used for content appearing
 */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/**
 * Slide down animation - used for content appearing from top
 */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/**
 * Pulse animation - used for status indicators and attention-grabbing elements
 */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/**
 * Glow animation - used for hover effects on interactive elements
 */
@keyframes glow {
  0% {
    box-shadow: 0 0 5px rgba(74, 222, 128, 0);
  }

  50% {
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.5);
  }

  100% {
    box-shadow: 0 0 5px rgba(74, 222, 128, 0);
  }
}

/**
 * Typing cursor effect - used for terminal-style text input appearance
 */
@keyframes typing {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}

/**
 * Grow animation - used for card hover effects
 */
@keyframes grow {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.05);
  }
}

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

/**
 * Apply fade-in animation universally
 */
.animate-fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

/**
 * Apply slide-up animation universally
 */
.animate-slide-up {
  animation: slideUp 0.5s ease-out forwards;
}

/**
 * Apply slide-down animation universally
 */
.animate-slide-down {
  animation: slideDown 0.5s ease-out forwards;
}

/**
 * Apply pulse animation universally
 */
.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

/**
 * Apply glow animation universally
 */
.animate-glow {
  animation: glow 2s ease-in-out infinite;
}

/* ============================================
   COMPONENT-SPECIFIC ANIMATIONS
   ============================================ */

/**
 * Terminal section transitions - fade and slide
 */
.terminal-section {
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.terminal-section.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/**
 * Skill bars animate on page load
 */
.skill-level::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background-color: var(--terminal-green);
  width: 0;
  transition: width 1.5s ease-out;
}

/**
 * Project cards have smooth hover animation
 */
.project-card {
  transition: all 0.3s ease;
}

.project-card:hover {
  transform: translateY(-5px);
}

.project-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: var(--terminal-green);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.project-card:hover::before {
  transform: scaleX(1);
}

/**
 * Certification cards have smooth animations
 */
.certification-card:hover .cert-image img {
  transform: scale(1.05);
}

/**
 * Image placeholder has smooth transform
 */
.image-placeholder img {
  transition: transform 0.3s ease;
}

/**
 * Navigation links have terminal-style cursor blink
 */
.terminal-nav a::after {
  content: "_";
  position: absolute;
  right: -5px;
  animation: blink 1s infinite;
}

/**
 * Typing effect animation for terminal
 */
.typing-effect::after {
  content: "|";
  position: absolute;
  right: -5px;
  animation: blink 1s infinite;
}
