/* 3D Effects and Animations */

/* Parallax Effect */
.parallax-effect {
  transform-style: preserve-3d;
  transform: perspective(1000px);
  transition: transform 0.3s ease;
}

/* Animated Title */
.animated-title {
  background: linear-gradient(90deg, var(--primary-blue), var(--accent-blue), var(--dark-blue), var(--primary-blue));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient 8s ease infinite;
  display: inline-block;
}

@keyframes gradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Hover Card Effect */
.project-card, .skill-card, .timeline-content, .contact-form, .resume-preview, .image-container {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Button Animation */
.btn {
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.1);
  z-index: -1;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s ease;
}

.btn:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Fade In Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

section {
  animation: fadeIn 0.8s ease-out forwards;
}

/* Staggered Animation for Grid Items */
.skills-grid > *,
.portfolio-grid > *,
.skills-container > * {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.6s ease-out forwards;
}

.skills-grid > *:nth-child(1),
.portfolio-grid > *:nth-child(1),
.skills-container > *:nth-child(1) {
  animation-delay: 0.1s;
}

.skills-grid > *:nth-child(2),
.portfolio-grid > *:nth-child(2),
.skills-container > *:nth-child(2) {
  animation-delay: 0.2s;
}

.skills-grid > *:nth-child(3),
.portfolio-grid > *:nth-child(3),
.skills-container > *:nth-child(3) {
  animation-delay: 0.3s;
}

.skills-grid > *:nth-child(4),
.portfolio-grid > *:nth-child(4),
.skills-container > *:nth-child(4) {
  animation-delay: 0.4s;
}

.skills-grid > *:nth-child(n+5),
.portfolio-grid > *:nth-child(n+5),
.skills-container > *:nth-child(n+5) {
  animation-delay: 0.5s;
}

/* 3D Hover Effect for Cards */
.project-card:hover,
.skill-card:hover,
.timeline-content:hover {
  transform: translateY(-10px) rotateX(5deg);
}

/* Loading Animation */
.loading {
  display: inline-block;
  position: relative;
  width: 80px;
  height: 80px;
}

.loading:after {
  content: " ";
  display: block;
  border-radius: 50%;
  width: 0;
  height: 0;
  margin: 8px;
  box-sizing: border-box;
  border: 32px solid var(--primary-blue);
  border-color: var(--primary-blue) transparent var(--primary-blue) transparent;
  animation: loading 1.2s infinite;
}

@keyframes loading {
  0% {
    transform: rotate(0);
    animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
  }
  50% {
    transform: rotate(900deg);
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
  }
  100% {
    transform: rotate(1800deg);
  }
}

/* 3D Tilt Effect on Mouse Move */
.tilt-element {
  transform-style: preserve-3d;
  transform: perspective(1000px);
}

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

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

/* Glowing Border Animation */
@keyframes glow {
  0% {
    box-shadow: 0 0 5px rgba(26, 115, 232, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(26, 115, 232, 0.8);
  }
  100% {
    box-shadow: 0 0 5px rgba(26, 115, 232, 0.5);
  }
}

.glow-on-hover:hover {
  animation: glow 1.5s infinite;
}

/* Mouse Parallax Effect */
.mouse-parallax {
  transition: transform 0.2s ease-out;
}

/* Shine Effect */
.shine {
  position: relative;
  overflow: hidden;
}

.shine::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to right, 
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(30deg);
  animation: shine 3s infinite;
}

@keyframes shine {
  0% {
    transform: translateX(-100%) rotate(30deg);
  }
  100% {
    transform: translateX(100%) rotate(30deg);
  }
}

/* Blur In Animation */
@keyframes blurIn {
  0% {
    filter: blur(20px);
    opacity: 0;
  }
  100% {
    filter: blur(0);
    opacity: 1;
  }
}

.blur-in {
  animation: blurIn 1s ease forwards;
}