/* ===============================================
   JOTAC DIGITAL - ADVANCED ANIMATIONS
   Enhanced Technological Effects
   =============================================== */

/* ===== ADVANCED KEYFRAMES ===== */
@keyframes matrix-rain {
    0% {
        opacity: 0;
        transform: translateY(-100vh);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(100vh);
    }
}

@keyframes data-flow {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes circuit-pulse {
    0%, 100% {
        box-shadow: 
            0 0 5px var(--accent-blue),
            inset 0 0 5px var(--accent-blue);
    }
    50% {
        box-shadow: 
            0 0 20px var(--accent-blue),
            0 0 30px var(--accent-blue),
            inset 0 0 10px var(--accent-blue);
    }
}

@keyframes hologram {
    0%, 100% {
        transform: translateZ(0);
        filter: hue-rotate(0deg);
    }
    25% {
        transform: translateZ(10px);
        filter: hue-rotate(90deg);
    }
    50% {
        transform: translateZ(0);
        filter: hue-rotate(180deg);
    }
    75% {
        transform: translateZ(-10px);
        filter: hue-rotate(270deg);
    }
}

@keyframes scan-line {
    0% {
        top: 0%;
        opacity: 1;
    }
    100% {
        top: 100%;
        opacity: 0;
    }
}

@keyframes cyber-glitch {
    0%, 100% {
        transform: translate(0);
        filter: hue-rotate(0deg);
    }
    20% {
        transform: translate(-2px, 2px);
        filter: hue-rotate(90deg);
    }
    40% {
        transform: translate(-2px, -2px);
        filter: hue-rotate(180deg);
    }
    60% {
        transform: translate(2px, 2px);
        filter: hue-rotate(270deg);
    }
    80% {
        transform: translate(2px, -2px);
        filter: hue-rotate(360deg);
    }
}

@keyframes neon-flicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        text-shadow: 
            0 0 5px var(--accent-cyan),
            0 0 10px var(--accent-cyan),
            0 0 15px var(--accent-cyan),
            0 0 20px var(--accent-cyan);
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}

@keyframes energy-wave {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* ===== ENHANCED HERO ANIMATIONS ===== */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(90deg, transparent 0%, rgba(0, 212, 255, 0.03) 50%, transparent 100%);
    animation: data-flow 8s ease-in-out infinite;
    z-index: 1;
}

/* Enhanced Circuit Pattern */
.circuit-pattern::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: var(--accent-blue);
    top: 20%;
    left: 0;
    animation: circuit-pulse 3s ease-in-out infinite;
    opacity: 0.5;
}

.circuit-pattern::before {
    content: '';
    position: absolute;
    width: 2px;
    height: 100%;
    background: var(--accent-cyan);
    left: 30%;
    top: 0;
    animation: circuit-pulse 2s ease-in-out infinite reverse;
    opacity: 0.3;
}

/* ===== TECH GLOBE ENHANCEMENTS ===== */
.tech-globe::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    border: 1px solid rgba(0, 212, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: energy-wave 4s ease-out infinite;
}

/* Enhanced Data Nodes */
.data-node::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    width: 12px;
    height: 12px;
    border: 1px solid var(--accent-cyan);
    border-radius: 50%;
    animation: energy-wave 2s ease-out infinite;
}

/* ===== SERVICE CARDS ENHANCEMENTS ===== */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(0, 212, 255, 0.1), 
        transparent
    );
    transition: left 0.8s ease;
}

.service-card:hover::after {
    left: 100%;
}

/* Holographic Effect for Service Icons */
.service-icon {
    animation: hologram 4s ease-in-out infinite;
}

.service-card:hover .service-icon {
    animation-duration: 1s;
}

/* ===== SCAN LINE EFFECTS ===== */
.hero-visual::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        var(--accent-cyan), 
        transparent
    );
    animation: scan-line 3s linear infinite;
    z-index: 10;
}

/* ===== GLITCH EFFECTS ===== */
.glitch-text {
    position: relative;
    animation: cyber-glitch 0.3s linear infinite;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch-text::before {
    animation: cyber-glitch 0.4s linear infinite;
    color: var(--accent-cyan);
    z-index: -1;
}

.glitch-text::after {
    animation: cyber-glitch 0.5s linear infinite;
    color: var(--accent-purple);
    z-index: -2;
}

/* ===== NEON TEXT EFFECTS ===== */
.neon-text {
    animation: neon-flicker 2s linear infinite;
}

/* ===== MATRIX BACKGROUND ===== */
.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.03;
}

.matrix-char {
    position: absolute;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: var(--accent-cyan);
    animation: matrix-rain 3s linear infinite;
}

/* ===== SCROLL TRIGGERED ANIMATIONS ===== */
.slide-up {
    transform: translateY(50px);
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide-up.animate {
    transform: translateY(0);
    opacity: 1;
}

.slide-left {
    transform: translateX(-50px);
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide-left.animate {
    transform: translateX(0);
    opacity: 1;
}

.slide-right {
    transform: translateX(50px);
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide-right.animate {
    transform: translateX(0);
    opacity: 1;
}

.fade-in-scale {
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in-scale.animate {
    transform: scale(1);
    opacity: 1;
}

/* ===== STAGGERED ANIMATIONS ===== */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* ===== LOADING ANIMATIONS ===== */
.cyber-loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-blue);
    animation: spin 1s ease-in-out infinite;
}

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

/* ===== HOVER ENHANCEMENTS ===== */
.tech-hover {
    position: relative;
    transition: all 0.3s ease;
}

.tech-hover::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gradient-primary);
    border-radius: inherit;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.tech-hover:hover::before {
    opacity: 1;
}

.tech-hover:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 212, 255, 0.3);
}

/* ===== PARTICLE SYSTEM ===== */
.particle {
    position: absolute;
    background: var(--accent-cyan);
    border-radius: 50%;
    pointer-events: none;
    animation: particle-float 6s linear infinite;
}

@keyframes particle-float {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(50px);
        opacity: 0;
    }
}

/* ===== TYPEWRITER EFFECT ===== */
.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--accent-cyan);
    white-space: nowrap;
    animation: 
        typing 3.5s steps(40, end),
        blink-caret 0.75s step-end infinite;
}

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

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--accent-cyan); }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
.will-animate {
    will-change: transform, opacity;
}

/* ===== RESPONSIVE ANIMATION ADJUSTMENTS ===== */
@media (max-width: 768px) {
    .tech-globe::after {
        width: 150px;
        height: 150px;
    }
    
    .service-card:hover {
        transform: translateY(-5px);
    }
    
    .tech-hover:hover {
        transform: translateY(-3px) scale(1.01);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cyber-glitch,
    .neon-flicker,
    .matrix-rain,
    .hologram,
    .particle-float {
        animation: none;
    }
    
    .service-card::after,
    .hero::before {
        animation: none;
    }
}