/* ===============================================
   ANIMATIONS CSS - Vaibhav Naware Portfolio
   Smooth, Modern Animations & Transitions
   =============================================== */

/* ===============================================
   KEYFRAME ANIMATIONS
   =============================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply fade-in to all sections */
section {
    animation: fadeInUp 0.8s ease-out;
}

/* Card entrance animations with stagger */
.project-card,
.award-card,
.publication-item,
.certification-card,
.education-item,
.timeline-item {
    animation: fadeInUp 0.6s ease-out backwards;
}

.project-card:nth-child(1),
.award-card:nth-child(1),
.education-item:nth-child(1),
.timeline-item:nth-child(1) { animation-delay: 0.1s; }

.project-card:nth-child(2),
.award-card:nth-child(2),
.education-item:nth-child(2),
.timeline-item:nth-child(2) { animation-delay: 0.2s; }

.project-card:nth-child(3),
.award-card:nth-child(3),
.education-item:nth-child(3),
.timeline-item:nth-child(3) { animation-delay: 0.3s; }

.award-card:nth-child(4),
.timeline-item:nth-child(4) { animation-delay: 0.4s; }

.award-card:nth-child(5),
.timeline-item:nth-child(5) { animation-delay: 0.5s; }

.award-card:nth-child(6),
.timeline-item:nth-child(6) { animation-delay: 0.6s; }

.timeline-item:nth-child(7) { animation-delay: 0.7s; }


@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    40% {
        transform: translateY(-10px) translateX(-50%);
    }
    60% {
        transform: translateY(-5px) translateX(-50%);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px var(--primary-color), 0 0 10px var(--primary-color), 0 0 15px var(--primary-color);
    }
    50% {
        box-shadow: 0 0 10px var(--primary-color), 0 0 20px var(--primary-color), 0 0 25px var(--primary-color);
    }
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

@keyframes rotateIn {
    from {
        transform: rotate(-200deg);
        opacity: 0;
    }
    to {
        transform: rotate(0deg);
        opacity: 1;
    }
}

@keyframes flipInX {
    from {
        transform: perspective(400px) rotateX(90deg);
        opacity: 0;
    }
    to {
        transform: perspective(400px) rotateX(0deg);
        opacity: 1;
    }
}

@keyframes rubberBand {
    from {
        transform: scale(1);
    }
    30% {
        transform: scale(1.25, 0.75);
    }
    40% {
        transform: scale(0.75, 1.25);
    }
    50% {
        transform: scale(1.15, 0.85);
    }
    65% {
        transform: scale(0.95, 1.05);
    }
    75% {
        transform: scale(1.05, 0.95);
    }
    to {
        transform: scale(1);
    }
}

/* ===============================================
   HERO SECTION ANIMATIONS
   =============================================== */

.hero-name {
    animation: fadeInUp 1s ease 0.2s both;
}

.hero-tagline {
    animation: fadeInUp 1s ease 0.4s both;
}

.hero-bio {
    animation: fadeInUp 1s ease 0.6s both;
}

.hero-buttons {
    animation: fadeInUp 1s ease 0.8s both;
}

.scroll-indicator {
    animation: bounce 2s infinite;
}

/* Background animation */
.hero-background::before {
    animation: float 6s ease-in-out infinite;
}

/* ===============================================
   NAVIGATION ANIMATIONS
   =============================================== */

.navbar {
    animation: slideInDown 0.8s ease both;
}

.nav-link {
    position: relative;
    transition: color var(--transition-fast);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width var(--transition-fast);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* ===============================================
   SECTION ANIMATIONS (ON SCROLL)
   =============================================== */

.section-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.section-animate.animate {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.section-divider {
    width: 0;
    animation: expandWidth 1s ease 0.3s forwards;
}

@keyframes expandWidth {
    to {
        width: 60px;
    }
}

/* ===============================================
   CARD ANIMATIONS
   =============================================== */

.skill-item {
    transition: all var(--transition-normal);
    animation: fadeInUp 0.6s ease both;
}

.skill-item:hover {
    transform: translateY(-8px);
    animation: pulse 0.6s ease;
}

.project-card {
    transition: all var(--transition-normal);
    animation: scaleIn 0.6s ease both;
}

.project-card:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-large);
}

.media-card,
.testimonial-card {
    transition: all var(--transition-normal);
    animation: fadeInUp 0.6s ease both;
}

.media-card:hover,
.testimonial-card:hover {
    transform: translateY(-6px);
}

/* ===============================================
   GALLERY ANIMATIONS
   =============================================== */

.gallery-item {
    transition: transform 0.2s ease;
}

.gallery-item:hover {
    transform: translateY(-4px);
}

.gallery-image img {
    transition: transform 0.3s ease;
}

.gallery-overlay {
    transition: opacity 0.2s ease;
}

/* ===============================================
   TIMELINE ANIMATIONS
   =============================================== */

.timeline-item {
    animation: fadeInLeft 0.8s ease both;
}

.timeline-item:nth-child(even) {
    animation: fadeInRight 0.8s ease both;
}

.achievement-icon {
    animation: rotateIn 0.8s ease both;
    animation-delay: 0.3s;
}

/* ===============================================
   FORM ANIMATIONS
   =============================================== */

.form-group {
    animation: fadeInUp 0.6s ease both;
}

.form-group input,
.form-group textarea {
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(0, 112, 243, 0.1);
}

/* ===============================================
   BUTTON ANIMATIONS
   =============================================== */

.btn {
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

/* ===============================================
   LOADING ANIMATIONS
   =============================================== */

.loading-shimmer {
    background: linear-gradient(90deg, var(--background-card) 25%, var(--border-color) 50%, var(--background-card) 75%);
    background-size: 200px 100%;
    animation: shimmer 2s infinite;
}

.loading-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ===============================================
   ICON ANIMATIONS
   =============================================== */

.social-link {
    transition: all var(--transition-normal);
}

.social-link:hover {
    transform: translateY(-3px) rotate(5deg);
    animation: rubberBand 0.8s ease;
}

.skill-item i,
.achievement-icon i,
.fact-item i {
    transition: all var(--transition-fast);
}

.skill-item:hover i {
    transform: scale(1.2);
    color: var(--primary-color);
}

.achievement-icon:hover {
    animation: pulse 0.6s ease;
}

/* ===============================================
   TEXT ANIMATIONS
   =============================================== */

.typing-effect {
    overflow: hidden;
    border-right: 2px solid var(--primary-color);
    white-space: nowrap;
    margin: 0 auto;
    animation: typing 3.5s steps(40, end), blink 0.75s step-end infinite;
}

.fade-in-word {
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

.fade-in-word:nth-child(1) { animation-delay: 0.1s; }
.fade-in-word:nth-child(2) { animation-delay: 0.2s; }
.fade-in-word:nth-child(3) { animation-delay: 0.3s; }
.fade-in-word:nth-child(4) { animation-delay: 0.4s; }
.fade-in-word:nth-child(5) { animation-delay: 0.5s; }

/* ===============================================
   SCROLL ANIMATIONS
   =============================================== */

.scroll-to-top {
    transition: all var(--transition-normal);
}

.scroll-to-top.show {
    animation: slideInUp 0.4s ease;
}

.scroll-to-top:hover {
    animation: pulse 0.6s ease;
}

/* ===============================================
   STAGGERED ANIMATIONS
   =============================================== */

.stagger-animation {
    animation: fadeInUp 0.6s ease both;
}

.stagger-animation:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation:nth-child(5) { animation-delay: 0.5s; }
.stagger-animation:nth-child(6) { animation-delay: 0.6s; }
.stagger-animation:nth-child(7) { animation-delay: 0.7s; }
.stagger-animation:nth-child(8) { animation-delay: 0.8s; }

/* ===============================================
   HOVER EFFECTS
   =============================================== */

.hover-glow:hover {
    animation: glow 1.5s ease-in-out infinite alternate;
}

.hover-bounce:hover {
    animation: bounce 0.6s ease;
}

.hover-shake:hover {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    10%, 90% {
        transform: translate3d(-1px, 0, 0);
    }
    20%, 80% {
        transform: translate3d(2px, 0, 0);
    }
    30%, 50%, 70% {
        transform: translate3d(-4px, 0, 0);
    }
    40%, 60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* ===============================================
   PARALLAX EFFECTS
   =============================================== */

.parallax-element {
    transform: translateZ(0);
    transition: transform 0.1s ease-out;
}

/* ===============================================
   INTERSECTION OBSERVER ANIMATIONS
   =============================================== */

.fade-in-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.fade-in-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s ease;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s ease;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s ease;
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* ===============================================
   REDUCED MOTION PREFERENCES
   =============================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .hero-background::before {
        animation: none;
    }
    
    .scroll-indicator {
        animation: none;
    }
    
    .btn::before {
        display: none;
    }
}

/* ===============================================
   ANIMATION UTILITIES
   =============================================== */

.animate-fast { animation-duration: 0.3s !important; }
.animate-slow { animation-duration: 1.5s !important; }
.animate-delay-1 { animation-delay: 0.1s !important; }
.animate-delay-2 { animation-delay: 0.2s !important; }
.animate-delay-3 { animation-delay: 0.3s !important; }

.no-animation {
    animation: none !important;
    transition: none !important;
}

.pause-animation {
    animation-play-state: paused !important;
}

.reverse-animation {
    animation-direction: reverse !important;
}