/* Animations CSS */

/* Glitch Text Effect */
.glitch {
  position: relative;
  animation: glitch 1s linear infinite;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.glitch::before {
  left: 2px;
  text-shadow: -2px 0 var(--accent-color);
  clip: rect(44px, 450px, 56px, 0);
  animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
  left: -2px;
  text-shadow: -2px 0 var(--primary-color);
  clip: rect(44px, 450px, 56px, 0);
  animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch {
  2%, 64% {
    transform: translate(2px, 0) skew(0deg);
  }
  4%, 60% {
    transform: translate(-2px, 0) skew(0deg);
  }
  62% {
    transform: translate(0, 0) skew(5deg);
  }
}

@keyframes glitch-anim {
  0% {
    clip: rect(31px, 9999px, 94px, 0);
  }
  5% {
    clip: rect(70px, 9999px, 71px, 0);
  }
  10% {
    clip: rect(29px, 9999px, 83px, 0);
  }
  15% {
    clip: rect(16px, 9999px, 91px, 0);
  }
  20% {
    clip: rect(2px, 9999px, 23px, 0);
  }
  25% {
    clip: rect(60px, 9999px, 73px, 0);
  }
  30% {
    clip: rect(14px, 9999px, 56px, 0);
  }
  35% {
    clip: rect(89px, 9999px, 25px, 0);
  }
  40% {
    clip: rect(32px, 9999px, 26px, 0);
  }
  45% {
    clip: rect(67px, 9999px, 96px, 0);
  }
  50% {
    clip: rect(7px, 9999px, 13px, 0);
  }
  55% {
    clip: rect(14px, 9999px, 76px, 0);
  }
  60% {
    clip: rect(67px, 9999px, 66px, 0);
  }
  65% {
    clip: rect(96px, 9999px, 58px, 0);
  }
  70% {
    clip: rect(78px, 9999px, 81px, 0);
  }
  75% {
    clip: rect(8px, 9999px, 1px, 0);
  }
  80% {
    clip: rect(7px, 9999px, 44px, 0);
  }
  85% {
    clip: rect(53px, 9999px, 35px, 0);
  }
  90% {
    clip: rect(69px, 9999px, 88px, 0);
  }
  95% {
    clip: rect(83px, 9999px, 64px, 0);
  }
  100% {
    clip: rect(10px, 9999px, 88px, 0);
  }
}

@keyframes glitch-anim2 {
  0% {
    clip: rect(65px, 9999px, 100px, 0);
  }
  5% {
    clip: rect(52px, 9999px, 74px, 0);
  }
  10% {
    clip: rect(79px, 9999px, 85px, 0);
  }
  15% {
    clip: rect(75px, 9999px, 5px, 0);
  }
  20% {
    clip: rect(67px, 9999px, 61px, 0);
  }
  25% {
    clip: rect(14px, 9999px, 79px, 0);
  }
  30% {
    clip: rect(1px, 9999px, 66px, 0);
  }
  35% {
    clip: rect(86px, 9999px, 30px, 0);
  }
  40% {
    clip: rect(23px, 9999px, 98px, 0);
  }
  45% {
    clip: rect(85px, 9999px, 72px, 0);
  }
  50% {
    clip: rect(71px, 9999px, 75px, 0);
  }
  55% {
    clip: rect(2px, 9999px, 48px, 0);
  }
  60% {
    clip: rect(30px, 9999px, 16px, 0);
  }
  65% {
    clip: rect(59px, 9999px, 50px, 0);
  }
  70% {
    clip: rect(41px, 9999px, 62px, 0);
  }
  75% {
    clip: rect(2px, 9999px, 82px, 0);
  }
  80% {
    clip: rect(47px, 9999px, 73px, 0);
  }
  85% {
    clip: rect(3px, 9999px, 27px, 0);
  }
  90% {
    clip: rect(26px, 9999px, 55px, 0);
  }
  95% {
    clip: rect(42px, 9999px, 97px, 0);
  }
  100% {
    clip: rect(38px, 9999px, 49px, 0);
  }
}

/* Orbit Animations */
@keyframes rotate {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

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

/* Scroll Down Animation */
@keyframes scroll {
  0% {
    opacity: 0;
    transform: rotate(45deg) translate(-20px, -20px);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(45deg) translate(20px, 20px);
  }
}

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

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

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

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

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

/* Pulse Animation */
@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(138, 43, 226, 0.7);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(138, 43, 226, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(138, 43, 226, 0);
  }
}

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

/* Glow Animation */
@keyframes glow {
  0% {
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.8);
  }
  100% {
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
  }
}

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

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

/* Animation Classes */
.fade-in {
  animation: fadeIn 1s ease forwards;
}

.slide-up {
  animation: slideUp 1s ease forwards;
}

.slide-down {
  animation: slideDown 1s ease forwards;
}

.slide-left {
  animation: slideLeft 1s ease forwards;
}

.slide-right {
  animation: slideRight 1s ease forwards;
}

.pulse {
  animation: pulse 2s infinite;
}

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

.glow {
  animation: glow 2s ease-in-out infinite;
}

/* Animation Delays */
.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;
}

/* Animated Elements */
.hero-content h1 {
  opacity: 0;
  animation: fadeIn 1s ease forwards;
}

.hero-content h2 {
  opacity: 0;
  animation: fadeIn 1s ease 0.3s forwards;
}

.hero-content p {
  opacity: 0;
  animation: fadeIn 1s ease 0.6s forwards;
}

.hero-buttons {
  opacity: 0;
  animation: fadeIn 1s ease 0.9s forwards;
}

.section-header {
  opacity: 0;
  animation: slideDown 1s ease forwards;
}

.about-text, .about-cards, .skills-tabs, .tech-grid, .project-carousel, .projects-grid, .contact-form, .contact-info {
  opacity: 0;
  animation: slideUp 1s ease 0.3s forwards;
}

.info-card, .tech-item, .project-card, .social-item {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.info-card:hover, .tech-item:hover, .project-card:hover, .social-item:hover {
  animation: pulse 2s infinite;
}

.skill-progress {
  animation: slideRight 1.5s ease forwards;
}

/* Animated Background Elements */
.hero-section::before, .hero-section::after, 
.about-section::before, .skills-section::before, 
.projects-section::before, .contact-section::before {
  animation: fadeIn 2s ease forwards;
}
