/* 高级动画效果和数据大屏特效 */

/* 脉冲效果 */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* 霓虹发光效果 */
.neon-glow {
    text-shadow: 
        0 0 5px var(--primary-color),
        0 0 10px var(--primary-color),
        0 0 20px var(--primary-color),
        0 0 40px var(--primary-color);
    animation: neonFlicker 3s ease-in-out infinite alternate;
}

@keyframes neonFlicker {
    0%, 100% {
        text-shadow: 
            0 0 5px var(--primary-color),
            0 0 10px var(--primary-color),
            0 0 20px var(--primary-color),
            0 0 40px var(--primary-color);
    }
    50% {
        text-shadow: 
            0 0 2px var(--primary-color),
            0 0 5px var(--primary-color),
            0 0 8px var(--primary-color),
            0 0 12px var(--primary-color);
    }
}

/* 数据流动效果 */
.data-stream {
    position: relative;
    overflow: hidden;
}

.data-stream::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    animation: dataFlow 2s linear infinite;
}

@keyframes dataFlow {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 全息投影效果 */
.hologram {
    position: relative;
    background: linear-gradient(
        135deg,
        rgba(0, 212, 255, 0.1) 0%,
        rgba(0, 212, 255, 0.05) 50%,
        rgba(0, 212, 255, 0.1) 100%
    );
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    overflow: hidden;
}

.hologram::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(0, 212, 255, 0.2),
        transparent
    );
    animation: hologramScan 3s linear infinite;
}

@keyframes hologramScan {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 网格扫描效果 */
.grid-scan {
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 212, 255, 0.1) 2px,
            rgba(0, 212, 255, 0.1) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0, 212, 255, 0.1) 2px,
            rgba(0, 212, 255, 0.1) 4px
        );
    animation: gridPulse 4s ease-in-out infinite;
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* 粒子系统效果 */
.particle-system {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: particleFloat 10s linear infinite;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { left: 20%; animation-delay: 1s; }
.particle:nth-child(3) { left: 30%; animation-delay: 2s; }
.particle:nth-child(4) { left: 40%; animation-delay: 3s; }
.particle:nth-child(5) { left: 50%; animation-delay: 4s; }
.particle:nth-child(6) { left: 60%; animation-delay: 5s; }
.particle:nth-child(7) { left: 70%; animation-delay: 6s; }
.particle:nth-child(8) { left: 80%; animation-delay: 7s; }
.particle:nth-child(9) { left: 90%; animation-delay: 8s; }

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
        transform: scale(1);
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) scale(0);
        opacity: 0;
    }
}

/* 波纹效果 */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.3);
    transform: translate(-50%, -50%);
    animation: rippleExpand 2s ease-out infinite;
}

@keyframes rippleExpand {
    0% {
        width: 0;
        height: 0;
        opacity: 0.8;
    }
    100% {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

/* 数字雨效果 */
.digital-rain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-mono);
}

.rain-column {
    position: absolute;
    top: -100%;
    font-size: 14px;
    color: var(--primary-color);
    animation: digitalFall 8s linear infinite;
    opacity: 0.7;
}

.rain-column:nth-child(odd) {
    color: var(--success-color);
    animation-duration: 10s;
}

.rain-column:nth-child(3n) {
    color: var(--warning-color);
    animation-duration: 6s;
}

@keyframes digitalFall {
    0% {
        transform: translateY(-100vh);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

/* 加载动画 */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 212, 255, 0.3);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 进度条动画 */
.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(0, 212, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 2px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShine 2s ease-in-out infinite;
}

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

/* 数据大屏特效 */
.dashboard-metric {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    overflow: hidden;
}

.dashboard-metric::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
    animation: metricPulse 3s ease-in-out infinite;
}

@keyframes metricPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.metric-value {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
    animation: metricFlicker 4s ease-in-out infinite;
}

@keyframes metricFlicker {
    0%, 90%, 100% { opacity: 1; }
    95% { opacity: 0.8; }
}

/* 网络拓扑动画 */
.network-node {
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    position: absolute;
    animation: nodePulse 2s ease-in-out infinite;
    box-shadow: 0 0 10px var(--primary-color);
}

.network-node::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.3);
    transform: translate(-50%, -50%);
    animation: nodeRipple 2s ease-out infinite;
}

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

@keyframes nodeRipple {
    0% {
        width: 0;
        height: 0;
        opacity: 0.8;
    }
    100% {
        width: 40px;
        height: 40px;
        opacity: 0;
    }
}

.network-connection {
    stroke: var(--primary-color);
    stroke-width: 2;
    fill: none;
    stroke-dasharray: 5 5;
    animation: connectionFlow 3s linear infinite;
    filter: drop-shadow(0 0 3px var(--primary-color));
}

@keyframes connectionFlow {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 20; }
}

/* 威胁检测动画 */
.threat-alert {
    background: rgba(255, 51, 102, 0.1);
    border: 1px solid var(--error-color);
    border-radius: 8px;
    padding: 1rem;
    position: relative;
    animation: threatFlash 1s ease-in-out infinite;
}

@keyframes threatFlash {
    0%, 50%, 100% { background: rgba(255, 51, 102, 0.1); }
    25%, 75% { background: rgba(255, 51, 102, 0.2); }
}

.threat-level-high {
    animation: threatCritical 0.5s ease-in-out infinite;
}

@keyframes threatCritical {
    0%, 100% { box-shadow: 0 0 5px var(--error-color); }
    50% { box-shadow: 0 0 20px var(--error-color), 0 0 30px var(--error-color); }
}

/* 实时监控动画 */
.monitor-screen {
    background: var(--bg-darker);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.monitor-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        rgba(0, 212, 255, 0.05) 2px,
        transparent 4px
    );
    animation: scanLines 2s linear infinite;
    pointer-events: none;
}

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

/* 状态指示灯 */
.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: relative;
    display: inline-block;
}

.status-indicator.online {
    background: var(--success-color);
    box-shadow: 0 0 10px var(--success-color);
    animation: statusOnline 2s ease-in-out infinite;
}

.status-indicator.warning {
    background: var(--warning-color);
    box-shadow: 0 0 10px var(--warning-color);
    animation: statusWarning 1s ease-in-out infinite;
}

.status-indicator.error {
    background: var(--error-color);
    box-shadow: 0 0 10px var(--error-color);
    animation: statusError 0.5s ease-in-out infinite;
}

@keyframes statusOnline {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes statusWarning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes statusError {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* AI思考动画 */
.ai-thinking {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.thinking-dot {
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: thinkingPulse 1.4s ease-in-out infinite;
}

.thinking-dot:nth-child(1) { animation-delay: 0s; }
.thinking-dot:nth-child(2) { animation-delay: 0.2s; }
.thinking-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes thinkingPulse {
    0%, 60%, 100% { transform: scale(1); opacity: 1; }
    30% { transform: scale(1.5); opacity: 0.7; }
}

/* 入场动画 */
.fade-in {
    animation: fadeIn 0.8s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.8s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.8s ease-out;
}

.slide-in-up {
    animation: slideInUp 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 鼠标悬停特效 */
.hover-glow:hover {
    box-shadow: 
        0 0 20px rgba(0, 212, 255, 0.4),
        0 0 40px rgba(0, 212, 255, 0.2),
        0 0 60px rgba(0, 212, 255, 0.1);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

/* 响应式动画 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 移动端优化 */
@media (max-width: 768px) {
    .particle-system,
    .digital-rain,
    .matrix-rain {
        display: none;
    }
    
    .neon-glow {
        text-shadow: 0 0 10px var(--primary-color);
    }
    
    .metric-value {
        font-size: 2rem;
    }
}

/* 高帧率动画优化 */
@media (min-resolution: 120dpi) {
    .smooth-animation {
        animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
        will-change: transform, opacity;
    }
}