/* ===== Enhanced Animations CSS ===== */

/* ===== Keyframe 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 scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -15px, 0);
    }
    70% {
        transform: translate3d(0, -8px, 0);
    }
    90% {
        transform: translate3d(0, -3px, 0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-10px) rotate(1deg);
    }
    66% {
        transform: translateY(5px) rotate(-1deg);
    }
}

@keyframes wave {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(5deg);
    }
    75% {
        transform: rotate(-5deg);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(59, 130, 246, 0.6);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes morphShape {
    0%, 100% {
        border-radius: 50% 50% 50% 50%;
    }
    25% {
        border-radius: 30% 70% 70% 30%;
    }
    50% {
        border-radius: 50% 30% 30% 50%;
    }
    75% {
        border-radius: 70% 50% 50% 70%;
    }
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@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 zoomIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes flipIn {
    0% {
        transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
        opacity: 0;
    }
    40% {
        transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
    }
    60% {
        transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
        opacity: 1;
    }
    80% {
        transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
    }
    100% {
        transform: perspective(400px);
        opacity: 1;
    }
}

/* ===== Animation Classes ===== */
.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 0.6s ease-out forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.6s ease-out forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.6s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.4s ease-out forwards;
}

.animate-slide-in-up {
    animation: slideInUp 0.5s ease-out forwards;
}

.animate-bounce {
    animation: bounce 1s ease-in-out;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-wave {
    animation: wave 2s ease-in-out infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

.animate-shimmer {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

.animate-morph {
    animation: morphShape 8s ease-in-out infinite;
}

.animate-gradient-flow {
    background-size: 200% 200%;
    animation: gradientFlow 3s ease infinite;
}

.animate-zoom-in {
    animation: zoomIn 0.5s ease-out forwards;
}

.animate-flip-in {
    animation: flipIn 0.8s ease-out forwards;
}

/* ===== Hover Animations ===== */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.hover-scale {
    transition: transform 0.2s 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(59, 130, 246, 0.4);
}

.hover-gradient {
    background: linear-gradient(45deg, var(--primary-600), var(--secondary-600));
    background-size: 200% 200%;
    transition: background-position 0.3s ease;
}

.hover-gradient:hover {
    background-position: 100% 100%;
}

/* ===== Loading Animations ===== */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid var(--primary-600);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: dots 2s infinite;
}

@keyframes dots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

.loading-pulse {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ===== Progress Animations ===== */
.progress-bar {
    width: 100%;
    height: 4px;
    background: #f3f4f6;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-600), var(--secondary-600));
    border-radius: 2px;
    transition: width 0.3s ease;
}

.progress-indeterminate {
    background: linear-gradient(90deg, transparent, var(--primary-600), transparent);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ===== Stagger Animations ===== */
.stagger-animation > * {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease-out forwards;
}

.stagger-animation > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-animation > *:nth-child(6) { animation-delay: 0.6s; }

/* ===== Modal Animations ===== */
.modal {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active .modal-backdrop {
    opacity: 1;
}

.modal-content {
    transform: translateY(-50px) scale(0.9);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: translateY(0) scale(1);
}

/* ===== Notification Animations ===== */
.notification {
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification.visible {
    transform: translateX(0);
}

/* ===== Parallax Animations ===== */
.parallax-slow {
    transform: translateY(0);
    transition: transform 0.1s ease-out;
}

.parallax-medium {
    transform: translateY(0);
    transition: transform 0.1s ease-out;
}

.parallax-fast {
    transform: translateY(0);
    transition: transform 0.1s ease-out;
}

/* ===== Text Animations ===== */
.text-reveal {
    overflow: hidden;
}

.text-reveal .word {
    display: inline-block;
    transform: translateY(100%);
    animation: slideInUp 0.6s ease-out forwards;
}

.text-reveal .word:nth-child(1) { animation-delay: 0.1s; }
.text-reveal .word:nth-child(2) { animation-delay: 0.2s; }
.text-reveal .word:nth-child(3) { animation-delay: 0.3s; }
.text-reveal .word:nth-child(4) { animation-delay: 0.4s; }
.text-reveal .word:nth-child(5) { animation-delay: 0.5s; }

.typewriter-effect {
    overflow: hidden;
    border-right: 2px solid var(--primary-600);
    white-space: nowrap;
    animation: typewriter 3s steps(40, end), blink 1s infinite;
}

/* ===== Scroll Animations ===== */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Button Animations ===== */
.btn-animated {
    position: relative;
    overflow: hidden;
}

.btn-animated::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 ease;
}

.btn-animated:hover::before {
    left: 100%;
}

/* ===== Mobile Optimizations ===== */
@media (max-width: 768px) {
    .animate-fade-in-up,
    .animate-fade-in-down,
    .animate-fade-in-left,
    .animate-fade-in-right {
        animation-duration: 0.4s;
    }
    
    .animate-float,
    .animate-wave {
        animation-duration: 4s;
    }
    
    .hover-lift:hover {
        transform: translateY(-4px);
    }
}

/* ===== 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;
        scroll-behavior: auto !important;
    }
    
    .animate-float,
    .animate-wave,
    .animate-bounce,
    .animate-pulse,
    .animate-spin,
    .animate-heartbeat,
    .animate-morph,
    .animate-gradient-flow {
        animation: none !important;
    }
}

/* ===== High Contrast Mode ===== */
@media (prefers-contrast: high) {
    .animate-glow,
    .hover-glow {
        animation: none;
        box-shadow: none;
    }
    
    .animate-shimmer,
    .loading-pulse,
    .progress-indeterminate {
        animation: none;
        background: currentColor;
    }
}

/* ===== Print Styles ===== */
@media print {
    .animate-fade-in-up,
    .animate-fade-in-down,
    .animate-fade-in-left,
    .animate-fade-in-right,
    .animate-scale-in,
    .animate-slide-in-up,
    .animate-zoom-in,
    .animate-flip-in {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
} 