/**
 * Neural Network Sphere - Next-Gen Digital Visualization
 * Interconnected nodes with data flow animation + Geometric morphing
 */

.hero-sphere-container {
    position: relative;
    width: 320px;
    height: 320px;
    perspective: 1200px;
    filter: drop-shadow(0 0 40px rgba(255, 67, 8, 0.3));
}

.hero-3d-sphere {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    animation: neuralRotate 30s linear infinite;
}

/* Main sphere core with glassmorphic effect */
.sphere-core {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background:
        radial-gradient(circle at 25% 25%, rgba(254, 254, 31, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 75% 75%, rgba(255, 67, 8, 0.2) 0%, transparent 50%),
        radial-gradient(circle at center, transparent 30%, rgba(251, 133, 0, 0.1) 60%, transparent 100%);
    backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 67, 8, 0.3);
    box-shadow:
        inset -30px -30px 60px rgba(0, 0, 0, 0.6),
        inset 30px 30px 60px rgba(255, 67, 8, 0.1),
        0 0 60px rgba(255, 67, 8, 0.4),
        0 0 120px rgba(251, 133, 0, 0.2);
    overflow: visible;
}

/* Holographic grid overlay */
.sphere-core::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background:
        repeating-linear-gradient(0deg, transparent 0px, rgba(255, 67, 8, 0.03) 1px, transparent 2px, transparent 15px),
        repeating-linear-gradient(90deg, transparent 0px, rgba(251, 133, 0, 0.03) 1px, transparent 2px, transparent 15px);
    animation: gridScan 4s linear infinite;
}

/* Hexagonal mesh pattern */
.sphere-core::after {
    content: '';
    position: absolute;
    inset: 10%;
    border-radius: 50%;
    background:
        radial-gradient(circle, transparent 30%, rgba(255, 67, 8, 0.05) 31%, transparent 32%),
        radial-gradient(circle, transparent 45%, rgba(251, 133, 0, 0.08) 46%, transparent 47%),
        radial-gradient(circle, transparent 60%, rgba(254, 254, 31, 0.05) 61%, transparent 62%);
    background-size: 50px 50px, 70px 70px, 90px 90px;
    animation: hexPulse 6s ease-in-out infinite;
    opacity: 0.7;
}

/* Neural network nodes */
.network-node {
    position: absolute;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, rgba(254, 254, 31, 1) 0%, rgba(255, 67, 8, 0.8) 100%);
    border-radius: 50%;
    box-shadow:
        0 0 10px rgba(254, 254, 31, 0.8),
        0 0 20px rgba(255, 67, 8, 0.5);
    animation: nodePulse 2s ease-in-out infinite;
}

.network-node::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid rgba(255, 67, 8, 0.4);
    animation: nodePing 2s ease-out infinite;
}

/* Position nodes around sphere - strategic placement */
.network-node:nth-child(1) { top: 15%; left: 30%; animation-delay: 0s; }
.network-node:nth-child(2) { top: 25%; left: 65%; animation-delay: 0.3s; }
.network-node:nth-child(3) { top: 40%; left: 15%; animation-delay: 0.6s; }
.network-node:nth-child(4) { top: 45%; left: 80%; animation-delay: 0.9s; }
.network-node:nth-child(5) { top: 60%; left: 40%; animation-delay: 1.2s; }
.network-node:nth-child(6) { top: 70%; left: 70%; animation-delay: 1.5s; }
.network-node:nth-child(7) { top: 80%; left: 25%; animation-delay: 1.8s; }
.network-node:nth-child(8) { top: 35%; left: 48%; animation-delay: 2.1s; }

/* Connection lines between nodes */
.node-connection {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 67, 8, 0.6) 25%,
        rgba(254, 254, 31, 0.8) 50%,
        rgba(255, 67, 8, 0.6) 75%,
        transparent 100%);
    transform-origin: left center;
    opacity: 0.7;
    animation: dataFlow 3s linear infinite;
}

.node-connection::before {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(254, 254, 31, 1);
    border-radius: 50%;
    top: -2.5px;
    box-shadow: 0 0 10px rgba(254, 254, 31, 0.8);
    animation: dataPacket 3s linear infinite;
}

/* Position connections */
.node-connection:nth-child(1) {
    top: 20%; left: 32%; width: 120px;
    transform: rotate(25deg);
    animation-delay: 0s;
}
.node-connection:nth-child(2) {
    top: 30%; left: 38%; width: 90px;
    transform: rotate(-15deg);
    animation-delay: 0.5s;
}
.node-connection:nth-child(3) {
    top: 48%; left: 25%; width: 110px;
    transform: rotate(45deg);
    animation-delay: 1s;
}
.node-connection:nth-child(4) {
    top: 55%; left: 45%; width: 95px;
    transform: rotate(-30deg);
    animation-delay: 1.5s;
}
.node-connection:nth-child(5) {
    top: 72%; left: 35%; width: 100px;
    transform: rotate(18deg);
    animation-delay: 2s;
}

/* Holographic layers */
.holo-layer {
    position: absolute;
    border-radius: 50%;
    border: 1px solid;
    animation: layerRotate 8s linear infinite;
}

.holo-layer:nth-child(1) {
    inset: 5%;
    border-color: rgba(255, 67, 8, 0.3);
    animation-duration: 10s;
}

.holo-layer:nth-child(2) {
    inset: 15%;
    border-color: rgba(251, 133, 0, 0.25);
    animation-duration: 15s;
    animation-direction: reverse;
}

.holo-layer:nth-child(3) {
    inset: 25%;
    border-color: rgba(254, 254, 31, 0.2);
    animation-duration: 20s;
}

/* Floating geometric shapes */
.geo-shape {
    position: absolute;
    animation: geoFloat 8s ease-in-out infinite;
}

.geo-shape.triangle {
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 26px solid rgba(255, 67, 8, 0.4);
    top: -5%;
    left: 25%;
    animation-delay: 0s;
    filter: drop-shadow(0 0 10px rgba(255, 67, 8, 0.6));
}

.geo-shape.square {
    width: 20px;
    height: 20px;
    background: rgba(251, 133, 0, 0.3);
    border: 2px solid rgba(251, 133, 0, 0.6);
    top: 110%;
    right: 20%;
    animation-delay: 1s;
    transform: rotate(45deg);
    filter: drop-shadow(0 0 10px rgba(251, 133, 0, 0.5));
}

.geo-shape.hexagon {
    width: 24px;
    height: 14px;
    background: rgba(254, 254, 31, 0.3);
    position: relative;
    top: 50%;
    left: -10%;
    animation-delay: 2s;
    filter: drop-shadow(0 0 10px rgba(254, 254, 31, 0.5));
}

.geo-shape.hexagon::before {
    content: '';
    position: absolute;
    top: -7px;
    left: 0;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 7px solid rgba(254, 254, 31, 0.3);
}

.geo-shape.hexagon::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 0;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 7px solid rgba(254, 254, 31, 0.3);
}

.geo-shape.circle {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255, 67, 8, 0.5);
    background: rgba(255, 67, 8, 0.2);
    top: 30%;
    right: -8%;
    animation-delay: 3s;
    filter: drop-shadow(0 0 10px rgba(255, 67, 8, 0.4));
}

/* Ambient particles */
.ambient-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(254, 254, 31, 0.9);
    box-shadow: 0 0 8px rgba(254, 254, 31, 0.7);
    animation: particleDrift 6s ease-in-out infinite;
}

.ambient-particle:nth-child(1) { top: 10%; left: 15%; animation-delay: 0s; }
.ambient-particle:nth-child(2) { top: 25%; right: 10%; animation-delay: 1s; }
.ambient-particle:nth-child(3) { bottom: 20%; left: 20%; animation-delay: 2s; }
.ambient-particle:nth-child(4) { bottom: 15%; right: 25%; animation-delay: 3s; }
.ambient-particle:nth-child(5) { top: 50%; left: -5%; animation-delay: 4s; }
.ambient-particle:nth-child(6) { top: 60%; right: -5%; animation-delay: 5s; }

/* Energy rings */
.energy-ring {
    position: absolute;
    inset: -10%;
    border-radius: 50%;
    border: 2px solid rgba(255, 67, 8, 0.4);
    animation: energyPulse 4s ease-out infinite;
}

.energy-ring:nth-child(2) {
    animation-delay: 1.3s;
    border-color: rgba(251, 133, 0, 0.3);
}

.energy-ring:nth-child(3) {
    animation-delay: 2.6s;
    border-color: rgba(254, 254, 31, 0.25);
}

/* Data stream lines */
.data-stream {
    position: absolute;
    width: 2px;
    height: 60px;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(254, 254, 31, 0.8) 50%,
        transparent 100%);
    animation: streamFlow 2s linear infinite;
    opacity: 0;
}

.data-stream:nth-child(1) { top: -10%; left: 40%; animation-delay: 0s; }
.data-stream:nth-child(2) { top: -10%; left: 60%; animation-delay: 0.5s; }
.data-stream:nth-child(3) { bottom: -10%; left: 35%; animation-delay: 1s; transform: rotate(180deg); }
.data-stream:nth-child(4) { bottom: -10%; right: 35%; animation-delay: 1.5s; transform: rotate(180deg); }

/* Glitch effect overlay */
.glitch-layer {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 67, 8, 0.1) 50%,
        transparent 100%);
    animation: glitchSweep 8s ease-in-out infinite;
    opacity: 0;
    mix-blend-mode: screen;
}

/* ANIMATIONS */
/* Option 4: Slow Wobble - ACTIVE ✓ */
@keyframes neuralRotate {
    0% {
        transform: rotateY(0deg) rotateX(0deg) scale(1);
    }
    33% {
        transform: rotateY(120deg) rotateX(10deg) scale(1.02);
    }
    66% {
        transform: rotateY(240deg) rotateX(-10deg) scale(0.98);
    }
    100% {
        transform: rotateY(360deg) rotateX(0deg) scale(1);
    }
}

/* Option 1: Smooth Multi-Axis Float (Uncomment to use)
@keyframes neuralRotate {
    0% {
        transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
    }
    25% {
        transform: rotateX(5deg) rotateY(90deg) rotateZ(2deg);
    }
    50% {
        transform: rotateX(10deg) rotateY(180deg) rotateZ(0deg);
    }
    75% {
        transform: rotateX(5deg) rotateY(270deg) rotateZ(-2deg);
    }
    100% {
        transform: rotateX(0deg) rotateY(360deg) rotateZ(0deg);
    }
}
*/

/* Option 2: Pendulum Swing (Uncomment to use)
@keyframes neuralRotate {
    0%, 100% {
        transform: rotateY(-15deg) rotateX(5deg);
    }
    50% {
        transform: rotateY(15deg) rotateX(-5deg);
    }
}
*/

/* Option 3: Diagonal Spin (Uncomment to use)
@keyframes neuralRotate {
    0% {
        transform: rotate3d(1, 1, 0, 0deg);
    }
    100% {
        transform: rotate3d(1, 1, 0, 360deg);
    }
}
*/

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

@keyframes nodePing {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2.5); opacity: 0; }
}

@keyframes dataFlow {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

@keyframes dataPacket {
    0% { left: 0%; }
    100% { left: 100%; }
}

@keyframes layerRotate {
    0% { transform: rotateZ(0deg); }
    100% { transform: rotateZ(360deg); }
}

@keyframes geoFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.6; }
    50% { transform: translateY(-30px) rotate(180deg); opacity: 1; }
}

@keyframes particleDrift {
    0%, 100% { transform: translate(0, 0); opacity: 0; }
    25% { opacity: 1; }
    50% { transform: translate(20px, -40px); opacity: 0.8; }
    75% { opacity: 1; }
}

@keyframes energyPulse {
    0% { transform: scale(1); opacity: 0; }
    50% { opacity: 0.6; }
    100% { transform: scale(1.5); opacity: 0; }
}

@keyframes streamFlow {
    0% { opacity: 0; transform: translateY(0); }
    50% { opacity: 1; }
    100% { opacity: 0; transform: translateY(100px); }
}

@keyframes gridScan {
    0% { transform: translateY(0); }
    100% { transform: translateY(15px); }
}

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

@keyframes glitchSweep {
    0%, 90%, 100% { opacity: 0; transform: translateX(-100%); }
    92% { opacity: 0.8; }
    95% { opacity: 0; transform: translateX(100%); }
}

/* Hover effects */
.hero-sphere-container:hover .hero-3d-sphere {
    animation-play-state: paused;
}

.hero-sphere-container:hover .sphere-core {
    box-shadow:
        inset -30px -30px 60px rgba(0, 0, 0, 0.7),
        inset 30px 30px 60px rgba(255, 67, 8, 0.2),
        0 0 100px rgba(255, 67, 8, 0.6),
        0 0 200px rgba(251, 133, 0, 0.4);
    transform: scale(1.05);
    transition: all 0.6s ease;
}

.hero-sphere-container:hover .network-node {
    animation-play-state: paused;
    transform: scale(1.3);
}

.hero-sphere-container:hover .geo-shape {
    animation-play-state: paused;
}

/* Responsive */
@media (max-width: 991px) {
    .hero-sphere-container {
        width: 240px;
        height: 240px;
        margin: 0 auto;
    }

    .network-node {
        width: 6px;
        height: 6px;
    }

    .node-connection {
        height: 0.8px;
    }

    .geo-shape {
        transform: scale(0.8);
    }
}

@media (max-width: 767px) {
    .hero-sphere-container {
        width: 200px;
        height: 200px;
    }

    .network-node {
        width: 5px;
        height: 5px;
    }

    .node-connection {
        height: 0.6px;
    }

    .geo-shape {
        transform: scale(0.6);
    }
}
