/* =============================================
   CYBERCODE ACADEMY - CYBER EFFECTS
   ============================================= */

/* Matrix Canvas */
#matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.15;
}

/* Glitch Effect */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--accent-danger);
    animation: glitch-1 2s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: 2px 0 var(--accent-primary);
    animation: glitch-2 3s infinite linear alternate-reverse;
}

@keyframes glitch-1 {
    0%, 100% { clip: rect(0, 900px, 0, 0); }
    20% { clip: rect(80px, 900px, 120px, 0); }
    40% { clip: rect(40px, 900px, 60px, 0); }
    60% { clip: rect(100px, 900px, 140px, 0); }
    80% { clip: rect(20px, 900px, 80px, 0); }
}

@keyframes glitch-2 {
    0%, 100% { clip: rect(0, 900px, 0, 0); }
    20% { clip: rect(20px, 900px, 40px, 0); }
    40% { clip: rect(60px, 900px, 100px, 0); }
    60% { clip: rect(120px, 900px, 160px, 0); }
    80% { clip: rect(140px, 900px, 180px, 0); }
}

/* Scanline Effect */
.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 50%,
        rgba(0, 0, 0, 0.03) 50%
    );
    background-size: 100% 4px;
    z-index: 9999;
    pointer-events: none;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% { background-position: 0 0; }
    100% { background-position: 0 100px; }
}

/* Neon Text */
.neon-text {
    text-shadow:
        0 0 7px var(--accent-primary),
        0 0 10px var(--accent-primary),
        0 0 21px var(--accent-primary),
        0 0 42px var(--accent-primary),
        0 0 82px var(--accent-primary),
        0 0 92px var(--accent-primary);
}

.neon-text-green {
    text-shadow:
        0 0 7px var(--accent-secondary),
        0 0 10px var(--accent-secondary),
        0 0 21px var(--accent-secondary),
        0 0 42px var(--accent-secondary);
}

/* Gradient Border */
.gradient-border {
    position: relative;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.gradient-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gradient-primary);
    border-radius: inherit;
    z-index: -1;
}

/* Floating Data Streams */
.floating-data {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.data-stream {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-primary);
    opacity: 0.3;
    white-space: nowrap;
    animation: float-up 20s linear infinite;
}

#data-stream-1 {
    left: 10%;
    animation-duration: 25s;
}

#data-stream-2 {
    left: 50%;
    animation-duration: 18s;
    animation-delay: 5s;
}

#data-stream-3 {
    left: 80%;
    animation-duration: 22s;
    animation-delay: 10s;
}

@keyframes float-up {
    0% {
        transform: translateY(100vh);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-100%);
        opacity: 0;
    }
}

/* Hologram Effect */
.hologram {
    position: relative;
}

.hologram::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        125deg,
        rgba(88, 166, 255, 0.1) 0%,
        transparent 40%,
        transparent 60%,
        rgba(63, 185, 80, 0.1) 100%
    );
    pointer-events: none;
}

/* Particle Background */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: particle-float 15s infinite;
    opacity: 0;
}

@keyframes particle-float {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) scale(1);
        opacity: 0;
    }
}

/* Cyber Divider */
.cyber-divider {
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--accent-primary),
        transparent
    );
    margin: 40px 0;
    position: relative;
}

.cyber-divider::before {
    content: '?';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--accent-primary);
    font-size: 12px;
    background: var(--bg-primary);
    padding: 0 10px;
}

/* Loading Spinner */
.cyber-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Hexagon Grid Background */
.hex-bg {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 5L55 20v30L30 55 5 50V20L30 5z' fill='none' stroke='%2330363d' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 30px 30px;
}

/* Data Rain */
.data-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.rain-column {
    position: absolute;
    top: -100%;
    width: 1px;
    background: linear-gradient(
        to bottom,
        transparent,
        var(--accent-primary)
    );
    animation: rain-fall linear infinite;
}

@keyframes rain-fall {
    0% {
        top: -100%;
    }
    100% {
        top: 100%;
    }
}

/* Card Shine Effect */
.card-shine {
    position: relative;
    overflow: hidden;
}

.card-shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.05),
        transparent
    );
    transform: skewX(-25deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    20% { left: 200%; }
    100% { left: 200%; }
}

/* Pulse Ring */
.pulse-ring {
    position: relative;
}

.pulse-ring::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% {
        width: 100%;
        height: 100%;
        opacity: 1;
    }
    100% {
        width: 200%;
        height: 200%;
        opacity: 0;
    }
}