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

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

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

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

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

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-30px) rotate(5deg);
    }
    66% {
        transform: translateY(-15px) rotate(-3deg);
    }
}

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

@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 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 zoomIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes flipInX {
    0% {
        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);
    }
    100% {
        opacity: 1;
        transform: perspective(400px);
    }
}

/* Animation Classes */
.fade-in-up {
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
}

.fade-in-down {
    animation: fadeInDown 0.8s ease forwards;
    opacity: 0;
}

.fade-in-left {
    animation: fadeInLeft 0.8s ease forwards;
    opacity: 0;
}

.fade-in-right {
    animation: fadeInRight 0.8s ease forwards;
    opacity: 0;
}

.bounce-in {
    animation: bounceIn 0.8s ease forwards;
    opacity: 0;
}

.zoom-in {
    animation: zoomIn 0.6s ease forwards;
    opacity: 0;
}

.flip-in-x {
    animation: flipInX 0.8s ease forwards;
    opacity: 0;
}

.slide-in-left {
    animation: slideInFromLeft 0.8s ease forwards;
    opacity: 0;
}

.slide-in-right {
    animation: slideInFromRight 0.8s ease forwards;
    opacity: 0;
}

/* Hover Animations */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

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

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

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

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

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

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(69, 132, 166, 0.5);
}

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

/* Loading Animation */
.loading-dots::after {
    content: '';
    animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}

/* Stagger Animation */
.stagger-animation {
    &:not(.none){
        color: #424242 !important;
    }
    font-weight: bolder;
    animation-delay: calc(var(--i) * 0.1s);
}

/* Scroll Reveal */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

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

/* Card Flip Animation */
.flip-card {
    background-color: transparent;
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 15px;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* Text Animation */
.typing-animation {
    overflow: hidden;
    border-right: 3px solid var(--primary-color);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

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

/* Infinite Animations */
.infinite-float {
    animation: floating 6s ease-in-out infinite;
}

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

.infinite-bounce {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        transform: translate3d(0,-30px,0);
    }
    70% {
        transform: translate3d(0,-15px,0);
    }
    90% {
        transform: translate3d(0,-4px,0);
    }
}

/* Parallax Effect */
.parallax-element {
    will-change: transform;
}

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

/* Progress Bar Animation */
@keyframes progressBar {
    0% {
        width: 0%;
    }
    100% {
        width: var(--progress-width);
    }
}

.progress-animated .progress-bar {
    animation: progressBar 2s ease-in-out;
}

/* Counter Animation */
.counter {
    font-variant-numeric: tabular-nums;
}

/* 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) {
    .fade-in-up,
    .fade-in-down,
    .fade-in-left,
    .fade-in-right {
        animation-duration: 0.6s;
    }

    .hover-lift:hover {
        transform: translateY(-5px);
    }
}
