/* Animation Classes */

.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
    opacity: 0;
}

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

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

.slide-in-bottom {
    animation: slideInBottom 0.8s ease-out forwards;
    opacity: 0;
}

/* Keyframe Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

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

/* Stagger animations for multiple elements */
.fade-in:nth-child(1) { animation-delay: 0s; }
.fade-in:nth-child(2) { animation-delay: 0.1s; }
.fade-in:nth-child(3) { animation-delay: 0.2s; }
.fade-in:nth-child(4) { animation-delay: 0.3s; }
.fade-in:nth-child(5) { animation-delay: 0.4s; }

.slide-in-left:nth-child(1) { animation-delay: 0s; }
.slide-in-left:nth-child(2) { animation-delay: 0.1s; }
.slide-in-left:nth-child(3) { animation-delay: 0.2s; }

.slide-in-right:nth-child(1) { animation-delay: 0s; }
.slide-in-right:nth-child(2) { animation-delay: 0.1s; }
.slide-in-right:nth-child(3) { animation-delay: 0.2s; }

.slide-in-bottom:nth-child(1) { animation-delay: 0s; }
.slide-in-bottom:nth-child(2) { animation-delay: 0.1s; }
.slide-in-bottom:nth-child(3) { animation-delay: 0.2s; }
.slide-in-bottom:nth-child(4) { animation-delay: 0.3s; }

/* Parallax and Scroll Effects */
@keyframes parallax {
    to {
        transform: translateY(30px);
    }
}

.parallax-effect {
    will-change: transform;
}

/* Page Transition */
@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body {
    animation: pageEnter 0.6s ease-out;
}

/* Hover Effects */
@keyframes hoverLift {
    to {
        transform: translateY(-8px);
    }
}

@keyframes hoverGlow {
    to {
        box-shadow: 0 15px 40px rgba(0, 212, 255, 0.3);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* Button Animations */
button, .btn, a[role="button"] {
    position: relative;
}

button::before, .btn::before, a[role="button"]::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: inherit;
    transform: scale(0);
    transition: transform 0.3s ease;
}

button:active::before, .btn:active::before {
    transform: scale(1);
}

/* Text Animation */
@keyframes typewrite {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: currentColor;
    }
}

/* Loading Animation */
@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    border: 3px solid rgba(31, 71, 136, 0.1);
    border-radius: 50%;
    border-top: 3px solid var(--primary-color);
    width: 40px;
    height: 40px;
    animation: spinner 0.8s linear infinite;
}

/* Wave Animation */
@keyframes wave {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Underline Animation */
@keyframes underline {
    from {
        width: 0;
        left: 0;
    }
    to {
        width: 100%;
        left: 0;
    }
}

.underline {
    position: relative;
    display: inline-block;
}

.underline::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-color);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.underline:hover::after {
    transform: scaleX(1);
}

/* Smooth Transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

button, .btn, a {
    transition: all 0.3s ease;
}

/* Transform Animations */
@keyframes scaleUp {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes scaleDown {
    from {
        transform: scale(1.05);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

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

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

/* Rotate Animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.rotate {
    animation: rotate 2s linear infinite;
}

/* Bounce Animation */
@keyframes bounceSmall {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.bounce-small {
    animation: bounceSmall 0.6s ease-in-out;
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    background-size: 200px 100%;
    animation: shimmer 2s infinite;
}

/* Gradient Text Animation */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

/* Focus States */
:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 4px;
}

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

/* 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;
    }

    html {
        scroll-behavior: auto;
    }
}
