/* AI Processing Animation - Cyberpunk Theme */

.ai-processing-container {
    position: relative;
    padding: 20px;
    margin: 10px 0;
    background: rgba(7, 11, 20, 0.8);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.ai-processing-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(0, 255, 255, 0.1),
        rgba(0, 255, 255, 0.2),
        rgba(0, 255, 255, 0.1),
        transparent
    );
    animation: scanline-sweep 2s linear infinite;
}

@keyframes scanline-sweep {
    to {
        left: 100%;
    }
}

/* Neural Network Processing Animation */
.neural-process {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    position: relative;
}

/* Circuit Board Pattern */
.circuit-board {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    background-image:
        linear-gradient(
            0deg,
            transparent 24%,
            rgba(0, 255, 255, 0.05) 25%,
            rgba(0, 255, 255, 0.05) 26%,
            transparent 27%,
            transparent 74%,
            rgba(0, 255, 255, 0.05) 75%,
            rgba(0, 255, 255, 0.05) 76%,
            transparent 77%,
            transparent
        ),
        linear-gradient(
            90deg,
            transparent 24%,
            rgba(0, 255, 255, 0.05) 25%,
            rgba(0, 255, 255, 0.05) 26%,
            transparent 27%,
            transparent 74%,
            rgba(0, 255, 255, 0.05) 75%,
            rgba(0, 255, 255, 0.05) 76%,
            transparent 77%,
            transparent
        );
    background-size: 50px 50px;
    animation: circuit-pulse 4s ease-in-out infinite;
}

@keyframes circuit-pulse {
    0%,
    100% {
        opacity: 0.1;
    }

    50% {
        opacity: 0.3;
    }
}

/* Data Stream */
.data-stream {
    position: absolute;
    width: 300px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.data-node {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 255, 255, 0.6);
    background: rgba(7, 11, 20, 0.9);
    position: relative;
    transform: rotate(45deg);
}

.data-node::before {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: rgba(0, 255, 255, 0.8);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    animation: node-pulse 2s ease-in-out infinite;
}

.data-node:nth-child(1)::before {
    animation-delay: 0s;
}

.data-node:nth-child(2)::before {
    animation-delay: 0.2s;
}

.data-node:nth-child(3)::before {
    animation-delay: 0.4s;
}

.data-node:nth-child(4)::before {
    animation-delay: 0.6s;
}

.data-node:nth-child(5)::before {
    animation-delay: 0.8s;
}

@keyframes node-pulse {
    0%,
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Connection Lines */
.data-connections {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.connection-line {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.6), transparent);
    width: 60px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    animation: connection-flow 2s ease-in-out infinite;
}

.connection-line:nth-child(1) {
    left: 15px;
    animation-delay: 0.1s;
}

.connection-line:nth-child(2) {
    left: 75px;
    animation-delay: 0.3s;
}

.connection-line:nth-child(3) {
    left: 135px;
    animation-delay: 0.5s;
}

.connection-line:nth-child(4) {
    left: 195px;
    animation-delay: 0.7s;
}

@keyframes connection-flow {
    0%,
    100% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }
}

/* Processing Text */
.ai-status-text {
    position: absolute;
    bottom: 15px;
    left: 0;
    right: 0;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: rgba(0, 255, 255, 0.8);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.ai-status-text::after {
    content: '';
    animation: ellipsis 1.5s steps(4) infinite;
}

@keyframes ellipsis {
    0% {
        content: '';
    }

    25% {
        content: '.';
    }

    50% {
        content: '..';
    }

    75% {
        content: '...';
    }

    100% {
        content: '';
    }
}

/* Glitch Effect */
.ai-processing-container.glitch::after {
    content: 'PROCESSING';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    color: rgba(0, 255, 255, 0.8);
    animation: glitch-text 2s infinite;
}

@keyframes glitch-text {
    0%,
    100% {
        text-shadow:
            0.02em 0 rgba(255, 0, 255, 0.5),
            -0.02em -0 rgba(0, 255, 255, 0.5),
            0.025em 0.02em rgba(255, 255, 0, 0.5);
    }

    25% {
        text-shadow:
            0.02em 0 rgba(0, 255, 255, 0.5),
            -0.03em -0 rgba(255, 0, 255, 0.5),
            0 0.02em rgba(255, 255, 0, 0.5);
    }

    50% {
        text-shadow:
            -0.02em 0 rgba(255, 255, 0, 0.5),
            0.02em -0 rgba(0, 255, 255, 0.5),
            -0.025em 0.015em rgba(255, 0, 255, 0.5);
    }

    75% {
        text-shadow:
            0.015em 0 rgba(255, 0, 255, 0.5),
            -0.015em -0 rgba(255, 255, 0, 0.5),
            0 0.02em rgba(0, 255, 255, 0.5);
    }
}

/* Matrix Rain Effect for Processing */
.matrix-process {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    opacity: 0.3;
}

.matrix-column {
    position: absolute;
    top: -100%;
    font-family: monospace;
    font-size: 10px;
    line-height: 10px;
    color: rgba(0, 255, 255, 0.8);
    animation: matrix-fall linear infinite;
    white-space: pre;
}

@keyframes matrix-fall {
    to {
        top: 100%;
    }
}

/* Thinking Indicator - Animated Hexagons */
.thinking-hexagons {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60px;
    margin: 20px 0;
}

.hex {
    width: 30px;
    height: 30px;
    margin: 0 5px;
    position: relative;
    opacity: 0.3;
    animation: hex-pulse 2s ease-in-out infinite;
}

.hex:nth-child(1) {
    animation-delay: 0s;
}

.hex:nth-child(2) {
    animation-delay: 0.2s;
}

.hex:nth-child(3) {
    animation-delay: 0.4s;
}

.hex::before,
.hex::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 255, 255, 0.8);
    clip-path: polygon(30% 0%, 70% 0%, 100% 50%, 70% 100%, 30% 100%, 0% 50%);
}

.hex::after {
    transform: scale(0.8);
    background: rgba(7, 11, 20, 0.9);
}

@keyframes hex-pulse {
    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* Processing Bar */
.process-bar {
    width: 100%;
    height: 4px;
    background: rgba(0, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    margin-top: 10px;
}

.process-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.8), transparent);
    animation: process-scan 1.5s linear infinite;
}

@keyframes process-scan {
    to {
        left: 100%;
    }
}
