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

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

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

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

/* Mobile Menu Styles */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 300px;
    height: 100vh;
    background-color: var(--primary-dark);
    z-index: 1001;
    padding: 80px 20px 20px;
    transition: right 0.3s ease;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
}

.mobile-nav.active {
    right: 0;
}

.mobile-nav .nav-links {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mobile-nav .nav-links a {
    color: white;
    font-size: 1.2rem;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: block;
}

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

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

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

/* Form Validation Styles */
.form-group input.error,
.form-group textarea.error {
    border-color: #ff3860;
    box-shadow: 0 0 0 2px rgba(255, 56, 96, 0.2);
}

.success-message {
    background-color: #23d160;
    color: white;
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
    animation: fadeIn 0.5s ease;
}

/* Hover Animations */
.social-links a:hover i {
    animation: spin 0.5s ease;
}

.btn:hover {
    animation: pulse 0.5s ease;
}

/* Section Animations */
.hero-content h1,
.hero-content h2,
.hero-content p {
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.hero-content h1 {
    animation-delay: 0.2s;
}

.hero-content h2 {
    animation-delay: 0.4s;
}

.hero-content p {
    animation-delay: 0.6s;
}

.hero-buttons {
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.8s forwards;
}

.hero-image {
    opacity: 0;
    animation: fadeIn 1s ease 0.5s forwards;
}

/* Mobile skill animations */
@keyframes mobileSkillPulse {
    0% {
        transform: translateY(0) scale(1);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    }
    50% {
        transform: translateY(-10px) scale(1.08);
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    }
    100% {
        transform: translateY(-10px) scale(1.08);
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    }
}

@keyframes mobileSkillBounce {
    0% {
        transform: translateY(-10px) scale(1.08);
    }
    25% {
        transform: translateY(-15px) scale(1.1);
    }
    50% {
        transform: translateY(-10px) scale(1.08);
    }
    75% {
        transform: translateY(-5px) scale(1.04);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

@keyframes mobilePulseGlow {
    0% {
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
        transform: translateY(0) scale(1);
    }
    50% {
        box-shadow: 0 15px 35px rgba(149, 146, 165, 0.4), 0 0 20px rgba(149, 146, 165, 0.3);
        transform: translateY(-10px) scale(1.08);
    }
    100% {
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
        transform: translateY(-10px) scale(1.08);
    }
}

/* Project cards scroll animations */
@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(60px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-60px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(60px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Mobile-specific smoother animations */
@keyframes mobileSlideInFromBottom {
    0% {
        opacity: 0;
        transform: translateY(80px) scale(0.9);
    }
    50% {
        opacity: 0.7;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mobile skill animation */
@keyframes mobileSkillSlideUp {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.92);
    }
    60% {
        opacity: 0.8;
        transform: translateY(10px) scale(0.97);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Enhanced mobile touch feedback */
@media (max-width: 768px) {
    .skill-item.active {
        animation: mobileSkillPulse 0.4s ease forwards;
    }
    
    .skill-item.removing {
        animation: mobileSkillBounce 0.6s ease forwards;
    }

    /* Add ripple effect for mobile clicks */
    .skill-item {
        position: relative;
        overflow: hidden;
    }

    .skill-item::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        background: rgba(255, 255, 255, 0.4);
        border-radius: 50%;
        transform: translate(-50%, -50%);
        transition: width 0.4s ease, height 0.4s ease;
        pointer-events: none;
    }

    .skill-item.active::after {
        width: 140%;
        height: 140%;
    }
}

/* Project cards animations */
.project-card.animate-slide-bottom {
    animation: slideInFromBottom 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    will-change: transform, opacity;
}

.project-card.animate-slide-left {
    animation: slideInFromLeft 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    will-change: transform, opacity;
}

.project-card.animate-slide-right {
    animation: slideInFromRight 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    will-change: transform, opacity;
}

/* Mobile-specific slower and smoother animations */
@media (max-width: 768px) {
    .project-card.animate-slide-bottom {
        animation: mobileSlideInFromBottom 1.0s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
        will-change: transform, opacity;
    }
    
    .project-card.animate-slide-left {
        animation: slideInFromLeft 1.0s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
        will-change: transform, opacity;
    }
    
    .project-card.animate-slide-right {
        animation: slideInFromRight 1.0s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
        will-change: transform, opacity;
    }

    /* Mobile skill animation */
    .skill-item.animate-skill-mobile {
        animation: mobileSkillSlideUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
        will-change: transform, opacity;
    }
    
    /* Remove will-change after animation completes to save memory */
    .project-card.animate-in,
    .skill-item.animate-in {
        animation-fill-mode: forwards;
    }
    
    .project-card.animate-in:not(.animating),
    .skill-item.animate-in:not(.animating) {
        will-change: auto;
    }
}
