/* ===================================
   Animations & Keyframes
   =================================== */

/* Pulse animation for hero decoration */
@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.7;
    }
}

/* Fade in from bottom */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade in from left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade in from right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Glow effect */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
    }
}

/* ===================================
   Scroll-triggered Animations
   =================================== */

/* Elements that animate on scroll */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Staggered animation for cards */
.skill-card,
.interest-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.skill-card.visible,
.interest-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Add delay for staggered effect */
.skill-card:nth-child(1) { transition-delay: 0.1s; }
.skill-card:nth-child(2) { transition-delay: 0.2s; }
.skill-card:nth-child(3) { transition-delay: 0.3s; }

.interest-item:nth-child(1) { transition-delay: 0.1s; }
.interest-item:nth-child(2) { transition-delay: 0.2s; }
.interest-item:nth-child(3) { transition-delay: 0.3s; }
.interest-item:nth-child(4) { transition-delay: 0.4s; }
.interest-item:nth-child(5) { transition-delay: 0.5s; }
.interest-item:nth-child(6) { transition-delay: 0.6s; }

/* ===================================
   Hero Animations
   =================================== */
.hero-content > * {
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
}

.hero-label {
    animation-delay: 0.1s;
}

.hero-title {
    animation-delay: 0.3s;
}

.hero-subtitle {
    animation-delay: 0.5s;
}

.hero-cta {
    animation-delay: 0.7s;
}

/* ===================================
   Navigation Animations
   =================================== */
.nav {
    animation: fadeInDown 0.5s ease;
}

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

.nav-link {
    position: relative;
}

/* Animated underline on hover */
.nav-link::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.nav-link:hover::before {
    width: 100%;
}

/* ===================================
   Button Animations
   =================================== */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

/* ===================================
   Card Hover Effects
   =================================== */

/* Subtle lift on hover */
.stat-card,
.skill-card,
.interest-item,
.contact-link {
    position: relative;
}

.stat-card::after,
.skill-card::after,
.interest-item::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    right: 0;
    height: 10px;
    background: linear-gradient(to bottom, rgba(255, 215, 0, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover::after,
.skill-card:hover::after,
.interest-item:hover::after {
    opacity: 1;
}

/* ===================================
   Typing Animation for Hero
   =================================== */
.hero-name {
    position: relative;
    display: inline-block;
}

.hero-name::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--color-accent);
    animation: blink 1s step-end infinite;
    animation-delay: 1s;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* Remove cursor after 3 seconds */
@keyframes removeCursor {
    to {
        opacity: 0;
    }
}

.hero-name::after {
    animation: blink 1s step-end infinite, removeCursor 0.1s 3s forwards;
}

/* ===================================
   Parallax Effect for Hero
   =================================== */
.hero-decoration {
    will-change: transform;
}

/* ===================================
   Loading State
   =================================== */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading {
    background: linear-gradient(
        90deg,
        var(--color-bg-secondary) 0%,
        var(--color-bg-tertiary) 50%,
        var(--color-bg-secondary) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ===================================
   Smooth Scroll Indicator
   =================================== */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(10px);
    }
}

/* ===================================
   Section Transition Effects
   =================================== */
.section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===================================
   Text Reveal Animation
   =================================== */
.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    animation: slideUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(100%);
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   Responsive Animation Adjustments
   =================================== */
@media (max-width: 768px) {
    /* Reduce motion for mobile */
    .skill-card,
    .interest-item {
        transition-duration: 0.3s;
    }
    
    /* Remove some decorative animations on mobile */
    .hero-name::after {
        display: none;
    }
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}