/* ============================================
   MCP Analytics Website - Animations
   ============================================ */

/* ============================================
   KEYFRAME DEFINITIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(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);
    }
}

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

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

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

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-20px);
    }
    50% {
        transform: translateY(-10px);
    }
    75% {
        transform: translateY(-15px);
    }
}

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

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

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

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 117, 24, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 117, 24, 0.8);
    }
}

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

@keyframes blink {
    0%, 50%, 100% {
        opacity: 1;
    }
    25%, 75% {
        opacity: 0;
    }
}

/* ============================================
   LOADING ANIMATIONS
   ============================================ */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-light);
    border-top-color: var(--primary-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes dots {
    0%, 20% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.5);
    }
}

.loading-dots {
    display: flex;
    gap: 8px;
}

.loading-dots span {
    width: 12px;
    height: 12px;
    background: var(--primary-orange);
    border-radius: 50%;
    animation: dots 1.4s infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.scroll-animate.fade-left {
    transform: translateX(-30px);
}

.scroll-animate.fade-left.scrolled {
    transform: translateX(0);
}

.scroll-animate.fade-right {
    transform: translateX(30px);
}

.scroll-animate.fade-right.scrolled {
    transform: translateX(0);
}

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

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

/* Staggered animations */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-children.scrolled > * {
    opacity: 1;
    transform: translateY(0);
}

.stagger-children.scrolled > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-children.scrolled > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-children.scrolled > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-children.scrolled > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-children.scrolled > *:nth-child(5) { transition-delay: 0.5s; }
.stagger-children.scrolled > *:nth-child(6) { transition-delay: 0.6s; }

/* ============================================
   HOVER ANIMATIONS
   ============================================ */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.hover-grow {
    transition: transform 0.3s ease;
}

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

.hover-shrink {
    transition: transform 0.3s ease;
}

.hover-shrink:hover {
    transform: scale(0.95);
}

.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(255, 117, 24, 0.5);
}

/* ============================================
   BUTTON ANIMATIONS
   ============================================ */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Ripple effect */
@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
}

.ripple:active::after {
    animation: ripple 0.6s ease-out;
}

/* ============================================
   CARD ANIMATIONS
   ============================================ */
.card-flip {
    perspective: 1000px;
}

.card-flip-inner {
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card-flip:hover .card-flip-inner {
    transform: rotateY(180deg);
}

.card-flip-front,
.card-flip-back {
    backface-visibility: hidden;
}

.card-flip-back {
    transform: rotateY(180deg);
}

/* Card entrance animations */
.card-slide-up {
    animation: fadeInUp 0.6s ease-out;
}

.card-slide-down {
    animation: fadeInDown 0.6s ease-out;
}

.card-slide-left {
    animation: fadeInLeft 0.6s ease-out;
}

.card-slide-right {
    animation: fadeInRight 0.6s ease-out;
}

.card-scale {
    animation: scaleIn 0.6s ease-out;
}

/* ============================================
   TEXT ANIMATIONS
   ============================================ */
.text-gradient-animate {
    background: linear-gradient(
        90deg,
        var(--primary-orange),
        var(--accent-blue),
        var(--primary-orange)
    );
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 3s linear infinite;
}

@keyframes gradient-shift {
    to {
        background-position: 200% center;
    }
}

.text-typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid var(--primary-orange);
    animation: 
        typewriter 3s steps(40, end),
        blink 0.75s step-end infinite;
}

.text-fade-in {
    animation: fadeIn 1s ease-out;
}

.text-bounce {
    display: inline-block;
    animation: bounce 2s infinite;
}

/* ============================================
   NOTIFICATION ANIMATIONS
   ============================================ */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.notification-enter {
    animation: slideDown 0.3s ease-out;
}

.notification-exit {
    animation: slideUp 0.3s ease-out reverse;
}

/* ============================================
   MODAL ANIMATIONS
   ============================================ */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.9) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-backdrop {
    animation: modalFadeIn 0.3s ease-out;
}

.modal-content {
    animation: modalSlideIn 0.3s ease-out;
}

/* ============================================
   PROGRESS ANIMATIONS
   ============================================ */
@keyframes progress-fill {
    from {
        width: 0;
    }
    to {
        width: var(--progress-value, 50%);
    }
}

.progress-bar {
    position: relative;
    overflow: hidden;
}

.progress-fill {
    animation: progress-fill 1s ease-out forwards;
}

.progress-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s linear infinite;
}

/* ============================================
   SKELETON LOADING
   ============================================ */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-light) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        var(--bg-light) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ============================================
   PARTICLE EFFECTS
   ============================================ */
@keyframes particle-float {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(100px);
    }
}

.particle {
    position: fixed;
    pointer-events: none;
    opacity: 0;
    animation: particle-float 10s linear infinite;
}

.particle:nth-child(2n) {
    animation-delay: 2s;
    animation-duration: 12s;
}

.particle:nth-child(3n) {
    animation-delay: 4s;
    animation-duration: 8s;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.animate-once {
    animation-iteration-count: 1;
    animation-fill-mode: forwards;
}

.animate-delay-100 { animation-delay: 100ms; }
.animate-delay-200 { animation-delay: 200ms; }
.animate-delay-300 { animation-delay: 300ms; }
.animate-delay-400 { animation-delay: 400ms; }
.animate-delay-500 { animation-delay: 500ms; }

.animate-duration-fast { animation-duration: 0.3s; }
.animate-duration-normal { animation-duration: 0.5s; }
.animate-duration-slow { animation-duration: 1s; }
.animate-duration-slower { animation-duration: 2s; }

.transition-all { transition: all 0.3s ease; }
.transition-colors { transition: background-color 0.3s ease, color 0.3s ease; }
.transition-transform { transition: transform 0.3s ease; }
.transition-opacity { transition: opacity 0.3s ease; }