/* 
=========================================
   Portfolio Animations - Improved Version
=========================================
*/

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

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

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

/* Slide In From Bottom */
@keyframes slideInBottom {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Subtle Bounce Animation */
@keyframes subtleBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Glow Animation (replacing pulse) */
@keyframes glow {
  0% {
    filter: drop-shadow(0 0 0 rgba(61, 220, 132, 0));
  }
  50% {
    filter: drop-shadow(0 0 5px rgba(61, 220, 132, 0.5));
  }
  100% {
    filter: drop-shadow(0 0 0 rgba(61, 220, 132, 0));
  }
}

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

/* Text Reveal Animation */
@keyframes textReveal {
  0% {
    clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
  }
  100% {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  }
}

/* Improved Typing Animation - Without Blinking Cursor */
@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

/* Pop Animation */
@keyframes pop {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  70% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Image Zoom Animation */
@keyframes imageZoom {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Spotlight Sweep Animation */
@keyframes spotlight {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

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

.animate-slide-left {
  opacity: 0;
  animation: slideInLeft 0.8s ease-out forwards;
}

.animate-slide-right {
  opacity: 0;
  animation: slideInRight 0.8s ease-out forwards;
}

.animate-slide-bottom {
  opacity: 0;
  animation: slideInBottom 0.8s ease-out forwards;
}

.animate-subtle-bounce {
  animation: subtleBounce 3s ease-in-out infinite;
}

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

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

.animate-text-reveal {
  clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
  animation: textReveal 1.2s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

.animate-typing {
  display: inline-block;
  overflow: visible !important;
  white-space: nowrap;
  width: 0;
  animation: typing 3.5s steps(40, end) forwards;
  position: relative;
  font-weight: 500;
  color: var(--text-dark) !important;
}

/* Dark mode typing animation */
.dark-mode .animate-typing {
  color: var(--dark-text-dark) !important;
}

/* Ensure the underline effect remains */
.hero p.animate-typing::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  bottom: -8px;
  left: 0;
  background: linear-gradient(90deg, var(--primary-color), transparent);
  transform-origin: left;
  transform: scaleX(0);
  animation: lineReveal 0.8s ease forwards;
  animation-delay: 3.5s;
}

.dark-mode .hero p.animate-typing::after {
  background: linear-gradient(90deg, var(--dark-primary-color), transparent);
}

.animate-pop {
  animation: pop 0.5s cubic-bezier(0.26, 0.53, 0.74, 1.48) forwards;
  opacity: 0;
}

.animate-image-zoom {
  animation: imageZoom 15s ease-in-out infinite;
}

.animate-spotlight {
  position: relative;
  color: #0d6e3e; /* Dark green text color */
  background: linear-gradient(
    90deg, 
    rgba(13, 110, 62, 1) 0%, 
    rgba(8, 48, 66, 1) 50%, 
    rgba(13, 110, 62, 1) 100%
  );
  background-size: 200% 100%;
  animation: spotlight 2.5s ease-in infinite;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.1);
}

/* Animation Delays */
.delay-100 {
  animation-delay: 0.1s;
}

.delay-200 {
  animation-delay: 0.2s;
}

.delay-300 {
  animation-delay: 0.3s;
}

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

.delay-500 {
  animation-delay: 0.5s;
}

/* Hover Animations */
.hover-grow {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-grow:hover {
  transform: scale(1.03);
}

.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Original Service Card Animation (restored) */
.service-card {
  position: relative;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out,
              box-shadow 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
  z-index: 1;
}

.service-card.animate {
  opacity: 1;
  transform: translateY(0);
}

/* Enhanced Service Card Styles */
.service-card:before {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(61, 220, 132, 0.1) 0%, rgba(66, 133, 244, 0.05) 100%);
  transition: top 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  z-index: -1;
}

.service-card:hover:before {
  top: 0;
}

.service-card:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background: var(--primary-color);
  transition: width 0.4s ease, left 0.4s ease;
  z-index: 1;
}

.service-card:hover:after {
  width: 100%;
  left: 0;
}

.service-content {
  position: relative;
  transition: transform 0.3s ease;
}

.service-card:hover .service-content {
  transform: translateY(-10px);
}

.service-hover-info {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.6s ease, opacity 0.6s ease, margin 0.3s ease;
  margin-top: 0;
}

.service-card:hover .service-hover-info {
  max-height: 200px;
  opacity: 1;
  margin-top: 10px;
}

.service-hover-info p {
  font-size: 0.9em;
  margin: 5px 0;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.service-card:hover .service-hover-info p {
  transform: translateY(0);
  opacity: 1;
}

.service-card:hover .service-hover-info p:nth-child(1) {
  transition-delay: 0.1s;
}

.service-card:hover .service-hover-info p:nth-child(2) {
  transition-delay: 0.2s;
}

.service-card:hover .service-hover-info p:nth-child(3) {
  transition-delay: 0.3s;
}

.dark-mode .service-card:before {
  background: linear-gradient(135deg, rgba(77, 248, 156, 0.1) 0%, rgba(92, 156, 255, 0.05) 100%);
}

.dark-mode .service-card:after {
  background: var(--dark-primary-color);
}

/* Improved Project Card Animations */
.project-card {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.project-card.animate {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animations for service/project cards */
.service-card:nth-child(1),
.project-card:nth-child(1) {
  transition-delay: 0.1s;
}

.service-card:nth-child(2),
.project-card:nth-child(2) {
  transition-delay: 0.2s;
}

.service-card:nth-child(3),
.project-card:nth-child(3) {
  transition-delay: 0.3s;
}

.service-card:nth-child(4),
.project-card:nth-child(4) {
  transition-delay: 0.4s;
}

.service-card:nth-child(5),
.project-card:nth-child(5) {
  transition-delay: 0.5s;
}

.service-card:nth-child(6),
.project-card:nth-child(6) {
  transition-delay: 0.6s;
}

/* Skill Bar Animation Enhancements */
.skill-level {
  transition: width 1.5s cubic-bezier(0.19, 1, 0.22, 1);
}

/* Button Hover Effects */
.btn {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}

.btn:after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.4s ease;
}

.btn:hover:after {
  left: 100%;
}

/* Navigation Link Animations */
nav ul li a {
  position: relative;
  transition: color 0.3s ease;
}

nav ul li a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

nav ul li a:hover::after {
  width: 100%;
}

.dark-mode nav ul li a::after {
  background-color: var(--dark-primary-color);
}

/* Hamburger Menu Animation */
.hamburger .bar {
  transition: all 0.3s ease-in-out;
}

.hamburger.active .bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger.active .bar:nth-child(2) {
  opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Scroll Indicator Animation */
.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
}

.mouse {
  width: 26px;
  height: 40px;
  border: 2px solid var(--primary-color);
  border-radius: 20px;
  display: flex;
  justify-content: center;
  margin-bottom: 5px;
}

.wheel {
  width: 3px;
  height: 8px;
  background-color: var(--primary-color);
  border-radius: 3px;
  margin-top: 5px;
  animation: mouseWheel 1.5s ease-in-out infinite;
}

@keyframes mouseWheel {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(15px);
    opacity: 0;
  }
}

.arrows {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.arrows span {
  display: block;
  width: 10px;
  height: 10px;
  border-bottom: 2px solid var(--primary-color);
  border-right: 2px solid var(--primary-color);
  transform: rotate(45deg);
  margin: -6px;
  animation: scrollArrow 2s infinite;
}

.arrows span:nth-child(2) {
  animation-delay: -0.2s;
}

.arrows span:nth-child(3) {
  animation-delay: -0.4s;
}

@keyframes scrollArrow {
  0% {
    opacity: 0;
    transform: rotate(45deg) translate(-5px, -5px);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(45deg) translate(5px, 5px);
  }
}

.dark-mode .mouse {
  border-color: var(--dark-primary-color);
}

.dark-mode .wheel,
.dark-mode .arrows span {
  background-color: var(--dark-primary-color);
  border-color: var(--dark-primary-color);
}

/* Skill Bars Reveal */
.skill-reveal .skill-bar {
  position: relative;
  overflow: hidden;
}

.skill-reveal .skill-level {
  transform: translateX(-100%);
  animation: skillReveal 1.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

@keyframes skillReveal {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(0);
  }
}

/* Service Icon Animation */
.service-icon i {
  display: inline-block;
  transition: transform 0.5s ease;
}

.service-card:hover .service-icon i {
  transform: scale(1.2) rotate(10deg);
}

/* Social Icons Animation */
.social-icon i {
  transition: transform 0.3s ease;
}

.social-icon:hover i {
  transform: rotate(360deg);
}

/* Button Special Effect */
.btn-special-effect {
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn-special-effect:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: 0.5s;
  z-index: -1;
}

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

/* 3D Tilt Effect */
.tilt-effect {
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

.tilt-effect:hover {
  transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

/* Progress Animation for Circular Progress */
.circle-progress-animation {
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  animation: circleProgress 2s ease-in-out forwards;
}

@keyframes circleProgress {
  to {
    stroke-dashoffset: calc(283 - (283 * var(--percent)) / 100);
  }
}

/* Active state classes for JavaScript-triggered animations */
.animate-text-reveal.active {
  animation: textReveal 1.2s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

.animate-pop.active {
  animation: pop 0.5s cubic-bezier(0.26, 0.53, 0.74, 1.48) forwards;
}

/* Special animation for page load effect */
.page-load-animation {
  animation: fadeIn 1.5s ease-out;
}

/* Fixes for dark mode with spotlight effect */
.dark-mode .animate-spotlight {
  background: none;
  color: #fff;
  text-shadow: 0 0 3px rgba(77, 248, 156, 0.3);
}

/* Hero Heading Animation Enhancement */
.hero h1 .animate-text-reveal {
  background: linear-gradient(90deg, var(--primary-color), #4285F4);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent; 
  display: inline-block;
  font-weight: 700;
  text-shadow: 0px 2px 10px rgba(61, 220, 132, 0.2);
}

/* Fallback for browsers that don't support background-clip: text */
@supports not (background-clip: text) {
  .hero h1 .animate-text-reveal {
    color: var(--primary-color);
    background: none;
  }
}

/* Override the gradient text for better visibility */
.hero h1 {
  color: var(--primary-color);
  font-size: 3.5rem;
}

.hero h1 .animate-text-reveal {
  color: var(--primary-color);
  background: none;
  animation: textReveal 1.2s cubic-bezier(0.77, 0, 0.175, 1) forwards;
  position: relative;
}

.hero h1 .animate-text-reveal::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), #4285F4);
  transform: scaleX(0);
  transform-origin: left;
  animation: lineReveal 1s ease forwards;
  animation-delay: 1.2s;
}

@keyframes lineReveal {
  to {
    transform: scaleX(1);
  }
}

.dark-mode .hero h1 .animate-text-reveal {
  background: linear-gradient(90deg, var(--dark-primary-color), #5C9CFF);
  background-size: 200% 200%;
  text-shadow: 0px 2px 10px rgba(77, 248, 156, 0.2);
}

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

.service-card:hover {
  animation: floatingCard 3s ease-in-out infinite;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
}

.dark-mode .service-card:hover {
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

/* Simple hero heading animation */
.hero h1 {
  position: relative;
  display: inline-block;
  animation: fadeUpIn 1s ease-out forwards;
}

@keyframes fadeUpIn {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero h1::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -10px;
  width: 50%;
  height: 4px;
  background: var(--primary-color);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s ease;
  animation: lineGrow 1s ease forwards 0.5s;
}

@keyframes lineGrow {
  0% {
    transform: scaleX(0);
  }
  100% {
    transform: scaleX(1);
  }
}

.dark-mode .hero h1::after {
  background: var(--dark-primary-color);
}

/* Line Reveal Animation */
@keyframes lineReveal {
  to {
    transform: scaleX(1);
  }
}

.dark-mode .hero p.animate-typing {
  border-right-color: var(--dark-primary-color);
}

.dark-mode .hero p.animate-typing::after {
  background: linear-gradient(90deg, var(--dark-primary-color), transparent);
}

/* Ensure subheading container has enough height */
.subheading-container {
  margin-bottom: 2.5rem;
  min-height: 6rem !important;
  position: relative;
  overflow: visible !important;
}

/* Skill Tag Animations - REMOVED TO FIX VISIBILITY ISSUE */
/*
.skill-tag {
    opacity: 0;
    transform: translateY(20px);
}

.skill-tag.animate {
    animation: fadeUpSkill 0.5s ease-out forwards;
}

@keyframes fadeUpSkill {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.skills-tags .skill-tag:nth-child(1) { animation-delay: 0.1s; }
.skills-tags .skill-tag:nth-child(2) { animation-delay: 0.2s; }
.skills-tags .skill-tag:nth-child(3) { animation-delay: 0.3s; }
.skills-tags .skill-tag:nth-child(4) { animation-delay: 0.4s; }
.skills-tags .skill-tag:nth-child(5) { animation-delay: 0.5s; }
.skills-tags .skill-tag:nth-child(6) { animation-delay: 0.6s; }
*/ 