/* ===== FIGMA INTEGRATION EFFECTS ===== */

/* Circuit Pattern Background */
.figma-circuit-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -2;
    background-image: 
        linear-gradient(to right, rgba(0, 255, 0, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 255, 0, 0.05) 1px, transparent 1px),
        radial-gradient(circle at 50px 50px, rgba(0, 255, 0, 0.1) 2px, transparent 2px),
        radial-gradient(circle at 150px 150px, rgba(0, 255, 0, 0.1) 2px, transparent 2px),
        radial-gradient(circle at 250px 250px, rgba(0, 255, 0, 0.1) 2px, transparent 2px);
    background-size: 
        50px 50px,
        50px 50px,
        200px 200px,
        200px 200px,
        200px 200px;
}

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

/* Corner Decorations */
.figma-corner {
    position: fixed;
    width: 100px;
    height: 100px;
    pointer-events: none;
    z-index: 1;
}

.figma-corner.top-left {
    top: 0;
    left: 0;
    border-top: 2px solid var(--primary-color);
    border-left: 2px solid var(--primary-color);
}

.figma-corner.top-right {
    top: 0;
    right: 0;
    border-top: 2px solid var(--primary-color);
    border-right: 2px solid var(--primary-color);
}

.figma-corner.bottom-left {
    bottom: 0;
    left: 0;
    border-bottom: 2px solid var(--primary-color);
    border-left: 2px solid var(--primary-color);
}

.figma-corner.bottom-right {
    bottom: 0;
    right: 0;
    border-bottom: 2px solid var(--primary-color);
    border-right: 2px solid var(--primary-color);
}

/* Custom Cursor */
.figma-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transition: width 0.2s, height 0.2s;
}

/* Hide default cursor when custom cursor is active */
body:hover {
    cursor: none;
}

/* Custom Scrollbar */
.figma-scrollbar {
    position: fixed;
    top: 0;
    right: 0;
    width: 5px;
    height: 0;
    background-color: var(--primary-color);
    z-index: 9998;
}

/* Glitch Effect */
.figma-glitch-effect {
    position: relative;
    overflow: hidden;
}

.figma-glitch-effect .glitch-layer {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.figma-glitch-effect .glitch-layer.before {
    left: -2px;
    text-shadow: -2px 0 var(--glitch-color-1);
    animation: glitch-anim-1 5s infinite linear alternate-reverse;
    clip: rect(44px, 450px, 56px, 0);
    opacity: 0.7;
}

.figma-glitch-effect .glitch-layer.after {
    left: 2px;
    text-shadow: 2px 0 var(--glitch-color-2);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
    clip: rect(24px, 450px, 36px, 0);
    opacity: 0.7;
}

@keyframes glitch-anim-1 {
    0% {
        clip: rect(15px, 9999px, 64px, 0);
    }
    20% {
        clip: rect(36px, 9999px, 77px, 0);
    }
    40% {
        clip: rect(5px, 9999px, 94px, 0);
    }
    60% {
        clip: rect(82px, 9999px, 23px, 0);
    }
    80% {
        clip: rect(52px, 9999px, 35px, 0);
    }
    100% {
        clip: rect(79px, 9999px, 73px, 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip: rect(65px, 9999px, 32px, 0);
    }
    20% {
        clip: rect(13px, 9999px, 95px, 0);
    }
    40% {
        clip: rect(85px, 9999px, 3px, 0);
    }
    60% {
        clip: rect(32px, 9999px, 25px, 0);
    }
    80% {
        clip: rect(75px, 9999px, 17px, 0);
    }
    100% {
        clip: rect(37px, 9999px, 49px, 0);
    }
}

/* Matrix Effect */
.figma-matrix-effect {
    position: relative;
    overflow: hidden;
}

.figma-matrix-effect .matrix-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.2;
}

/* Hologram Effect */
.figma-hologram-effect {
    position: relative;
    overflow: hidden;
    animation: hologram-flicker 5s infinite;
}

.figma-hologram-effect .hologram-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(0, 255, 255, 0.5), transparent);
    z-index: 1;
    opacity: 0.3;
}

@keyframes hologram-flicker {
    0%, 100% {
        opacity: 1;
    }
    33% {
        opacity: 0.9;
    }
    66% {
        opacity: 0.95;
    }
    77% {
        opacity: 0.85;
    }
}

/* Scanline Effect */
.figma-scanline-effect {
    position: relative;
    overflow: hidden;
}

.figma-scanline-effect .scanline-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(0, 255, 0, 0.2), transparent);
    animation: scanline-move 3s linear infinite;
    z-index: 1;
    pointer-events: none;
}

@keyframes scanline-move {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100%);
    }
}

/* Neon Effect */
.figma-neon-effect {
    position: relative;
    overflow: visible;
}

.figma-neon-effect .neon-glow-1,
.figma-neon-effect .neon-glow-2 {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    pointer-events: none;
}

.figma-neon-effect .neon-glow-1 {
    box-shadow: 0 0 10px var(--primary-color), 0 0 20px var(--primary-color);
    animation: neon-pulse-1 2s infinite alternate;
    z-index: -1;
}

.figma-neon-effect .neon-glow-2 {
    box-shadow: 0 0 30px var(--primary-color), 0 0 40px var(--primary-color);
    animation: neon-pulse-2 3s infinite alternate;
    z-index: -2;
}

@keyframes neon-pulse-1 {
    0% {
        opacity: 0.5;
    }
    100% {
        opacity: 0.8;
    }
}

@keyframes neon-pulse-2 {
    0% {
        opacity: 0.3;
    }
    100% {
        opacity: 0.6;
    }
}

/* Hover Effect */
.figma-hover {
    transform: translateY(-5px);
    transition: transform 0.3s ease;
}

.figma-hover .hover-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    box-shadow: 0 0 20px var(--primary-color);
    animation: hover-pulse 1.5s infinite alternate;
    z-index: -1;
    pointer-events: none;
}

@keyframes hover-pulse {
    0% {
        opacity: 0.3;
        transform: scale(1);
    }
    100% {
        opacity: 0.6;
        transform: scale(1.05);
    }
}

/* Click Ripple Effect */
.click-ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(0, 255, 0, 0.3);
    transform: scale(0);
    animation: ripple-effect 1s linear;
    pointer-events: none;
}

@keyframes ripple-effect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Terminal Typing Effect */
.terminal-typing::after {
    content: '|';
    animation: terminal-cursor 1s infinite;
}

@keyframes terminal-cursor {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

/* Data Stream Effect */
.data-stream {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.05;
}

.data-stream::before {
    content: '01010111 00101010 11001010 10101010 00101010 11110000 10101010';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-family: 'Hack', monospace;
    font-size: 10px;
    color: var(--primary-color);
    white-space: nowrap;
    animation: data-flow 20s linear infinite;
}

@keyframes data-flow {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100%);
    }
}

/* Radar Scan Effect */
.radar-scan {
    position: relative;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 1px solid var(--primary-color);
    overflow: hidden;
}

.radar-scan::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 50%;
    background: linear-gradient(to right, transparent, rgba(0, 255, 0, 0.5));
    transform-origin: bottom right;
    animation: radar-rotate 4s linear infinite;
}

@keyframes radar-rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Code Block Highlighting */
.code-block {
    position: relative;
    background-color: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--primary-color);
    border-radius: 5px;
    padding: 1rem;
    font-family: 'Hack', monospace;
    color: var(--text-color);
    overflow-x: auto;
}

.code-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(0, 255, 0, 0.1), transparent);
    animation: code-highlight 2s linear infinite;
    pointer-events: none;
}

@keyframes code-highlight {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Digital Distortion Effect */
.digital-distortion {
    position: relative;
    overflow: hidden;
}

.digital-distortion::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 255, 0, 0.2);
    mix-blend-mode: overlay;
    animation: digital-distort 0.5s steps(2) infinite;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
}

.digital-distortion:hover::before {
    opacity: 1;
}

@keyframes digital-distort {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    50% {
        transform: translateX(5px);
    }
    75% {
        transform: translateX(-2px);
    }
}

/* Binary Rain Effect */
.binary-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    color: var(--primary-color);
    font-family: 'Hack', monospace;
    font-size: 12px;
    overflow: hidden;
}

.binary-rain span {
    position: absolute;
    top: -100px;
    animation: binary-fall linear infinite;
}

@keyframes binary-fall {
    to {
        transform: translateY(calc(100vh + 100px));
    }
}

/* Responsive adjustments for Figma effects */
@media (max-width: 768px) {
    .figma-cursor {
        display: none; /* Hide custom cursor on mobile */
    }
    
    body:hover {
        cursor: auto; /* Restore default cursor on mobile */
    }
    
    .figma-corner {
        width: 50px;
        height: 50px;
    }
}