/* ===== ANIMATION KEYFRAMES ===== */

/* Fade In Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Scale Animations */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleInBounce {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Rotation Animations */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-200deg);
    }
    to {
        opacity: 1;
        transform: rotate(0);
    }
}

/* Slide Animations */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Bounce Animations */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounceInDown {
    0% {
        opacity: 0;
        transform: translateY(-2000px);
    }
    60% {
        opacity: 1;
        transform: translateY(30px);
    }
    80% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0);
    }
}

/* Flip Animations */
@keyframes flipInX {
    from {
        opacity: 0;
        transform: perspective(400px) rotateX(90deg);
    }
    40% {
        transform: perspective(400px) rotateX(-20deg);
    }
    60% {
        transform: perspective(400px) rotateX(10deg);
    }
    80% {
        transform: perspective(400px) rotateX(-5deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateX(0deg);
    }
}

@keyframes flipInY {
    from {
        opacity: 0;
        transform: perspective(400px) rotateY(90deg);
    }
    40% {
        transform: perspective(400px) rotateY(-20deg);
    }
    60% {
        transform: perspective(400px) rotateY(10deg);
    }
    80% {
        transform: perspective(400px) rotateY(-5deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateY(0deg);
    }
}

/* Zoom Animations */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes zoomInUp {
    from {
        opacity: 0;
        transform: scale(0.1) translateY(2000px);
    }
    60% {
        opacity: 1;
        transform: scale(0.475) translateY(-60px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Pulse and Glow Effects */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(108, 92, 231, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(108, 92, 231, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(108, 92, 231, 0);
    }
}

@keyframes glow {
    from {
        text-shadow: 0 0 20px #fff, 0 0 30px #fff, 0 0 40px #6c5ce7;
    }
    to {
        text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #6c5ce7;
    }
}

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

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--primary-color);
    }
}

/* Floating Elements */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes floatReverse {
    0%, 100% {
        transform: translateY(-20px);
    }
    50% {
        transform: translateY(0px);
    }
}

/* Particle Animations */
@keyframes particle-float {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
        opacity: 1;
    }
    33% {
        transform: translateY(-30px) translateX(30px);
        opacity: 0.8;
    }
    66% {
        transform: translateY(-10px) translateX(-20px);
        opacity: 0.6;
    }
}

/* Gradient Animations */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Loading Animations */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dots {
    0%, 20% {
        color: rgba(0,0,0,0);
        text-shadow: .25em 0 0 rgba(0,0,0,0), .5em 0 0 rgba(0,0,0,0);
    }
    40% {
        color: white;
        text-shadow: .25em 0 0 rgba(0,0,0,0), .5em 0 0 rgba(0,0,0,0);
    }
    60% {
        text-shadow: .25em 0 0 white, .5em 0 0 rgba(0,0,0,0);
    }
    80%, 100% {
        text-shadow: .25em 0 0 white, .5em 0 0 white;
    }
}

/* Shake Animation */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}

/* Wobble Animation */
@keyframes wobble {
    0% {
        transform: translateX(0%);
    }
    15% {
        transform: translateX(-25%) rotate(-5deg);
    }
    30% {
        transform: translateX(20%) rotate(3deg);
    }
    45% {
        transform: translateX(-15%) rotate(-3deg);
    }
    60% {
        transform: translateX(10%) rotate(2deg);
    }
    75% {
        transform: translateX(-5%) rotate(-1deg);
    }
    100% {
        transform: translateX(0%);
    }
}

/* Swing Animation */
@keyframes swing {
    20% {
        transform: rotate(15deg);
    }
    40% {
        transform: rotate(-10deg);
    }
    60% {
        transform: rotate(5deg);
    }
    80% {
        transform: rotate(-5deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

/* Rubber Band Animation */
@keyframes rubberBand {
    0% {
        transform: scale(1);
    }
    30% {
        transform: scaleX(1.25) scaleY(0.75);
    }
    40% {
        transform: scaleX(0.75) scaleY(1.25);
    }
    60% {
        transform: scaleX(1.15) scaleY(0.85);
    }
    100% {
        transform: scale(1);
    }
}

/* Heartbeat Animation */
@keyframes heartbeat {
    0% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.3);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.3);
    }
    70% {
        transform: scale(1);
    }
}

/* ===== ANIMATION UTILITY CLASSES ===== */

/* Fade Animations */
.animate-fadeIn {
    animation: fadeIn 1s ease-out;
}

.animate-fadeInLeft {
    animation: fadeInLeft 1s ease-out;
}

.animate-fadeInRight {
    animation: fadeInRight 1s ease-out;
}

.animate-fadeInUp {
    animation: fadeInUp 1s ease-out;
}

.animate-fadeInDown {
    animation: fadeInDown 1s ease-out;
}

/* Scale Animations */
.animate-scaleIn {
    animation: scaleIn 0.8s ease-out;
}

.animate-scaleInBounce {
    animation: scaleInBounce 1s ease-out;
}

/* Bounce Animations */
.animate-bounceIn {
    animation: bounceIn 1s ease-out;
}

.animate-bounceInDown {
    animation: bounceInDown 1s ease-out;
}

/* Flip Animations */
.animate-flipInX {
    animation: flipInX 1s ease-out;
}

.animate-flipInY {
    animation: flipInY 1s ease-out;
}

/* Zoom Animations */
.animate-zoomIn {
    animation: zoomIn 0.8s ease-out;
}

.animate-zoomInUp {
    animation: zoomInUp 1s ease-out;
}

/* Rotation Animations */
.animate-rotateIn {
    animation: rotateIn 1s ease-out;
}

/* Slide Animations */
.animate-slideInLeft {
    animation: slideInLeft 1s ease-out;
}

.animate-slideInRight {
    animation: slideInRight 1s ease-out;
}

/* Continuous Animations */
.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-floatReverse {
    animation: floatReverse 3s ease-in-out infinite;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite alternate;
}

.animate-spin {
    animation: spin 2s linear infinite;
}

.animate-gradientShift {
    background: linear-gradient(-45deg, #6c5ce7, #a29bfe, #fd79a8, #fdcb6e);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

/* Hover Animations */
.hover-shake:hover {
    animation: shake 0.5s;
}

.hover-wobble:hover {
    animation: wobble 1s;
}

.hover-swing:hover {
    animation: swing 1s;
}

.hover-rubberBand:hover {
    animation: rubberBand 1s;
}

.hover-heartbeat:hover {
    animation: heartbeat 1.5s ease-in-out infinite;
}

/* Delay Classes */
.animate-delay-1 {
    animation-delay: 0.1s;
}

.animate-delay-2 {
    animation-delay: 0.2s;
}

.animate-delay-3 {
    animation-delay: 0.3s;
}

.animate-delay-4 {
    animation-delay: 0.4s;
}

.animate-delay-5 {
    animation-delay: 0.5s;
}

/* Duration Classes */
.animate-fast {
    animation-duration: 0.5s;
}

.animate-slow {
    animation-duration: 2s;
}

.animate-slower {
    animation-duration: 3s;
}

/* ===== SCROLL ANIMATIONS ===== */
.scroll-animate {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

.scroll-animate.animate {
    opacity: 1;
    transform: translateY(0);
}

.scroll-animate-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s ease-out;
}

.scroll-animate-left.animate {
    opacity: 1;
    transform: translateX(0);
}

.scroll-animate-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s ease-out;
}

.scroll-animate-right.animate {
    opacity: 1;
    transform: translateX(0);
}

.scroll-animate-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s ease-out;
}

.scroll-animate-scale.animate {
    opacity: 1;
    transform: scale(1);
}

/* ===== PARTICLE SYSTEM ===== */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0.7;
    animation: particle-float 6s ease-in-out infinite;
}

.particle:nth-child(1) { animation-delay: 0s; }
.particle:nth-child(2) { animation-delay: 0.5s; }
.particle:nth-child(3) { animation-delay: 1s; }
.particle:nth-child(4) { animation-delay: 1.5s; }
.particle:nth-child(5) { animation-delay: 2s; }
.particle:nth-child(6) { animation-delay: 2.5s; }
.particle:nth-child(7) { animation-delay: 3s; }
.particle:nth-child(8) { animation-delay: 3.5s; }
.particle:nth-child(9) { animation-delay: 4s; }
.particle:nth-child(10) { animation-delay: 4.5s; }

/* ===== LOADING STATES ===== */
.loading-dots::after {
    content: '...';
    animation: dots 1.5s steps(5, end) infinite;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

/* ===== RESPONSIVE ANIMATIONS ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 768px) {
    .animate-fadeInLeft,
    .animate-fadeInRight {
        animation-name: fadeInUp;
    }
    
    .scroll-animate-left,
    .scroll-animate-right {
        transform: translateY(30px);
    }
    
    .scroll-animate-left.animate,
    .scroll-animate-right.animate {
        transform: translateY(0);
    }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

.will-change-auto {
    will-change: auto;
}

/* Force hardware acceleration */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* ===== PROGRESS BAR ANIMATIONS ===== */
@keyframes progressFill {
    from {
        width: 0%;
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes progressGlow {
    0% {
        box-shadow: 0 0 5px rgba(108, 92, 231, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(108, 92, 231, 0.8), 0 0 30px rgba(108, 92, 231, 0.4);
    }
    100% {
        box-shadow: 0 0 5px rgba(108, 92, 231, 0.5);
    }
}

@keyframes progressPulse {
    0% {
        transform: scaleY(1);
    }
    50% {
        transform: scaleY(1.1);
    }
    100% {
        transform: scaleY(1);
    }
}

@keyframes progressShimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

/* Progress Bar Classes */
.progress-bar-animated {
    animation: progressFill 2s ease-out forwards;
    position: relative;
    overflow: hidden;
}

.progress-bar-animated::before {
    content: '';
    position: absolute;
    top: 0;
    left: -200px;
    width: 200px;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: progressShimmer 2s ease-out 0.5s;
}

.progress-bar-glow {
    animation: progressGlow 2s ease-in-out infinite;
}

.progress-bar-pulse {
    animation: progressPulse 1.5s ease-in-out infinite;
}

/* Skill Progress Specific Animations */
.skill-progress {
    transition: width 2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.skill-progress.animate {
    animation: progressGlow 3s ease-in-out infinite;
}

.skill-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: progressShimmer 2s ease-out 1s;
}

/* Project Progress Animations */
.progress-fill {
    transition: width 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.progress-fill.animate {
    animation: progressPulse 2s ease-in-out infinite;
}

.progress-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150px;
    width: 150px;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.5),
        transparent
    );
    animation: progressShimmer 2.5s ease-out 0.8s;
}

/* Enhanced Progress Bar Styles */
.enhanced-progress {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.enhanced-progress .progress-fill {
    background: linear-gradient(45deg, #6c5ce7, #a29bfe);
    border-radius: 10px;
    height: 100%;
    position: relative;
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
}

.enhanced-progress .progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    );
    animation: progressShimmer 3s ease-in-out infinite;
}

/* Staggered Animation for Multiple Progress Bars */
.progress-stagger-1 { animation-delay: 0.2s; }
.progress-stagger-2 { animation-delay: 0.4s; }
.progress-stagger-3 { animation-delay: 0.6s; }
.progress-stagger-4 { animation-delay: 0.8s; }
.progress-stagger-5 { animation-delay: 1.0s; }
.progress-stagger-6 { animation-delay: 1.2s; }
.progress-stagger-7 { animation-delay: 1.4s; }
.progress-stagger-8 { animation-delay: 1.6s; }
