/* ============================================
   ADVANCED ANIMATIONS FOR SENIOR PORTFOLIO
   ============================================ */

/* Page Load Animations */
@keyframes page-load-fade {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slide-from-left {
    0% {
        opacity: 0;
        transform: translateX(-30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slide-from-right {
    0% {
        opacity: 0;
        transform: translateX(30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scale-in {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Gradient Animation */
@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Floating Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    33% {
        transform: translateY(-10px) rotate(2deg);
    }
    66% {
        transform: translateY(5px) rotate(-1deg);
    }
}

/* Card Hover Animations */
@keyframes card-hover-lift {
    0% {
        transform: translateY(0);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }
    100% {
        transform: translateY(-6px);
        box-shadow: 0 20px 40px rgba(139, 92, 246, 0.15);
    }
}

/* Button Pulse Animation */
@keyframes pulse-soft {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(139, 92, 246, 0);
    }
}

/* Text Reveal Animation */
@keyframes text-reveal {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

/* Loading Spinner */
@keyframes spin-slow {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Bounce In */
@keyframes bounce-in {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Typewriter Effect */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* Blink Cursor */
@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

/* Scroll Indicator */
@keyframes scroll-down {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* Particle Animation */
@keyframes particle-float {
    0%, 100% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(10px, -15px);
    }
    50% {
        transform: translate(-5px, -25px);
    }
    75% {
        transform: translate(-15px, -10px);
    }
}

/* Wave Animation */
@keyframes wave {
    0% {
        transform: rotate(0deg);
    }
    10% {
        transform: rotate(14deg);
    }
    20% {
        transform: rotate(-8deg);
    }
    30% {
        transform: rotate(14deg);
    }
    40% {
        transform: rotate(-4deg);
    }
    50% {
        transform: rotate(10deg);
    }
    60% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

/* Glitch Effect */
@keyframes glitch {
    0% {
        transform: translate(0);
    }
    20% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    80% {
        transform: translate(2px, -2px);
    }
    100% {
        transform: translate(0);
    }
}

/* Ripple Effect */
@keyframes ripple {
    0% {
        width: 0;
        height: 0;
        opacity: 0.5;
    }
    100% {
        width: 500px;
        height: 500px;
        opacity: 0;
    }
}

/* Fade In Up */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* ============================================
   ANIMATION CLASSES
   ============================================ */

/* Page Load Animation Classes */
.page-load {
    animation: page-load-fade 0.8s ease-out forwards;
}

.slide-left {
    animation: slide-from-left 0.6s ease-out forwards;
}

.slide-right {
    animation: slide-from-right 0.6s ease-out forwards;
}

.scale-in {
    animation: scale-in 0.5s ease-out forwards;
}

/* Gradient Animation */
.animate-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 4s ease infinite;
}

/* Floating Elements */
.float-animation {
    animation: float 6s ease-in-out infinite;
}

.float-slow {
    animation: float 8s ease-in-out infinite;
}

.float-fast {
    animation: float 4s ease-in-out infinite;
}

/* Hover Effects */
.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    animation: card-hover-lift 0.3s ease-out forwards;
}

/* Button Animations */
.btn-pulse {
    animation: pulse-soft 2s infinite;
}

.btn-pulse:hover {
    animation: none;
}

/* Text Animation */
.text-reveal {
    background: linear-gradient(90deg, #8b5cf6, #3b82f6, #06b6d4, #3b82f6, #8b5cf6);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: text-reveal 3s linear infinite;
}

/* Loading States */
.spin-slow {
    animation: spin-slow 3s linear infinite;
}

.shimmer {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Interactive Animations */
.bounce-in {
    animation: bounce-in 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.typewriter {
    overflow: hidden;
    white-space: nowrap;
    animation: typewriter 3s steps(40, end);
}

.blink {
    animation: blink 1s step-end infinite;
}

/* Scroll Indicator */
.scroll-indicator {
    animation: scroll-down 2s ease-in-out infinite;
}

/* Particle Effects */
.particle {
    animation: particle-float 20s infinite linear;
}

/* Wave Animation */
.wave {
    animation: wave 2.5s infinite;
    transform-origin: 70% 70%;
}

/* Glitch Effect */
.glitch {
    animation: glitch 0.5s infinite;
}

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    animation: ripple 0.6s ease-out;
}

/* Staggered Animation Delays */
.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

.delay-400 {
    animation-delay: 400ms;
}

.delay-500 {
    animation-delay: 500ms;
}

.delay-600 {
    animation-delay: 600ms;
}

.delay-700 {
    animation-delay: 700ms;
}

.delay-800 {
    animation-delay: 800ms;
}

.delay-900 {
    animation-delay: 900ms;
}

.delay-1000 {
    animation-delay: 1000ms;
}

/* Animation Fill Modes */
.animate-forwards {
    animation-fill-mode: forwards;
}

.animate-backwards {
    animation-fill-mode: backwards;
}

.animate-both {
    animation-fill-mode: both;
}

/* Animation Timing Functions */
.ease-in-out {
    animation-timing-function: ease-in-out;
}

.ease-out-back {
    animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ease-in-back {
    animation-timing-function: cubic-bezier(0.36, 0, 0.66, -0.56);
}

/* Scroll-triggered Animations */
[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

[data-animate].animated {
    opacity: 1;
    transform: translateY(0);
}

/* Different animation types */
[data-animate="fade-up"] {
    transform: translateY(40px);
}

[data-animate="fade-left"] {
    transform: translateX(-40px);
}

[data-animate="fade-right"] {
    transform: translateX(40px);
}

[data-animate="scale"] {
    transform: scale(0.9);
}

[data-animate].animated.scale {
    transform: scale(1);
}

/* Page Transition */
.page-transition {
    animation: fade-in-up 0.6s ease-out;
}

/* ============================================
   SPECIFIC COMPONENT ANIMATIONS
   ============================================ */

/* Project Card Hover */
.project-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover {
    animation: card-hover-lift 0.4s ease-out forwards;
}

.project-card:hover .project-image {
    transform: scale(1.05);
    transition: transform 0.6s ease-out;
}

/* Skill Bar Animation */
.skill-bar {
    transform-origin: left;
    animation: scale-in 1s ease-out forwards;
}

/* Timeline Animation */
.timeline-item {
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.6s ease-out;
}

.timeline-item.visible {
    opacity: 1;
    transform: translateX(0);
}

.timeline-item:nth-child(even) {
    transform: translateX(20px);
}

.timeline-item:nth-child(even).visible {
    transform: translateX(0);
}

/* Form Input Focus Animation */
.form-input:focus {
    animation: pulse-soft 1.5s infinite;
}

/* Progress Bar Fill Animation */
@keyframes progress-fill {
    from {
        width: 0;
    }
    to {
        width: var(--progress-width);
    }
}

.progress-fill {
    animation: progress-fill 1.5s ease-out forwards;
}

/* Counter Animation */
@keyframes count-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.count-up {
    animation: count-up 0.8s ease-out forwards;
}

/* Parallax Effect */
.parallax-element {
    will-change: transform;
    transition: transform 0.3s ease-out;
}

/* ============================================
   RESPONSIVE ANIMATIONS
   ============================================ */

@media (max-width: 768px) {
    .float-animation,
    .float-slow,
    .float-fast {
        animation-duration: 8s;
    }
    
    [data-animate] {
        transition-duration: 0.6s;
    }
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .float-animation,
    .animate-gradient,
    .btn-pulse {
        animation: none;
    }
}