/* 
===============================
Table of Contents:
1. Keyframe Animations
2. Hover Animations
3. Loading Animations
4. Microinteractions
===============================
*/

/* 1. Keyframe Animations */
@keyframes float {
    0% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(20px, -20px);
    }
    100% {
        transform: translate(0, 0);
    }
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

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

@keyframes scroll {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(12px);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(88, 166, 255, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(88, 166, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(88, 166, 255, 0);
    }
}

@keyframes glowPulse {
    0% {
        box-shadow: 0 0 5px 0 rgba(88, 166, 255, 0.5);
    }
    50% {
        box-shadow: 0 0 20px 5px rgba(88, 166, 255, 0.7);
    }
    100% {
        box-shadow: 0 0 5px 0 rgba(88, 166, 255, 0.5);
    }
}

@keyframes slideInFromLeft {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromRight {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes scaleUp {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* 2. Hover Animations */
.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 15px rgba(88, 166, 255, 0.7);
    transform: translateY(-5px);
}

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(10deg);
}

.hover-shake {
    transition: transform 0.1s ease;
}

.hover-shake:hover {
    animation: shake 0.5s ease;
}

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

/* 3. Loading Animations */
.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(88, 166, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--neon-blue);
    animation: spinner 1s linear infinite;
}

@keyframes spinner {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 4. Microinteractions */
/* Button ripple effect */
.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect span {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    pointer-events: none;
    animation: ripple 0.6s linear;
    transform: translate(-50%, -50%);
}

/* Focus field effect */
input:focus,
textarea:focus {
    animation: glow 0.5s ease;
}

@keyframes glow {
    0% {
        box-shadow: 0 0 0 rgba(88, 166, 255, 0);
    }
    50% {
        box-shadow: 0 0 10px rgba(88, 166, 255, 0.5);
    }
    100% {
        box-shadow: 0 0 15px rgba(88, 166, 255, 0.7);
    }
}

/* Typing animation */
.typing-animate::after {
    content: '|';
    animation: blink 0.7s infinite;
}

/* Form submit button success animation */
.submit-success {
    background-color: #39c5bb !important;
    transition: background-color 0.3s ease;
}

.submit-success::before {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 5px;
}

/* Circular progress animation */
.circular-progress {
    transition: stroke-dashoffset 2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scale in animation for cards */
.scale-in {
    animation: scaleIn 0.5s ease forwards;
}

@keyframes scaleIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Stagger animation delays for list items */
.stagger-animation > * {
    opacity: 0;
    transform: translateY(20px);
    animation: staggerFadeIn 0.5s ease forwards;
}

.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; }

@keyframes staggerFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progress bar animation */
.skill-level {
    animation: loadBar 1.5s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

@keyframes loadBar {
    0% { width: 0; }
    100% { width: var(--width, 90%); }
}

/* Mobile menu animation */
.mobile-menu-enter {
    transform: translateX(100%);
    opacity: 0;
}

.mobile-menu-enter-active {
    transform: translateX(0);
    opacity: 1;
    transition: all 0.3s ease;
}

.mobile-menu-exit {
    transform: translateX(0);
    opacity: 1;
}

.mobile-menu-exit-active {
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
}

/* Hamburger menu animation */
.hamburger.active .line:first-child {
    transform: translateY(9px) rotate(45deg);
}

.hamburger.active .line:nth-child(2) {
    opacity: 0;
}

.hamburger.active .line:last-child {
    transform: translateY(-9px) rotate(-45deg);
}
