/* ================================
   APIMobiz - Custom Animations
   ================================ */

/* === KEYFRAME ANIMATIONS === */

/* Fade In Up - Smooth entrance from bottom */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Right - Slide from right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In Left - Slide from left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Zoom In - Scale up entrance */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Float Animation - Gentle up and down */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Pulse - Gentle scale pulse */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Shimmer - Loading effect */
@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Rotate - Continuous rotation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Bounce - Bounce effect */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Slide Down - Reveal from top */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Gradient Shift - Animated gradient */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Glow - Pulsing glow effect */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.8), 0 0 30px rgba(59, 130, 246, 0.6);
    }
}


/* === UTILITY CLASSES === */

/* Fade In Animations */
.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.fade-in-right {
    animation: fadeInRight 0.8s ease-out forwards;
}

.fade-in-left {
    animation: fadeInLeft 0.8s ease-out forwards;
}

/* Zoom Animations */
.zoom-in {
    animation: zoomIn 0.6s ease-out forwards;
    opacity: 0;
}

/* Float Animation */
.float {
    animation: float 3s ease-in-out infinite;
}

/* Pulse Animation */
.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Bounce Animation */
.bounce {
    animation: bounce 2s ease-in-out infinite;
}

/* Slide Down */
.slide-down {
    animation: slideDown 0.6s ease-out forwards;
}

/* Rotate */
.rotate {
    animation: rotate 2s linear infinite;
}


/* === HOVER ANIMATIONS === */

/* Scale on Hover */
.scale-hover {
    transition: transform 0.3s ease;
}

.scale-hover:hover {
    transform: scale(1.05);
}

/* Lift on Hover */
.lift-hover {
    transition: all 0.3s ease;
}

.lift-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Glow on Hover */
.glow-hover {
    transition: all 0.3s ease;
}

.glow-hover:hover {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.6);
}

/* Pulse on Hover */
.pulse-hover {
    transition: all 0.3s ease;
}

.pulse-hover:hover {
    animation: pulse 0.6s ease-in-out;
}

/* Rotate on Hover */
.rotate-hover {
    transition: transform 0.3s ease;
}

.rotate-hover:hover {
    transform: rotate(5deg);
}

/* Shake on Hover */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.shake-hover:hover {
    animation: shake 0.5s ease-in-out;
}

/* Flip on Hover */
.flip-hover {
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
}

.flip-hover:hover {
    transform: rotateY(180deg);
}


/* === LOADING ANIMATIONS === */

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(59, 130, 246, 0.1);
    border-top-color: #3B82F6;
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

/* Dots Loading */
@keyframes dotFlashing {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

.loading-dots span {
    animation: dotFlashing 1.4s infinite ease-in-out;
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #3B82F6;
    margin: 0 2px;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}


/* === SCROLL ANIMATIONS === */

/* Elements that animate on scroll */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}


/* === STAGGER ANIMATIONS === */

/* Staggered fade-in for lists */
.stagger-animate > * {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease-out forwards;
}

.stagger-animate > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-animate > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-animate > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-animate > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-animate > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-animate > *:nth-child(6) { animation-delay: 0.6s; }
.stagger-animate > *:nth-child(7) { animation-delay: 0.7s; }
.stagger-animate > *:nth-child(8) { animation-delay: 0.8s; }
.stagger-animate > *:nth-child(9) { animation-delay: 0.9s; }


/* === BACKGROUND ANIMATIONS === */

/* Animated gradient background */
.gradient-animate {
    background: linear-gradient(270deg, #1E3A8A, #3B82F6, #60A5FA);
    background-size: 400% 400%;
    animation: gradientShift 10s ease infinite;
}


/* === TEXT ANIMATIONS === */

/* Typing effect */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.typing-effect {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid;
    animation: typing 3s steps(40) forwards;
}

/* Text reveal */
@keyframes textReveal {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

.text-reveal {
    animation: textReveal 1s ease-out forwards;
}


/* === BUTTON ANIMATIONS === */

/* Button ripple effect */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-ripple:hover::after {
    width: 300px;
    height: 300px;
}


/* === SPECIAL EFFECTS === */

/* Parallax effect */
.parallax {
    transition: transform 0.1s ease-out;
}

/* Glass morphism effect */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Neon glow */
.neon-glow {
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.8),
                 0 0 20px rgba(59, 130, 246, 0.6),
                 0 0 30px rgba(59, 130, 246, 0.4);
}


/* === RESPONSIVE ANIMATIONS === */

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Disable complex animations on mobile for performance */
@media (max-width: 768px) {
    .rotate {
        animation: none;
    }
    
    .complex-animation {
        animation: fadeInUp 0.5s ease-out forwards;
    }
}

