/**
 * ⚡ Advanced Animations - BitForward
 * Animaciones avanzadas y efectos especiales
 */

/* ============================================
   CURSOR PERSONALIZADO
   ============================================ */

body {
    cursor: default;
}

/* Cursor custom (opcional - solo desktop) */
@media (min-width: 1024px) and (pointer: fine) {
    body.custom-cursor {
        cursor: none;
    }

    .cursor-dot {
        position: fixed;
        width: 8px;
        height: 8px;
        background: var(--cyan-500);
        border-radius: 50%;
        pointer-events: none;
        z-index: 10000;
        mix-blend-mode: difference;
        transition: transform 0.15s ease;
    }

    .cursor-outline {
        position: fixed;
        width: 32px;
        height: 32px;
        border: 2px solid var(--cyan-500);
        border-radius: 50%;
        pointer-events: none;
        z-index: 10000;
        mix-blend-mode: difference;
        transition: transform 0.2s ease, width 0.2s ease, height 0.2s ease;
    }

    body.custom-cursor a:hover ~ .cursor-outline,
    body.custom-cursor button:hover ~ .cursor-outline {
        width: 48px;
        height: 48px;
    }
}

/* ============================================
   LOADING STATES
   ============================================ */

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

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

/* Skeleton loading */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--glass-bg) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        var(--glass-bg) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-heading {
    height: 2em;
    width: 60%;
    margin-bottom: 1em;
}

.skeleton-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

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

/* ============================================
   PULSE ANIMATIONS
   ============================================ */

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

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

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

@keyframes pulseGlow {
    0%, 100% {
        filter: drop-shadow(0 0 10px currentColor);
    }
    50% {
        filter: drop-shadow(0 0 20px currentColor);
    }
}

/* ============================================
   BOUNCE ANIMATIONS
   ============================================ */

.bounce {
    animation: bounce 1s ease infinite;
}

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

.bounce-in {
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   SHAKE ANIMATIONS
   ============================================ */

.shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake-vertical {
    animation: shakeVertical 0.5s ease;
}

@keyframes shakeVertical {
    0%, 100% { transform: translateY(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateY(-5px); }
    20%, 40%, 60%, 80% { transform: translateY(5px); }
}

/* ============================================
   ROTATE ANIMATIONS
   ============================================ */

.rotate {
    animation: rotate 2s linear infinite;
}

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

.rotate-slow {
    animation: rotate 4s linear infinite;
}

/* ============================================
   SLIDE ANIMATIONS
   ============================================ */

.slide-in-left {
    animation: slideInLeft 0.6s ease;
}

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

.slide-in-right {
    animation: slideInRight 0.6s ease;
}

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

.slide-in-top {
    animation: slideInTop 0.6s ease;
}

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

.slide-in-bottom {
    animation: slideInBottom 0.6s ease;
}

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

/* ============================================
   FADE ANIMATIONS
   ============================================ */

.fade-in {
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-out {
    animation: fadeOut 0.6s ease;
}

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

/* ============================================
   SCALE ANIMATIONS
   ============================================ */

.scale-in {
    animation: scaleIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.scale-out {
    animation: scaleOut 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* ============================================
   FLIP ANIMATIONS
   ============================================ */

.flip {
    animation: flip 0.6s ease;
}

@keyframes flip {
    0% { transform: perspective(400px) rotateY(0); }
    100% { transform: perspective(400px) rotateY(360deg); }
}

/* ============================================
   GLOW EFFECTS
   ============================================ */

.glow-cyan {
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.6);
}

.glow-purple {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.6);
}

.glow-pink {
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.6);
}

.glow-animate {
    animation: glowAnimate 2s ease-in-out infinite;
}

@keyframes glowAnimate {
    0%, 100% {
        box-shadow: 0 0 20px currentColor;
    }
    50% {
        box-shadow: 0 0 40px currentColor;
    }
}

/* ============================================
   TEXT EFFECTS
   ============================================ */

.text-gradient {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-glow {
    text-shadow: 0 0 10px currentColor;
}

.text-stroke {
    -webkit-text-stroke: 1px currentColor;
    -webkit-text-fill-color: transparent;
}

/* ============================================
   HOVER EFFECTS
   ============================================ */

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

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.hover-glow:hover {
    box-shadow: 0 0 30px currentColor;
}

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

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

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

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

/* ============================================
   UTILITY CLASSES
   ============================================ */

.no-animation {
    animation: none !important;
    transition: none !important;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

.duration-fast { animation-duration: 0.3s; }
.duration-normal { animation-duration: 0.6s; }
.duration-slow { animation-duration: 1s; }

/* ============================================
   ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--cyan-500);
    outline-offset: 2px;
}
