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

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

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

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

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

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

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

/* Apply animations to elements */
.animate-from-left {
  animation: slideInLeft 1s ease forwards;
}

.animate-from-right {
  animation: slideInRight 1s ease forwards;
}

.animate-from-bottom {
  animation: slideInUp 1s ease forwards;
}

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

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

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

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

/* Animated button */
.animate-btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.animate-btn:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transition: all 0.6s ease;
}

.animate-btn:hover:before {
  left: 100%;
}

/* Scroll-triggered animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

/* Skill progress bar animation */
@keyframes fillProgress {
  from {
    width: 0;
  }
  to {
    width: var(--progress-width);
  }
}

.skill-progress-bar.animated {
  animation: fillProgress 1.5s ease forwards;
}

/* AI Assistant animations */
.ai-icon {
  animation: pulse 2s infinite;
}

.chat-container.show {
  display: flex;
  animation: fadeIn 0.3s ease forwards;
}

.message {
  animation: fadeIn 0.5s ease forwards;
}

/* Timeline animation */
.timeline-dot {
  position: relative;
}

.timeline-dot:before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: rgba(67, 97, 238, 0.3);
  animation: pulse 2s infinite;
}

/* Project card hover animation */
.project-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* Tool icon hover animation */
.tool-icon {
  transition: all 0.3s ease;
}

.tool-item:hover .tool-icon {
  transform: translateY(-5px);
  background-color: rgba(67, 97, 238, 0.1);
}

/* Form input focus animation */
.form-control {
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25);
}

/* Navigation hover animation */
.nav-link {
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--primary-color);
}

/* Social icon hover animation */
.social-icon {
  transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.social-icon:hover {
  transform: translateY(-5px) rotate(360deg);
}

/* Animate the hero section on page load */
.hero-section .content-col,
.hero-section .image-col {
  opacity: 0;
}

.hero-section .content-col {
  animation: slideInLeft 1s ease 0.5s forwards;
}

.hero-section .image-col {
  animation: slideInRight 1s ease 0.5s forwards;
}

/* Hover effect for cards */
.service-card,
.skills-card,
.info-card,
.contact-info-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover,
.skills-card:hover,
.info-card:hover,
.contact-info-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* Loading animation for map placeholder */
.map-placeholder .map-text i {
  animation: pulse 2s infinite;
}

/* Typing animation for AI assistant */
@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.typing {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  animation: typing 1.5s steps(40, end);
}

/* Page transition animation */
.page-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--primary-color);
  z-index: 9999;
  transform: translateY(100%);
  transition: transform 0.5s ease;
}

.page-transition.active {
  transform: translateY(0);
}

.page-transition.exit {
  transform: translateY(-100%);
}