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

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

@keyframes blink {
    50% { border-color: transparent }
}

/* Apply typing animation to .typing class */
.typing {
    display: inline-block;
    overflow: hidden;
    border-right: 2px solid var(--text-color);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end);
}

/* Add a separate class for cursor animation */
.typing-cursor {
    border-right: 2px solid var(--text-color);
    animation: blink 0.75s step-end infinite;
}

/* Stagger fade in animation for cards */
.card {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.card:nth-child(1) { animation-delay: 0.2s; }
.card:nth-child(2) { animation-delay: 0.4s; }
.card:nth-child(3) { animation-delay: 0.6s; }
.card:nth-child(4) { animation-delay: 0.8s; }

/* Social Links Animation */
.social-links {
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 1s;
}

/* Navigation Indicator Animation */
.nav-indicator {
    position: absolute;
    top: 0;
    height: 3px;
    background: var(--primary-color);
    transition: all 0.3s ease;
}

/* Smooth Page Transitions */
.page-transition {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards;
}

/* Background Gradient Animation */
@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.hero {
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

/* Card Hover Effect */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        45deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.card:hover::before {
    transform: translateX(100%);
}

/* Skill Card Flip Animation */
@keyframes flipIn {
    from {
        transform: perspective(400px) rotateY(90deg);
        opacity: 0;
    }
    to {
        transform: perspective(400px) rotateY(0deg);
        opacity: 1;
    }
}

.flip-in {
    animation: flipIn 0.6s ease-out forwards;
}

/* Progress Bar Animation */
@keyframes progressFill {
    from { width: 0; }
    to { width: var(--progress); }
}

.progress-bar-fill {
    animation: progressFill 1.5s ease-out forwards;
}

/* Navbar Scroll Animation */
@keyframes navbarShrink {
    from {
        height: var(--navbar-height);
        background: rgba(255, 255, 255, 0.8);
    }
    to {
        height: var(--navbar-collapsed-height);
        background: rgba(255, 255, 255, 0.95);
    }
}

.navbar.scrolled {
    animation: navbarShrink 0.3s ease forwards;
}
