/* Grid 3D Background */
.grid-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    perspective: 1000px;
    overflow: hidden;
}

.grid-background::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    transform: translate(-50%, -50%) rotateX(60deg);
    background-image:
        linear-gradient(to right, rgba(0, 212, 255, 0.1) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 212, 255, 0.1) 1px, transparent 1px);
    background-size: 80px 80px;
    animation: gridMove 20s linear infinite;
}

.grid-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.8) 70%, rgba(0, 0, 0, 1) 100%);
}

@keyframes gridMove {
    0% {
        transform: translate(-50%, -50%) rotateX(60deg) translateY(0);
    }
    100% {
        transform: translate(-50%, -50%) rotateX(60deg) translateY(80px);
    }
}

/* Gradient Orbs */
.gradient-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: orbFloat 20s ease-in-out infinite;
    mix-blend-mode: screen;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--primary-color) 0%, transparent 70%);
    top: -10%;
    left: -10%;
    animation-duration: 25s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #0096ff 0%, transparent 70%);
    top: 20%;
    right: -5%;
    animation-duration: 30s;
    animation-delay: -5s;
}

.orb-3 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, #0080ff 0%, transparent 70%);
    bottom: -15%;
    left: 30%;
    animation-duration: 28s;
    animation-delay: -10s;
}

.orb-4 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #00b4ff 0%, transparent 70%);
    top: 50%;
    left: 50%;
    animation-duration: 22s;
    animation-delay: -15s;
}

.orb-5 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--secondary-color) 0%, transparent 70%);
    bottom: 10%;
    right: 10%;
    animation-duration: 35s;
    animation-delay: -20s;
}

.orb-6 {
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, #0088ff 0%, transparent 70%);
    top: 40%;
    left: 15%;
    animation-duration: 27s;
    animation-delay: -8s;
}

.orb-7 {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, #00a8ff 0%, transparent 70%);
    bottom: 30%;
    right: 25%;
    animation-duration: 32s;
    animation-delay: -12s;
}

.orb-8 {
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, #0070ff 0%, transparent 70%);
    top: 15%;
    left: 60%;
    animation-duration: 29s;
    animation-delay: -18s;
}

@keyframes orbFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(100px, -100px) scale(1.1);
    }
    50% {
        transform: translate(-50px, 100px) scale(0.9);
    }
    75% {
        transform: translate(150px, 50px) scale(1.05);
    }
}

/* Light Beams */
.light-beam {
    position: fixed;
    width: 2px;
    height: 100%;
    top: 0;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        var(--primary-color) 50%,
        transparent 100%
    );
    opacity: 0.3;
    filter: blur(2px);
    animation: beamPulse 4s ease-in-out infinite;
    z-index: 2;
    pointer-events: none;
}

.light-beam-1 {
    left: 20%;
    animation-delay: 0s;
}

.light-beam-2 {
    left: 50%;
    animation-delay: 1.3s;
}

.light-beam-3 {
    left: 80%;
    animation-delay: 2.6s;
}

@keyframes beamPulse {
    0%, 100% {
        opacity: 0.2;
        transform: scaleX(1);
    }
    50% {
        opacity: 0.5;
        transform: scaleX(1.5);
    }
}

/* Custom Cursor */
.cursor,
.cursor-follower {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 30000;
    mix-blend-mode: screen;
}

.cursor {
    width: 12px;
    height: 12px;
    background: radial-gradient(circle, var(--primary-color) 0%, var(--accent-3) 100%);
    transform: translate(-50%, -50%);
    box-shadow:
        0 0 10px var(--primary-color),
        0 0 20px var(--primary-color),
        0 0 30px var(--accent-3);
    animation: cursorPulse 2s ease-in-out infinite;
}

@keyframes cursorPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
    }
}

.cursor-follower {
    width: 40px;
    height: 40px;
    border: 2px solid var(--primary-color);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, border-color 0.3s;
    box-shadow:
        0 0 20px rgba(0, 212, 255, 0.5),
        inset 0 0 20px rgba(0, 212, 255, 0.2);
    background: radial-gradient(circle, transparent 60%, rgba(0, 212, 255, 0.1) 100%);
}

/* Connection Status */
.connection-status {
    position: fixed;
    top: 30px;
    right: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0;
    background: transparent;
    border: none;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.connection-status.visible {
    opacity: 1;
    pointer-events: all;
}

.status-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    letter-spacing: 0.5px;
    color: var(--text-color);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff3333;
    box-shadow:
        0 0 10px #ff3333,
        0 0 20px rgba(255, 51, 51, 0.5),
        inset 0 0 5px rgba(255, 255, 255, 0.3);
    animation: pulseDisconnected 2s infinite;
}

.status-dot.connected {
    background: var(--primary-color);
    box-shadow:
        0 0 15px var(--primary-color),
        0 0 30px rgba(0, 212, 255, 0.5),
        inset 0 0 8px rgba(255, 255, 255, 0.5);
    animation: pulseConnected 2s infinite;
}

@keyframes pulseDisconnected {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(0.9);
    }
}

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