﻿/* AI Robot with Magnifying Glass Animation */
.ai-search-scene {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Scene Background */
.scene-background {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, #003366, #001a33);
    overflow: hidden;
}

.data-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(to right, rgba(0, 204, 255, 0.1) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 204, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    animation: moveGrid 20s linear infinite;
}

.data-point {
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: #00CCFF;
    border-radius: 50%;
    left: var(--x);
    top: var(--y);
    opacity: 0;
    box-shadow: 0 0 5px rgba(0, 204, 255, 0.8);
    animation: dataPointPulse 3s infinite;
    animation-delay: var(--delay);
}

.stock-chart {
    position: absolute;
    bottom: 20px;
    left: 10%;
    width: 80%;
    height: 40px;
    overflow: hidden;
}

.stock-chart::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #0066FF, transparent);
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 20'%3E%3Cpath d='M0,10 L10,15 L20,5 L30,12 L40,8 L50,15 L60,10 L70,5 L80,12 L90,8 L100,10' stroke='white' fill='none' stroke-width='1'/%3E%3C/svg%3E");
    mask-size: 100% 100%;
    mask-repeat: no-repeat;
    opacity: 0.5;
    animation: chartPulse 3s infinite alternate;
}

/* AI Robot */
.ai-robot {
    position: absolute;
    width: 80px;
    height: 100px;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.robot-head {
    position: relative;
    width: 40px;
    height: 40px;
    background: #0066FF;
    border-radius: 10px;
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 0 10px rgba(0, 102, 255, 0.5);
}

.robot-eye {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    position: relative;
    margin-top: 10px;
}

.robot-eye::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: #0066FF;
    border-radius: 50%;
    top: 2px;
    left: 2px;
}

.robot-eye.left {
    margin-left: 6px;
    animation: blinkEye 3s infinite;
}

.robot-eye.right {
    margin-right: 6px;
    animation: blinkEye 3s infinite 0.2s;
}

.robot-antenna {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 12px;
    background: #003399;
}

.robot-antenna::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: #00CCFF;
    border-radius: 50%;
    animation: pulseLED 2s infinite;
}

.robot-body {
    position: relative;
    width: 50px;
    height: 60px;
    background: #003399;
    border-radius: 8px;
    margin: 0 auto;
    margin-top: -5px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.robot-arm {
    position: absolute;
    top: 15px;
    right: -30px;
    width: 40px;
    height: 8px;
    background: #0066FF;
    border-radius: 4px;
    transform-origin: left center;
    animation: moveArm 4s infinite;
}

/* Magnifying Glass */
.magnifying-glass {
    position: absolute;
    top: -10px;
    right: -15px;
    transform-origin: bottom right;
    animation: tiltGlass 4s infinite;
}

.glass-handle {
    position: absolute;
    width: 6px;
    height: 20px;
    background: #003399;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
}

.glass-lens {
    position: absolute;
    width: 25px;
    height: 25px;
    border: 3px solid #003399;
    border-radius: 50%;
    background: rgba(0, 204, 255, 0.1);
    bottom: 15px;
    left: 0;
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(0, 204, 255, 0.5);
}

/* Search Beam */
.search-beam {
    position: absolute;
    width: 40px;
    height: 60px;
    background: radial-gradient(ellipse at top, rgba(0, 204, 255, 0.3), transparent 70%);
    top: 60px;
    right: 25%;
    transform-origin: top center;
    animation: moveBeam 4s infinite;
    z-index: 5;
    opacity: 0.7;
}

/* Search Results */
.search-result {
    position: absolute;
    bottom: 70px;
    right: 20%;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    z-index: 5;
}

.result-item {
    font-family: monospace;
    font-size: 12px;
    color: #00CCFF;
    background: rgba(0, 51, 102, 0.7);
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 4px;
    opacity: 0;
    transform: translateX(10px);
    animation: showResult 4s infinite;
    animation-delay: var(--delay);
}

/* Loading Animation */
.stock-chart-loader {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, 
        rgba(0, 102, 255, 0.3) 0%, 
        rgba(0, 102, 255, 0.6) 50%, 
        rgba(0, 102, 255, 0.9) 100%);
    top: 50%;
    transform: translateY(-50%);
}

.chart-point {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #0066FF;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    animation: chartPointMove 2s infinite ease-in-out;
    box-shadow: 0 0 10px rgba(0, 102, 255, 0.7);
}

.loading-text {
    display: inline-block;
    animation: float 1.5s infinite ease-in-out alternate;
    animation-delay: calc(var(--i, 0) * 0.1s);
}

.loading-text:nth-child(1) { --i: 1; }
.loading-text:nth-child(2) { --i: 2; }
.loading-text:nth-child(3) { --i: 3; }
.loading-text:nth-child(4) { --i: 4; }
.loading-text:nth-child(5) { --i: 5; }
.loading-text:nth-child(6) { --i: 6; }
.loading-text:nth-child(7) { --i: 7; }
.loading-text:nth-child(8) { --i: 8; }
.loading-text:nth-child(9) { --i: 9; }
.loading-text:nth-child(10) { --i: 10; }
.loading-text:nth-child(11) { --i: 11; }

/* AI Analysis Animation */
.ai-analysis-animation {
    position: relative;
    width: 200px;
    height: 200px;
}

.analysis-circle {
    position: absolute;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 1px solid rgba(0, 102, 255, 0.3);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulseCircle 2s infinite alternate;
}

.analysis-circle::before,
.analysis-circle::after {
    content: '';
    position: absolute;
    border-radius: 50%;
}

.analysis-circle::before {
    width: 120px;
    height: 120px;
    border: 1px solid rgba(0, 102, 255, 0.3);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulseCircle 2s infinite alternate 0.3s;
}

.analysis-circle::after {
    width: 90px;
    height: 90px;
    border: 1px solid rgba(0, 102, 255, 0.3);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulseCircle 2s infinite alternate 0.6s;
}

.analysis-grid {
    position: absolute;
    width: 180px;
    height: 180px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-image: 
        linear-gradient(to right, rgba(0, 102, 255, 0.1) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 102, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    border-radius: 50%;
    mask-image: radial-gradient(circle, black 70%, transparent 75%);
    animation: rotateGrid 10s linear infinite;
}

.analysis-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #0066FF;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    box-shadow: 0 0 10px rgba(0, 102, 255, 0.7);
    animation: moveDot 4s infinite;
}

.analysis-scan {
    position: absolute;
    width: 150px;
    height: 75px;
    border-top: 2px solid rgba(0, 102, 255, 0.5);
    border-radius: 150px 150px 0 0;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(0deg);
    transform-origin: center bottom;
    animation: scanRotate 2s linear infinite;
}

/* Animations */
@keyframes moveGrid {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 20px 20px;
    }
}

@keyframes dataPointPulse {
    0%, 100% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes chartPulse {
    0% {
        opacity: 0.3;
    }
    100% {
        opacity: 0.8;
    }
}

@keyframes blinkEye {
    0%, 45%, 55%, 100% {
        transform: scaleY(1);
    }
    50% {
        transform: scaleY(0.1);
    }
}

@keyframes pulseLED {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 8px #00CCFF;
    }
    50% {
        opacity: 0.6;
        box-shadow: 0 0 12px #00CCFF;
    }
}

@keyframes moveArm {
    0%, 100% {
        transform: rotate(-10deg);
    }
    50% {
        transform: rotate(10deg);
    }
}

@keyframes tiltGlass {
    0%, 100% {
        transform: rotate(-5deg);
    }
    50% {
        transform: rotate(5deg);
    }
}

@keyframes moveBeam {
    0%, 100% {
        transform: rotate(-10deg) scaleY(0.8);
        opacity: 0.5;
    }
    50% {
        transform: rotate(10deg) scaleY(1);
        opacity: 0.7;
    }
}

@keyframes showResult {
    0%, 10%, 90%, 100% {
        opacity: 0;
        transform: translateX(10px);
    }
    20%, 80% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes chartPointMove {
    0% {
        left: 0;
    }
    50% {
        left: 100%;
    }
    100% {
        left: 0;
    }
}

@keyframes float {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-5px);
    }
}

@keyframes pulseCircle {
    0% {
        opacity: 0.3;
    }
    100% {
        opacity: 1;
    }
}

@keyframes rotateGrid {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes moveDot {
    0% {
        transform: translate(-50%, -50%) rotate(0deg) translateX(40px);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg) translateX(40px);
    }
}

@keyframes scanRotate {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}