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

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

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

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

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

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

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@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 shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

/* Base Animation Classes */
.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
    opacity: 0;
}

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

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

.fade-in-delay-3 {
    animation: fadeIn 0.8s ease-out 0.6s 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-up {
    animation: slideInUp 0.8s ease-out forwards;
    opacity: 0;
}

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

.scale-in {
    animation: scaleIn 0.6s ease-out forwards;
    opacity: 0;
}

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

/* Intersection Observer Triggered Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

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

.animate-on-scroll.slide-left {
    transform: translateX(-50px);
}

.animate-on-scroll.slide-left.animated {
    transform: translateX(0);
}

.animate-on-scroll.slide-right {
    transform: translateX(50px);
}

.animate-on-scroll.slide-right.animated {
    transform: translateX(0);
}

.animate-on-scroll.scale {
    transform: scale(0.8);
}

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

/* Staggered Animation Classes */
.stagger-animation {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.stagger-animation.animated {
    opacity: 1;
    transform: translateY(0);
}

.stagger-delay-1 { transition-delay: 0.1s; }
.stagger-delay-2 { transition-delay: 0.2s; }
.stagger-delay-3 { transition-delay: 0.3s; }
.stagger-delay-4 { transition-delay: 0.4s; }
.stagger-delay-5 { transition-delay: 0.5s; }

/* Hover Animations */
.hover-lift {
    transition: all 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

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

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

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

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

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

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(0, 122, 255, 0.3);
}

/* Loading Animations */
.shimmer-effect {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 2s infinite;
}

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

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

/* Parallax Elements */
.parallax-element {
    will-change: transform;
    transition: transform 0.1s ease-out;
}

.parallax-slow {
    transform: translateY(var(--parallax-slow, 0));
}

.parallax-medium {
    transform: translateY(var(--parallax-medium, 0));
}

.parallax-fast {
    transform: translateY(var(--parallax-fast, 0));
}

/* Advanced Parallax Effects */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.floating-circle {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(45deg, rgba(0, 122, 255, 0.1), rgba(0, 122, 255, 0.05));
    animation: float 20s infinite ease-in-out;
}

.floating-circle.circle-1 {
    width: 100px;
    height: 100px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.floating-circle.circle-2 {
    width: 150px;
    height: 150px;
    top: 60%;
    right: 10%;
    animation-delay: -5s;
}

.floating-circle.circle-3 {
    width: 80px;
    height: 80px;
    bottom: 20%;
    left: 20%;
    animation-delay: -10s;
}

.floating-triangle {
    position: absolute;
    width: 0;
    height: 0;
    animation: float 15s infinite ease-in-out;
}

.floating-triangle.triangle-1 {
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-bottom: 52px solid rgba(0, 122, 255, 0.08);
    top: 30%;
    right: 20%;
    animation-delay: -3s;
}

.floating-triangle.triangle-2 {
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 35px solid rgba(0, 122, 255, 0.06);
    bottom: 40%;
    right: 40%;
    animation-delay: -8s;
}

/* Depth Layers */
.depth-layers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.depth-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0, 122, 255, 0.03) 0%, transparent 70%);
}

.depth-layer.layer-1 {
    transform: translateZ(0);
}

.depth-layer.layer-2 {
    background: radial-gradient(circle at 30% 70%, rgba(0, 122, 255, 0.02) 0%, transparent 50%);
}

.depth-layer.layer-3 {
    background: radial-gradient(circle at 70% 30%, rgba(0, 122, 255, 0.01) 0%, transparent 60%);
}

/* Particle System */
.particle-system {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.6;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(0, 122, 255, 0.3);
    border-radius: 50%;
    animation: particleFloat linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Morphing Shapes */
.morphing-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.morph-shape {
    position: absolute;
    background: linear-gradient(45deg, rgba(0, 122, 255, 0.05), rgba(0, 122, 255, 0.02));
    border-radius: 50%;
    animation: morphShape 30s infinite ease-in-out;
}

.morph-shape.shape-1 {
    width: 200px;
    height: 200px;
    top: 20%;
    left: 5%;
    animation-delay: 0s;
}

.morph-shape.shape-2 {
    width: 150px;
    height: 150px;
    top: 70%;
    right: 10%;
    animation-delay: -10s;
}

.morph-shape.shape-3 {
    width: 100px;
    height: 100px;
    bottom: 30%;
    left: 60%;
    animation-delay: -20s;
}

@keyframes morphShape {
    0%, 100% {
        border-radius: 50%;
        transform: rotate(0deg) scale(1);
    }
    25% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
        transform: rotate(90deg) scale(1.1);
    }
    50% {
        border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%;
        transform: rotate(180deg) scale(0.9);
    }
    75% {
        border-radius: 40% 60% 60% 40% / 60% 40% 60% 40%;
        transform: rotate(270deg) scale(1.05);
    }
}

/* Language Toggle Button */
.lang-toggle {
    background: rgba(0, 122, 255, 0.1);
    border: 1px solid rgba(0, 122, 255, 0.2);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-left: 16px;
}

.lang-toggle:hover {
    background: rgba(0, 122, 255, 0.2);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.lang-toggle:active {
    transform: translateY(0);
}

/* Language Toggle Animation */
.lang-toggle.changing {
    animation: languageChange 0.5s ease-in-out;
}

@keyframes languageChange {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
        background: rgba(0, 122, 255, 0.3);
    }
    100% {
        transform: scale(1);
    }
}

/* Text Animations */
.text-reveal {
    overflow: hidden;
    position: relative;
}

.text-reveal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    transform: translateX(-100%);
    animation: textReveal 0.8s ease-out forwards;
}

@keyframes textReveal {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--primary-color);
    white-space: nowrap;
    margin: 0 auto;
    animation: typing 3s 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); }
}

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

.counter.counting {
    animation: countUp 2s ease-out forwards;
}

/* Section Entrance Animations */
.section-entrance {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

.section-entrance.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Card Animations */
.card-entrance {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: all 0.6s ease-out;
}

.card-entrance.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Navigation Animations */
.nav-slide-down {
    transform: translateY(-100%);
    transition: transform 0.3s ease-out;
}

.nav-slide-down.visible {
    transform: translateY(0);
}

/* Button Animations */
.btn-animate {
    position: relative;
    overflow: hidden;
}

.btn-animate::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-animate:hover::before {
    left: 100%;
}

/* Mobile Animations */
@media (max-width: 768px) {
    .fade-in,
    .slide-in-left,
    .slide-in-right,
    .slide-in-up,
    .slide-in-down {
        animation-duration: 0.6s;
    }
    
    .animate-on-scroll {
        transition-duration: 0.6s;
    }
    
    .hover-lift:hover {
        transform: translateY(-3px);
    }
    
    .hover-scale:hover {
        transform: scale(1.02);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .parallax-element {
        transform: none !important;
    }
    
    .float-animation,
    .pulse-animation {
        animation: none;
    }
}

/* Performance Optimizations */
.will-change-transform {
    will-change: transform;
}

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

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Animation States */
.animation-paused {
    animation-play-state: paused;
}

.animation-running {
    animation-play-state: running;
}

/* Entrance Delays for Multiple Elements */
.entrance-delay-1 { animation-delay: 0.1s; }
.entrance-delay-2 { animation-delay: 0.2s; }
.entrance-delay-3 { animation-delay: 0.3s; }
.entrance-delay-4 { animation-delay: 0.4s; }
.entrance-delay-5 { animation-delay: 0.5s; }
.entrance-delay-6 { animation-delay: 0.6s; }
.entrance-delay-7 { animation-delay: 0.7s; }
.entrance-delay-8 { animation-delay: 0.8s; }
.entrance-delay-9 { animation-delay: 0.9s; }
.entrance-delay-10 { animation-delay: 1.0s; } 