/**
 * API.DevWharf - Animation Styles
 * Cyberpunk animated background effects - Refined Edition
 */

/* ===============================
   BACKGROUND LAYERS
   =============================== */

#cyber-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(139, 92, 246, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(0, 255, 249, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 0, 255, 0.04) 0%, transparent 70%),
        linear-gradient(180deg, #0a0a0f 0%, #12121a 50%, #0a0a0f 100%);
    animation: bgShift 30s ease-in-out infinite;
}

@keyframes bgShift {
    0%, 100% {
        background-position: 0% 0%, 100% 100%, 50% 50%, 0% 0%;
    }
    50% {
        background-position: 100% 100%, 0% 0%, 50% 50%, 0% 0%;
    }
}

/* Grid Overlay - Subtle perspective grid */
#grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-image:
        linear-gradient(rgba(0, 255, 249, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 249, 0.015) 1px, transparent 1px);
    background-size: 80px 80px;
    pointer-events: none;
    opacity: 0.8;
}

/* ===============================
   PARTICLE SYSTEM
   =============================== */

.particle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
}

.particle-cyan {
    background: rgba(0, 255, 249, 0.5);
    box-shadow: 0 0 8px rgba(0, 255, 249, 0.6), 0 0 16px rgba(0, 255, 249, 0.3);
}

.particle-magenta {
    background: rgba(255, 0, 255, 0.5);
    box-shadow: 0 0 8px rgba(255, 0, 255, 0.6), 0 0 16px rgba(255, 0, 255, 0.3);
}

.particle-purple {
    background: rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.6), 0 0 16px rgba(139, 92, 246, 0.3);
}

/* ===============================
   FLOATING SYMBOLS
   =============================== */

.floating-symbol {
    position: fixed;
    font-family: 'JetBrains Mono', monospace;
    pointer-events: none;
    z-index: -1;
    opacity: 0;
    animation: symbolFloat 20s ease-in-out infinite;
}

@keyframes symbolFloat {
    0% {
        opacity: 0;
        transform: translateY(100vh) rotate(0deg) scale(0.8);
    }
    10% {
        opacity: 0.2;
    }
    50% {
        opacity: 0.25;
    }
    90% {
        opacity: 0.2;
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) rotate(180deg) scale(1);
    }
}

/* ===============================
   GLOWING ORBS
   =============================== */

.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: -2;
    animation: orbFloat 40s ease-in-out infinite;
}

.glow-orb-1 {
    width: 400px;
    height: 400px;
    background: rgba(139, 92, 246, 0.08);
    top: 5%;
    left: 5%;
    animation-delay: 0s;
}

.glow-orb-2 {
    width: 500px;
    height: 500px;
    background: rgba(0, 255, 249, 0.06);
    top: 50%;
    right: 5%;
    animation-delay: -15s;
}

.glow-orb-3 {
    width: 350px;
    height: 350px;
    background: rgba(255, 0, 255, 0.05);
    bottom: 10%;
    left: 25%;
    animation-delay: -30s;
}

@keyframes orbFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.6;
    }
    25% {
        transform: translate(50px, -80px) scale(1.15);
        opacity: 0.8;
    }
    50% {
        transform: translate(-30px, 40px) scale(0.9);
        opacity: 0.5;
    }
    75% {
        transform: translate(60px, 50px) scale(1.1);
        opacity: 0.7;
    }
}

/* ===============================
   AURORA WAVES - New elegant effect
   =============================== */

.aurora-wave {
    position: fixed;
    left: 0;
    width: 200%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(0, 255, 249, 0.3) 25%,
        rgba(139, 92, 246, 0.4) 50%,
        rgba(255, 0, 255, 0.3) 75%,
        transparent 100%
    );
    z-index: -1;
    pointer-events: none;
    animation: auroraFlow 12s ease-in-out infinite;
    filter: blur(1px);
}

@keyframes auroraFlow {
    0% {
        transform: translateX(-50%) scaleY(1);
        opacity: 0;
    }
    20% {
        opacity: 0.6;
    }
    80% {
        opacity: 0.6;
    }
    100% {
        transform: translateX(0%) scaleY(1.5);
        opacity: 0;
    }
}

/* ===============================
   HEX PATTERN
   =============================== */

.hex-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
    opacity: 0.4;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%2300fff9' fill-opacity='0.02'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* ===============================
   CONSTELLATION EFFECT - New
   =============================== */

.constellation-dot {
    position: fixed;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(0, 255, 249, 0.6);
    pointer-events: none;
    z-index: -1;
    animation: starTwinkle 4s ease-in-out infinite;
}

@keyframes starTwinkle {
    0%, 100% { 
        opacity: 0.3;
        transform: scale(1);
    }
    50% { 
        opacity: 0.8;
        transform: scale(1.3);
    }
}

.constellation-line {
    position: fixed;
    height: 1px;
    background: linear-gradient(90deg,
        rgba(0, 255, 249, 0.4),
        rgba(139, 92, 246, 0.4)
    );
    pointer-events: none;
    z-index: -1;
    opacity: 0;
    animation: lineFade 6s ease-in-out infinite;
}

@keyframes lineFade {
    0%, 100% { opacity: 0; }
    50% { opacity: 0.3; }
}

/* ===============================
   NOISE OVERLAY
   =============================== */

.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9998;
    pointer-events: none;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ===============================
   REDUCED MOTION
   =============================== */

@media (prefers-reduced-motion: reduce) {
    #cyber-bg,
    #grid-overlay,
    .particle,
    .floating-symbol,
    .glow-orb,
    .aurora-wave,
    .constellation-dot,
    .constellation-line {
        animation: none !important;
    }
}
