/* Modern Animations and Effects */
:root {
    --animation-duration: 0.3s;
    --animation-duration-slow: 0.6s;
    --animation-duration-fast: 0.15s;
    --easing: cubic-bezier(0.4, 0, 0.2, 1);
    --easing-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --easing-elastic: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Fade Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@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);
    }
}

/* Scale Animations */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

@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 bounceOut {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(0.95);
    }
    50% {
        opacity: 1;
        transform: scale(1.02);
    }
    100% {
        opacity: 0;
        transform: scale(0.3);
    }
}

/* Slide Animations */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideOutUp {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-100%);
    }
}

@keyframes slideOutDown {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(100%);
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-100%);
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(100%);
    }
}

/* Rotation Animations */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-200deg);
    }
    to {
        opacity: 1;
        transform: rotate(0);
    }
}

@keyframes rotateOut {
    from {
        opacity: 1;
        transform: rotate(0);
    }
    to {
        opacity: 0;
        transform: rotate(200deg);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes spinReverse {
    from {
        transform: rotate(360deg);
    }
    to {
        transform: rotate(0deg);
    }
}

/* Pulse and Shake Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes heartbeat {
    0% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.3);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.3);
    }
    70% {
        transform: scale(1);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}

@keyframes wobble {
    0% {
        transform: translateX(0%);
    }
    15% {
        transform: translateX(-25%) rotate(-5deg);
    }
    30% {
        transform: translateX(20%) rotate(3deg);
    }
    45% {
        transform: translateX(-15%) rotate(-3deg);
    }
    60% {
        transform: translateX(10%) rotate(2deg);
    }
    75% {
        transform: translateX(-5%) rotate(-1deg);
    }
    100% {
        transform: translateX(0%);
    }
}

/* Zoom Animations */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes zoomOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0;
    }
    100% {
        opacity: 0;
        transform: scale(0.3);
    }
}

@keyframes zoomInUp {
    from {
        opacity: 0;
        transform: scale(0.1) translateY(1000px);
    }
    60% {
        opacity: 1;
        transform: scale(0.475) translateY(-60px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes zoomInDown {
    from {
        opacity: 0;
        transform: scale(0.1) translateY(-1000px);
    }
    60% {
        opacity: 1;
        transform: scale(0.475) translateY(60px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Flip Animations */
@keyframes flipInX {
    from {
        transform: perspective(400px) rotateX(90deg);
        opacity: 0;
    }
    40% {
        transform: perspective(400px) rotateX(-20deg);
    }
    60% {
        transform: perspective(400px) rotateX(10deg);
        opacity: 1;
    }
    80% {
        transform: perspective(400px) rotateX(-5deg);
    }
    100% {
        transform: perspective(400px) rotateX(0deg);
        opacity: 1;
    }
}

@keyframes flipInY {
    from {
        transform: perspective(400px) rotateY(90deg);
        opacity: 0;
    }
    40% {
        transform: perspective(400px) rotateY(-20deg);
    }
    60% {
        transform: perspective(400px) rotateY(10deg);
        opacity: 1;
    }
    80% {
        transform: perspective(400px) rotateY(-5deg);
    }
    100% {
        transform: perspective(400px) rotateY(0deg);
        opacity: 1;
    }
}

/* Light Speed Animations */
@keyframes lightSpeedIn {
    from {
        transform: translateX(100%) skewX(-30deg);
        opacity: 0;
    }
    60% {
        transform: translateX(-20%) skewX(30deg);
        opacity: 1;
    }
    80% {
        transform: translateX(0%) skewX(-15deg);
        opacity: 1;
    }
    100% {
        transform: translateX(0%) skewX(0deg);
        opacity: 1;
    }
}

@keyframes lightSpeedOut {
    from {
        opacity: 1;
    }
    100% {
        transform: translateX(100%) skewX(30deg);
        opacity: 0;
    }
}

/* Elastic Animations */
@keyframes elasticIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes elasticOut {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(0);
    }
}

/* Hover Effects */
.hover-lift {
    transition: transform var(--animation-duration) var(--easing);
}

.hover-lift:hover {
    transform: translateY(-5px);
}

.hover-scale {
    transition: transform var(--animation-duration) var(--easing);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-rotate {
    transition: transform var(--animation-duration) var(--easing);
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

.hover-glow {
    transition: box-shadow var(--animation-duration) var(--easing);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(74, 144, 226, 0.5);
}

.hover-shake:hover {
    animation: shake 0.5s ease-in-out;
}

.hover-pulse:hover {
    animation: pulse 1s infinite;
}

.hover-bounce:hover {
    animation: bounceIn 0.6s var(--easing-bounce);
}

/* Loading Animations */
.loading-dots {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
}

.loading-dots div {
    position: absolute;
    top: 33px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--primary-color);
    animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.loading-dots div:nth-child(1) {
    left: 8px;
    animation: loading-dots1 0.6s infinite;
}

.loading-dots div:nth-child(2) {
    left: 8px;
    animation: loading-dots2 0.6s infinite;
}

.loading-dots div:nth-child(3) {
    left: 32px;
    animation: loading-dots2 0.6s infinite;
}

.loading-dots div:nth-child(4) {
    left: 56px;
    animation: loading-dots3 0.6s infinite;
}

@keyframes loading-dots1 {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes loading-dots3 {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(0);
    }
}

@keyframes loading-dots2 {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(24px, 0);
    }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-bars {
    display: flex;
    gap: 4px;
    align-items: end;
    height: 40px;
}

.loading-bar {
    width: 4px;
    background: var(--primary-color);
    animation: loading-bar-grow 1.2s ease-in-out infinite;
}

.loading-bar:nth-child(1) { animation-delay: 0s; }
.loading-bar:nth-child(2) { animation-delay: 0.1s; }
.loading-bar:nth-child(3) { animation-delay: 0.2s; }
.loading-bar:nth-child(4) { animation-delay: 0.3s; }
.loading-bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes loading-bar-grow {
    0%, 40%, 100% {
        transform: scaleY(0.4);
    }
    20% {
        transform: scaleY(1);
    }
}

/* Progress Animations */
@keyframes progress-bar {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}

.progress-bar {
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
    animation: progress-bar 2s ease-in-out;
}

/* Text Animations */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--primary-color);
    white-space: nowrap;
    animation: typewriter 3s steps(40, end), blink 0.75s step-end infinite;
}

@keyframes text-shine {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

.text-shine {
    background: linear-gradient(90deg, var(--text-color), var(--primary-color), var(--text-color));
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: text-shine 2s linear infinite;
}

/* Floating Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.floating {
    animation: float 3s ease-in-out infinite;
}

/* Gradient Animation */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-animated {
    background: linear-gradient(-45deg, var(--primary-color), var(--secondary-color), var(--accent-color), var(--primary-color));
    background-size: 400% 400%;
    animation: gradient-shift 4s ease infinite;
}

/* Modal Animations */
@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes modalSlideOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-50px);
        opacity: 0;
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Card Animations */
@keyframes cardHover {
    0% {
        transform: translateY(0) scale(1);
    }
    100% {
        transform: translateY(-10px) scale(1.02);
    }
}

.card-animated {
    transition: all var(--animation-duration) var(--easing);
}

.card-animated:hover {
    animation: cardHover var(--animation-duration) var(--easing) forwards;
}

/* Button Animations */
@keyframes buttonPress {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

.button-press:active {
    animation: buttonPress 0.1s ease;
}

/* Scroll Animations */
@keyframes scrollReveal {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s var(--easing);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Parallax Effects */
.parallax-slow {
    transform: translateZ(0);
    transition: transform 0.1s ease-out;
}

.parallax-fast {
    transform: translateZ(0);
    transition: transform 0.1s ease-out;
}

/* Utility Animation Classes */
.animate-fadeIn { animation: fadeIn var(--animation-duration) var(--easing); }
.animate-fadeOut { animation: fadeOut var(--animation-duration) var(--easing); }
.animate-fadeInUp { animation: fadeInUp var(--animation-duration) var(--easing); }
.animate-fadeInDown { animation: fadeInDown var(--animation-duration) var(--easing); }
.animate-fadeInLeft { animation: fadeInLeft var(--animation-duration) var(--easing); }
.animate-fadeInRight { animation: fadeInRight var(--animation-duration) var(--easing); }

.animate-scaleIn { animation: scaleIn var(--animation-duration) var(--easing); }
.animate-scaleOut { animation: scaleOut var(--animation-duration) var(--easing); }
.animate-bounceIn { animation: bounceIn var(--animation-duration-slow) var(--easing-bounce); }
.animate-bounceOut { animation: bounceOut var(--animation-duration-slow) var(--easing-bounce); }

.animate-slideInUp { animation: slideInUp var(--animation-duration) var(--easing); }
.animate-slideInDown { animation: slideInDown var(--animation-duration) var(--easing); }
.animate-slideInLeft { animation: slideInLeft var(--animation-duration) var(--easing); }
.animate-slideInRight { animation: slideInRight var(--animation-duration) var(--easing); }

.animate-rotateIn { animation: rotateIn var(--animation-duration) var(--easing); }
.animate-rotateOut { animation: rotateOut var(--animation-duration) var(--easing); }
.animate-spin { animation: spin 1s linear infinite; }
.animate-spinReverse { animation: spinReverse 1s linear infinite; }

.animate-pulse { animation: pulse 2s infinite; }
.animate-heartbeat { animation: heartbeat 1.5s infinite; }
.animate-shake { animation: shake 0.5s ease-in-out; }
.animate-wobble { animation: wobble 1s ease-in-out; }

.animate-zoomIn { animation: zoomIn var(--animation-duration) var(--easing); }
.animate-zoomOut { animation: zoomOut var(--animation-duration) var(--easing); }
.animate-zoomInUp { animation: zoomInUp var(--animation-duration-slow) var(--easing); }
.animate-zoomInDown { animation: zoomInDown var(--animation-duration-slow) var(--easing); }

.animate-flipInX { animation: flipInX var(--animation-duration-slow) var(--easing); }
.animate-flipInY { animation: flipInY var(--animation-duration-slow) var(--easing); }

.animate-lightSpeedIn { animation: lightSpeedIn var(--animation-duration-slow) var(--easing); }
.animate-lightSpeedOut { animation: lightSpeedOut var(--animation-duration-slow) var(--easing); }

.animate-elasticIn { animation: elasticIn var(--animation-duration-slow) var(--easing-elastic); }
.animate-elasticOut { animation: elasticOut var(--animation-duration-slow) var(--easing-elastic); }

/* Animation Delays */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* Animation Durations */
.duration-fast { animation-duration: var(--animation-duration-fast); }
.duration-normal { animation-duration: var(--animation-duration); }
.duration-slow { animation-duration: var(--animation-duration-slow); }

/* Animation Fill Modes */
.fill-forwards { animation-fill-mode: forwards; }
.fill-backwards { animation-fill-mode: backwards; }
.fill-both { animation-fill-mode: both; }

/* Animation Iteration Counts */
.infinite { animation-iteration-count: infinite; }
.once { animation-iteration-count: 1; }
.twice { animation-iteration-count: 2; }

/* 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;
    }
}