/* Advanced Animations & Microinteractions Styles */

/* Scroll animations */
[data-animate] {
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-animate].animated {
    opacity: 1;
}

/* Animation variants */
.fade-in-up {
    transform: translateY(30px);
}

.fade-in-up.animated {
    transform: translateY(0);
}

.fade-in {
    opacity: 0;
}

.fade-in.animated {
    opacity: 1;
}

.scale-in {
    transform: scale(0.9);
    opacity: 0;
}

.scale-in.animated {
    transform: scale(1);
    opacity: 1;
}

.fade-in-left {
    transform: translateX(-30px);
    opacity: 0;
}

.fade-in-left.animated {
    transform: translateX(0);
    opacity: 1;
}

.fade-in-right {
    transform: translateX(30px);
    opacity: 0;
}

.fade-in-right.animated {
    transform: translateX(0);
    opacity: 1;
}

/* Ripple effect */
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Tooltip animation */
@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Page loaded animation */
body.page-loaded {
    animation: pageLoad 0.5s ease;
}

@keyframes pageLoad {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Section fade in */
@keyframes sectionFadeIn {
    from {
        opacity: 0.8;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Bounce animation for scroll indicator */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Loading spinner */
.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(46, 134, 171, 0.3);
    border-top-color: #2E86AB;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loader-content {
    text-align: center;
}

.loader-content p {
    margin-top: 20px;
    color: var(--primary-blue);
    font-size: 1.2em;
}

/* Smooth transitions for cards */
.info-card,
.timeline-content {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Floating actions smooth transition */
.floating-action {
    transition: transform 0.2s ease;
}

/* Navigation link transitions */
.nav-link {
    transition: transform 0.2s ease, color 0.2s ease;
}

/* Social link transitions */
.social-link {
    transition: transform 0.3s ease, color 0.3s ease;
}

/* Skill bar animations */
.skill-progress {
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease;
    transform-origin: left;
}

/* Pulse animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Glow effect */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(46, 134, 171, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(46, 134, 171, 0.8);
    }
}

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

/* Slide in animations */
@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

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

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

.shake {
    animation: shake 0.5s ease-in-out;
}

/* Float animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

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

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

.gradient-animated {
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
}

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

    .ripple-effect,
    .pulse,
    .glow,
    .float,
    .gradient-animated {
        animation: none !important;
    }
}

/* Performance optimizations */
.skill-progress,
.timeline-item,
.info-card,
.badge {
    will-change: transform, opacity;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
