/* Animation CSS for Nathishwar's Portfolio Site */

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
}

/* Staggered fade-in effect for multiple elements */
.fade-in:nth-child(1) { animation-delay: 0.1s; }
.fade-in:nth-child(2) { animation-delay: 0.2s; }
.fade-in:nth-child(3) { animation-delay: 0.3s; }
.fade-in:nth-child(4) { animation-delay: 0.4s; }
.fade-in:nth-child(5) { animation-delay: 0.5s; }

/* Logo Animation */
@keyframes logoHighlight {
    0% { color: var(--primary-color); }
    50% { color: var(--accent-color); }
    100% { color: var(--primary-color); }
}

.logo-highlight {
    animation: logoHighlight 5s infinite;
}

/* Button Hover Effect */
.btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.2);
    transition: width 0.3s ease;
    z-index: -1;
}

.btn:hover:before {
    width: 100%;
}

/* Skill Bar Animation */
@keyframes skillProgress {
    from {
        width: 0;
    }
}

.progress-line span {
    animation: skillProgress 1.5s ease-in-out forwards;
}

/* Project Card Hover Animation */
.project-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.project-image img {
    transition: transform 0.5s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-content {
    transition: all 0.3s ease;
}

/* Social Media Icons Animation */
.social-links a {
    transition: transform 0.3s ease, color 0.3s ease;
}

.social-links a:hover {
    transform: translateY(-5px);
}

/* Navigation Item Hover Animation */
.nav-item {
    transition: all 0.3s ease;
}

.nav-item:hover {
    transform: translateY(-3px);
}

.nav-tooltip {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Back to Top Button Animation */
.back-to-top {
    transition: all 0.3s ease;
}

.back-to-top:hover {
    transform: translateY(-5px);
}

/* View All Projects Button Animation */
.view-all-btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.view-all-btn:hover {
    transform: translateX(5px);
}

.view-all-btn i {
    transition: transform 0.3s ease;
}

.view-all-btn:hover i {
    transform: translateX(5px);
}

/* Header Scroll Animation */
@keyframes shrinkHeader {
    from {
        padding: 20px 0;
    }
    to {
        padding: 10px 0;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }
}

.header-scrolled {
    animation: shrinkHeader 0.3s forwards;
}

/* Blink Animation for Active Nav Item */
@keyframes activeBlink {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

.nav-item.active i {
    animation: activeBlink 2s infinite;
}

/* Text Highlight Animation */
@keyframes textHighlight {
    0% { color: var(--text-color); }
    50% { color: var(--accent-color); }
    100% { color: var(--text-color); }
}

.highlight {
    animation: textHighlight 5s ease infinite;
}

/* Pulse Animation */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Typing Animation for Hero */
@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--accent-color); }
}

.typing-animation {
    overflow: hidden;
    border-right: 3px solid var(--accent-color);
    white-space: nowrap;
    margin: 0 auto;
    animation: 
        typing 3.5s steps(40, end),
        blink-caret 0.75s step-end infinite;
}

/* Contact Item Hover Animation */
.contact-item {
    transition: transform 0.3s ease;
}

.contact-item:hover {
    transform: translateX(5px);
}

.contact-item i {
    transition: transform 0.3s ease;
}

.contact-item:hover i {
    transform: rotate(15deg);
}

/* Footer Link Animation */
.footer-links li a {
    transition: all 0.3s ease;
    position: relative;
}

.footer-links li a:before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.footer-links li a:hover:before {
    width: 100%;
}

/* Animation for page transitions */
@keyframes pageTransition {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

body {
    animation: pageTransition 0.5s ease-out;
}







/* Image hover animation */
.about-image img, .hero-image img {
    transition: transform 0.5s ease;
}

.about-image:hover img, .hero-image:hover img {
    transform: scale(1.05);
}

/* Scroll reveal animation - work with JS */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Animated underline for section titles */
.section-title h2 {
    position: relative;
}

.section-title h2:after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -10px;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.section-title:hover h2:after {
    width: 100px;
}

/* Add animation for mobile menu */
@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.mobile-menu-open {
    animation: slideDown 0.3s forwards;
}