/* ═══════════════════════════════════════════════════════════════════
   TikControl Website - NUEVO SISTEMA DE ANIMACIONES
   Estilo Cyber/Tech con efectos únicos
   ═══════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────
   Fade In Animations
   ───────────────────────────────────────────────────────────────────── */
.animate-fade-in {
    opacity: 0;
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-fade-in-up {
    opacity: 0;
    transform: translateY(40px);
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-fade-in-down {
    opacity: 0;
    transform: translateY(-40px);
    animation: fadeInDown 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-fade-in-left {
    opacity: 0;
    transform: translateX(-40px);
    animation: fadeInLeft 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-fade-in-right {
    opacity: 0;
    transform: translateX(40px);
    animation: fadeInRight 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Delays */
.delay-1 { animation-delay: 0.15s; }
.delay-2 { animation-delay: 0.3s; }
.delay-3 { animation-delay: 0.45s; }
.delay-4 { animation-delay: 0.6s; }
.delay-5 { animation-delay: 0.75s; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ─────────────────────────────────────────────────────────────────────
   NUEVO: Glitch Effect (único de TikControl)
   ───────────────────────────────────────────────────────────────────── */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.glitch::before {
    color: #00d9ff;
    animation: glitch-1 3s infinite linear alternate-reverse;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}

.glitch::after {
    color: #ff3366;
    animation: glitch-2 2s infinite linear alternate-reverse;
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
}

@keyframes glitch-1 {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(2px, -2px); }
    60% { transform: translate(-2px, -2px); }
    80% { transform: translate(2px, 2px); }
}

@keyframes glitch-2 {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(2px, -2px); }
    40% { transform: translate(-2px, 2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(-2px, -2px); }
}

/* ─────────────────────────────────────────────────────────────────────
   NUEVO: Scan Line Effect
   ───────────────────────────────────────────────────────────────────── */
.scan-lines {
    position: relative;
    overflow: hidden;
}

.scan-lines::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 217, 255, 0.03) 2px,
        rgba(0, 217, 255, 0.03) 4px
    );
    pointer-events: none;
    animation: scanMove 8s linear infinite;
}

@keyframes scanMove {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

/* ─────────────────────────────────────────────────────────────────────
   NUEVO: Neon Pulse
   ───────────────────────────────────────────────────────────────────── */
.neon-pulse {
    animation: neonPulse 2s ease-in-out infinite;
}

@keyframes neonPulse {
    0%, 100% {
        box-shadow: 
            0 0 5px rgba(0, 217, 255, 0.5),
            0 0 20px rgba(0, 217, 255, 0.3);
    }
    50% {
        box-shadow: 
            0 0 10px rgba(0, 217, 255, 0.8),
            0 0 40px rgba(0, 217, 255, 0.5),
            0 0 80px rgba(0, 217, 255, 0.3);
    }
}

/* ─────────────────────────────────────────────────────────────────────
   NUEVO: Text Glow Pulse
   ───────────────────────────────────────────────────────────────────── */
.text-glow-pulse {
    animation: textGlowPulse 3s ease-in-out infinite;
}

@keyframes textGlowPulse {
    0%, 100% {
        text-shadow: 0 0 10px rgba(0, 217, 255, 0.5);
    }
    50% {
        text-shadow: 
            0 0 20px rgba(0, 217, 255, 0.8),
            0 0 40px rgba(0, 217, 255, 0.5);
    }
}

/* ─────────────────────────────────────────────────────────────────────
   Scroll-triggered Animations
   ───────────────────────────────────────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-80px);
    transition: all 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(80px);
    transition: all 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* Staggered children */
.stagger-children > * {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-children.active > *:nth-child(1) { transition-delay: 0s; opacity: 1; transform: translateY(0); }
.stagger-children.active > *:nth-child(2) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.stagger-children.active > *:nth-child(3) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.stagger-children.active > *:nth-child(4) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.stagger-children.active > *:nth-child(5) { transition-delay: 0.4s; opacity: 1; transform: translateY(0); }
.stagger-children.active > *:nth-child(6) { transition-delay: 0.5s; opacity: 1; transform: translateY(0); }

/* ─────────────────────────────────────────────────────────────────────
   Hover Animations
   ───────────────────────────────────────────────────────────────────── */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(0, 217, 255, 0.1);
}

.hover-scale {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 
        0 0 30px rgba(0, 217, 255, 0.4),
        0 0 60px rgba(0, 217, 255, 0.2);
}

/* ─────────────────────────────────────────────────────────────────────
   NUEVO: Border Glow Animation
   ───────────────────────────────────────────────────────────────────── */
.border-glow {
    position: relative;
}

.border-glow::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(0, 217, 255, 0.5),
        transparent
    );
    border-radius: inherit;
    z-index: -1;
    animation: borderGlow 3s linear infinite;
}

@keyframes borderGlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ─────────────────────────────────────────────────────────────────────
   Continuous Animations
   ───────────────────────────────────────────────────────────────────── */
.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-bounce {
    animation: bounce 1s infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-ping {
    animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.animate-float {
    animation: float 5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(-15%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes ping {
    75%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* ─────────────────────────────────────────────────────────────────────
   NUEVO: Shimmer Effect
   ───────────────────────────────────────────────────────────────────── */
.animate-shimmer {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 217, 255, 0.1) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ─────────────────────────────────────────────────────────────────────
   NUEVO: Typing Effect
   ───────────────────────────────────────────────────────────────────── */
.animate-typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid var(--primary);
    animation: 
        typing 3.5s steps(40, end),
        blink-caret 0.8s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--primary); }
}

/* ─────────────────────────────────────────────────────────────────────
   Button Animations
   ───────────────────────────────────────────────────────────────────── */
.btn-animate {
    position: relative;
    overflow: hidden;
}

.btn-animate::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-animate:hover::before {
    width: 400px;
    height: 400px;
}

/* Ripple effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(0, 217, 255, 0.4);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ─────────────────────────────────────────────────────────────────────
   Card Animations
   ───────────────────────────────────────────────────────────────────── */
.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-3d:hover {
    transform: rotateY(10deg) rotateX(5deg);
}

/* ─────────────────────────────────────────────────────────────────────
   Loading Animations
   ───────────────────────────────────────────────────────────────────── */
.loading-dots {
    display: inline-flex;
    gap: 6px;
}

.loading-dots span {
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    animation: loadingDots 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes loadingDots {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.loading-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(0, 217, 255, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-bar {
    width: 100%;
    height: 4px;
    background: rgba(0, 217, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.loading-bar::after {
    content: '';
    display: block;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #00ff88);
    border-radius: 4px;
    animation: loadingBar 1.5s ease-in-out infinite;
}

@keyframes loadingBar {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

/* ─────────────────────────────────────────────────────────────────────
   Skeleton Loading
   ───────────────────────────────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 25%,
        rgba(0, 217, 255, 0.1) 50%,
        var(--bg-tertiary) 75%
    );
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ─────────────────────────────────────────────────────────────────────
   NUEVO: Data Stream Effect
   ───────────────────────────────────────────────────────────────────── */
.data-stream {
    position: relative;
    overflow: hidden;
}

.data-stream::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(0, 217, 255, 0.1) 50%,
        transparent 100%
    );
    animation: dataStream 2s linear infinite;
}

@keyframes dataStream {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

/* ─────────────────────────────────────────────────────────────────────
   NUEVO: Circuit Lines
   ───────────────────────────────────────────────────────────────────── */
.circuit-lines {
    position: relative;
}

.circuit-lines::before,
.circuit-lines::after {
    content: '';
    position: absolute;
    background: var(--primary);
    opacity: 0.3;
}

.circuit-lines::before {
    width: 2px;
    height: 30px;
    top: -15px;
    left: 50%;
    animation: circuitPulse 2s ease-in-out infinite;
}

.circuit-lines::after {
    width: 30px;
    height: 2px;
    top: 50%;
    left: -15px;
    animation: circuitPulse 2s ease-in-out infinite 0.5s;
}

@keyframes circuitPulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.8; }
}

/* ─────────────────────────────────────────────────────────────────────
   Reduced Motion
   ───────────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale {
        opacity: 1;
        transform: none;
    }
}
