/* Enhanced animations and transitions */
:root {
    --animation-duration: 0.3s;
    --animation-timing: cubic-bezier(0.4, 0, 0.2, 1);
    --bounce-timing: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Loading animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@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 scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-200deg);
    }
    to {
        opacity: 1;
        transform: rotate(0deg);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }
    20% {
        transform: scale3d(1.1, 1.1, 1.1);
    }
    40% {
        transform: scale3d(0.9, 0.9, 0.9);
    }
    60% {
        opacity: 1;
        transform: scale3d(1.03, 1.03, 1.03);
    }
    80% {
        transform: scale3d(0.97, 0.97, 0.97);
    }
    100% {
        opacity: 1;
        transform: scale3d(1, 1, 1);
    }
}

/* Particle animations */
@keyframes float {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg); 
        opacity: 0.7;
    }
    25% { 
        transform: translateY(-10px) rotate(90deg); 
        opacity: 1;
    }
    50% { 
        transform: translateY(-20px) rotate(180deg); 
        opacity: 0.8;
    }
    75% { 
        transform: translateY(-10px) rotate(270deg); 
        opacity: 1;
    }
}

@keyframes drift {
    0% { 
        transform: translateX(0px) translateY(0px); 
    }
    33% { 
        transform: translateX(30px) translateY(-30px); 
    }
    66% { 
        transform: translateX(-20px) translateY(20px); 
    }
    100% { 
        transform: translateX(0px) translateY(0px); 
    }
}

/* Hero section animations */
@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    0%, 50% { border-color: transparent; }
    51%, 100% { border-color: #3b82f6; }
}

@keyframes glow {
    0%, 100% { 
        text-shadow: 0 0 5px rgba(59, 130, 246, 0.5); 
    }
    50% { 
        text-shadow: 0 0 20px rgba(59, 130, 246, 0.8), 0 0 30px rgba(59, 130, 246, 0.6); 
    }
}

/* Button animations */
@keyframes pulse {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    50% { 
        transform: scale(1.05); 
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

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

/* Loading animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes progress {
    0% { width: 0%; }
    100% { width: 100%; }
}

@keyframes skeleton {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

/* Card animations */
@keyframes cardHover {
    0% { 
        transform: translateY(0) scale(1); 
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
    100% { 
        transform: translateY(-5px) scale(1.02); 
        box-shadow: 0 20px 40px rgba(59, 130, 246, 0.15);
    }
}

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

/* Timeline animations */
@keyframes drawLine {
    0% { height: 0; }
    100% { height: 100%; }
}

@keyframes expandDot {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

/* Scroll animations */
@keyframes scrollDown {
    0% { transform: translateY(0); }
    30% { transform: translateY(10px); }
    60% { transform: translateY(0); }
    100% { transform: translateY(0); }
}

/* Utility animation classes */
.animate-fadeIn { animation: fadeIn 0.6s ease-out; }
.animate-fadeInUp { animation: fadeInUp 0.8s ease-out; }
.animate-fadeInDown { animation: fadeInDown 0.8s ease-out; }
.animate-fadeInLeft { animation: fadeInLeft 0.8s ease-out; }
.animate-fadeInRight { animation: fadeInRight 0.8s ease-out; }
.animate-scaleIn { animation: scaleIn 0.6s var(--bounce-timing); }
.animate-slideInUp { animation: slideInUp 0.8s ease-out; }
.animate-slideInDown { animation: slideInDown 0.8s ease-out; }
.animate-rotateIn { animation: rotateIn 0.8s ease-out; }
.animate-bounceIn { animation: bounceIn 1s var(--bounce-timing); }
.animate-pulse { animation: pulse 2s infinite; }
.animate-bounce { animation: bounce 2s infinite; }
.animate-spin { animation: spin 1s linear infinite; }
.animate-glow { animation: glow 2s ease-in-out infinite alternate; }

/* Hover effects */
.hover-lift {
    transition: transform var(--animation-duration) var(--animation-timing);
}

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

.hover-scale {
    transition: transform var(--animation-duration) var(--animation-timing);
}

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

.hover-rotate {
    transition: transform var(--animation-duration) var(--animation-timing);
}

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

.hover-glow {
    transition: box-shadow var(--animation-duration) var(--animation-timing);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

/* Stagger animations */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* Loading states */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: skeleton 1.5s infinite;
}

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

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

/* Parallax effects */
.parallax-slow { transform: translateZ(0); }
.parallax-medium { transform: translateZ(0); }
.parallax-fast { transform: translateZ(0); }

/* Intersection Observer animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.6s ease-out;
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.6s ease-out;
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

/* Text animations */
.text-focus-in {
    animation: text-focus-in 1s cubic-bezier(0.550, 0.085, 0.680, 0.530) both;
}

@keyframes text-focus-in {
    0% {
        filter: blur(12px);
        opacity: 0;
    }
    100% {
        filter: blur(0px);
        opacity: 1;
    }
}

/* Accessibility */
@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-slow,
    .parallax-medium,
    .parallax-fast {
        transform: none !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .hover-glow:hover {
        box-shadow: 0 0 0 2px currentColor;
    }
}

/* Print styles */
@media print {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Dark mode animations */
@media (prefers-color-scheme: dark) {
    .loading-skeleton {
        background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .animate-fadeInUp,
    .animate-fadeInDown,
    .animate-fadeInLeft,
    .animate-fadeInRight {
        animation-duration: 0.6s;
    }
    
    .hover-lift:hover {
        transform: none;
    }
    
    .hover-scale:hover {
        transform: none;
    }
}

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

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

.will-change-scroll {
    will-change: scroll-position;
}

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

/* Focus animations */
.focus-ring {
    outline: 2px solid transparent;
    outline-offset: 2px;
    transition: outline-color 0.2s ease;
}

.focus-ring:focus {
    outline-color: #3b82f6;
}

/* Loading screen specific */
.loading-screen {
    animation: fadeIn 0.3s ease-in-out;
}

.loading-screen.fade-out {
    animation: fadeOut 0.5s ease-in-out forwards;
}

@keyframes fadeOut {
    to { opacity: 0; }
}

/* Entrance animations for different elements */
.card-entrance {
    animation: fadeInUp 0.8s ease-out;
    animation-fill-mode: both;
}

.icon-entrance {
    animation: scaleIn 0.6s var(--bounce-timing);
    animation-fill-mode: both;
}

.text-entrance {
    animation: fadeInLeft 0.8s ease-out;
    animation-fill-mode: both;
}

.button-entrance {
    animation: bounceIn 1s var(--bounce-timing);
    animation-fill-mode: both;
}

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

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

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

.rotating {
    animation: rotate 20s linear infinite;
}

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

/* Complex animations */
.complex-entrance {
    animation: fadeInUp 0.8s ease-out, scaleIn 0.8s ease-out 0.2s;
    animation-fill-mode: both;
}

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

.complex-hover:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.2);
    filter: brightness(1.1);
}
