/* Animations and Transitions */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Fade in animation for page load */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

/* Scale in animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Particle floating animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Glow effect */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px var(--secondary-color);
    }
    50% {
        box-shadow: 0 0 20px var(--secondary-color), 0 0 30px var(--secondary-color);
    }
}

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

/* Apply animations */
.hero-content {
    animation: fadeIn 1s ease-out;
}

.hero-content h1 {
    animation: slideInLeft 1s ease-out 0.2s both;
}

.hero-content p {
    animation: slideInRight 1s ease-out 0.4s both;
}

.cta-buttons {
    animation: fadeIn 1s ease-out 0.6s both;
}

.project-card {
    animation: scaleIn 0.6s ease-out both;
}

.project-card:nth-child(2) {
    animation-delay: 0.1s;
}

.project-card:nth-child(3) {
    animation-delay: 0.2s;
}

.project-card:nth-child(4) {
    animation-delay: 0.3s;
}

/* Hover animations */
.project-card:hover {
    animation: glow 2s infinite;
}

.btn {
    position: relative;
    overflow: hidden;
}

.btn::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: left 0.5s;
}

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

/* Intersection Observer animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Particle system animations */
.particle {
    position: absolute;
    background: var(--secondary-color);
    border-radius: 50%;
    pointer-events: none;
    animation: float 6s ease-in-out infinite;
}

.particle:nth-child(odd) {
    animation-direction: reverse;
}

.particle:nth-child(3n) {
    animation-duration: 8s;
}

.particle:nth-child(4n) {
    animation-duration: 4s;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-top: 2px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

/* Form animations */
.form-group input:focus,
.form-group textarea:focus {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

/* Navigation animations */
.nav-menu a {
    position: relative;
    overflow: hidden;
}

.nav-menu a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.1), transparent);
    transition: left 0.5s;
}

.nav-menu a:hover::before {
    left: 100%;
}