/* Holographic Effects */

.holographic-ai {
    position: fixed;
    top: 50px;
    left: 50px;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 20px;
    opacity: 0;
    animation: ai-materialization 3s ease-in-out 2s forwards;
}

@keyframes ai-materialization {
    0% { 
        opacity: 0; 
        transform: scale(0) rotateX(90deg); 
    }
    50% { 
        opacity: 0.7; 
        transform: scale(1.2) rotateX(45deg); 
    }
    100% { 
        opacity: 1; 
        transform: scale(1) rotateX(0deg); 
    }
}

.ai-avatar {
    width: 80px;
    height: 80px;
    background: conic-gradient(var(--primary-holo), var(--secondary-holo), var(--accent-neural), var(--primary-holo));
    border-radius: 50%;
    position: relative;
    animation: ai-rotation 6s linear infinite;
    filter: blur(0.5px);
}

.ai-avatar::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    background: radial-gradient(circle, var(--deep-space) 30%, transparent 70%);
    border-radius: 50%;
}

.ai-avatar::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: var(--primary-holo);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 
        0 0 10px var(--primary-holo),
        0 0 20px var(--primary-holo);
    animation: ai-pulse 2s ease-in-out infinite;
}

@keyframes ai-rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes ai-pulse {
    0%, 100% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1); 
    }
    50% { 
        opacity: 0.7; 
        transform: translate(-50%, -50%) scale(1.3); 
    }
}

.ai-speech-bubble {
    background: rgba(0, 0, 0, 0.9);
    padding: 15px 20px;
    border-radius: 20px 20px 20px 5px;
    border: 2px solid var(--primary-holo);
    position: relative;
    max-width: 300px;
    backdrop-filter: blur(15px);
    animation: hologram-flicker 4s ease-in-out infinite;
}

.ai-speech-bubble::before {
    content: '';
    position: absolute;
    left: -10px;
    bottom: 10px;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 10px solid var(--primary-holo);
}

@keyframes hologram-flicker {
    0%, 90%, 100% { opacity: 1; }
    95% { opacity: 0.8; }
}

.ai-text {
    color: var(--primary-holo);
    font-size: 0.9rem;
    line-height: 1.4;
    animation: text-typing 3s ease-in-out infinite;
}

@keyframes text-typing {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.fractal-avatar {
    position: fixed;
    top: 50px;
    right: 50px;
    z-index: 200;
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px;
    border-radius: 15px;
    border: 2px solid var(--accent-neural);
    backdrop-filter: blur(10px);
}

#avatar-canvas {
    border-radius: 50%;
    border: 3px solid var(--accent-neural);
    animation: fractal-evolution 8s ease-in-out infinite;
    filter: drop-shadow(0 0 15px var(--accent-neural));
}

@keyframes fractal-evolution {
    0%, 100% { 
        transform: rotate(0deg) scale(1); 
        filter: drop-shadow(0 0 15px var(--accent-neural)) hue-rotate(0deg); 
    }
    25% { 
        transform: rotate(90deg) scale(1.05); 
        filter: drop-shadow(0 0 15px var(--accent-neural)) hue-rotate(90deg); 
    }
    50% { 
        transform: rotate(180deg) scale(0.95); 
        filter: drop-shadow(0 0 15px var(--accent-neural)) hue-rotate(180deg); 
    }
    75% { 
        transform: rotate(270deg) scale(1.05); 
        filter: drop-shadow(0 0 15px var(--accent-neural)) hue-rotate(270deg); 
    }
}

.avatar-status {
    font-size: 0.7rem;
    color: var(--accent-neural);
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ar-simulation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.spatial-anchor {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 2px solid var(--quantum-gold);
    border-radius: 50%;
    top: 20%;
    left: 30%;
    animation: spatial-float 6s ease-in-out infinite;
}

.spatial-anchor::before,
.spatial-anchor::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: var(--quantum-gold);
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.spatial-anchor::after {
    width: 2px;
    height: 100%;
    left: 50%;
    transform: translateX(-50%);
}

@keyframes spatial-float {
    0%, 100% { 
        transform: translateY(0px) rotateZ(0deg); 
        opacity: 0.6; 
    }
    50% { 
        transform: translateY(-20px) rotateZ(180deg); 
        opacity: 1; 
    }
}

.haptic-feedback-indicator {
    position: absolute;
    bottom: 100px;
    right: 100px;
    width: 100px;
    height: 20px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--secondary-holo) 20%, 
        var(--primary-holo) 40%, 
        var(--accent-neural) 60%, 
        var(--quantum-gold) 80%, 
        transparent 100%
    );
    border-radius: 10px;
    animation: haptic-wave 2s ease-in-out infinite;
    opacity: 0.7;
}

@keyframes haptic-wave {
    0%, 100% { transform: scaleX(0.5); }
    50% { transform: scaleX(1.2); }
}

.room-projection {
    position: absolute;
    top: 10%;
    right: 10%;
    width: 200px;
    height: 150px;
    border: 3px solid var(--primary-holo);
    border-radius: 10px;
    background: rgba(0, 255, 255, 0.1);
    animation: room-scan 8s linear infinite;
    opacity: 0.4;
}

.room-projection::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-holo);
    animation: scan-line 2s linear infinite;
}

@keyframes room-scan {
    0% { transform: perspective(500px) rotateY(-15deg); }
    50% { transform: perspective(500px) rotateY(15deg); }
    100% { transform: perspective(500px) rotateY(-15deg); }
}

@keyframes scan-line {
    0% { top: 0; opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

.emotion-scanner {
    position: fixed;
    bottom: 50px;
    left: 50px;
    z-index: 150;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px;
    border-radius: 10px;
    border: 2px solid var(--cosmic-purple);
    backdrop-filter: blur(10px);
    min-width: 200px;
}

.scan-lines {
    height: 40px;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 2px,
        var(--cosmic-purple) 2px,
        var(--cosmic-purple) 4px
    );
    border-radius: 5px;
    animation: emotion-scan 3s linear infinite;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
}

.scan-lines::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--cosmic-purple), transparent);
    animation: scan-sweep 2s linear infinite;
}

@keyframes emotion-scan {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

@keyframes scan-sweep {
    0% { left: -100%; }
    100% { left: 100%; }
}

.emotion-display {
    color: var(--cosmic-purple);
    font-size: 0.9rem;
    text-align: center;
}

#current-emotion {
    color: var(--primary-holo);
    font-weight: 600;
    text-shadow: 0 0 10px currentColor;
}

.neural-network-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    background-image: 
        radial-gradient(circle at 25% 25%, var(--accent-neural) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, var(--primary-holo) 2px, transparent 2px),
        radial-gradient(circle at 75% 25%, var(--secondary-holo) 1px, transparent 1px),
        radial-gradient(circle at 25% 75%, var(--quantum-gold) 1px, transparent 1px);
    background-size: 100px 100px, 80px 80px, 120px 120px, 90px 90px;
    animation: neural-drift 15s linear infinite;
}

@keyframes neural-drift {
    0% { background-position: 0 0, 0 0, 0 0, 0 0; }
    100% { background-position: 100px 100px, 80px 80px, 120px 120px, 90px 90px; }
}

.holographic-nav .nav-sphere.active {
    transform: scale(1.3);
    box-shadow: 
        0 0 30px var(--primary-holo),
        inset 0 0 30px rgba(255, 255, 255, 0.2);
}

.holographic-nav .nav-sphere.active .sphere-glow {
    opacity: 0.8;
    animation-duration: 2s;
}

@media (max-width: 768px) {
    .holographic-ai {
        top: 20px;
        left: 20px;
        flex-direction: column;
        gap: 10px;
    }
    
    .ai-avatar {
        width: 60px;
        height: 60px;
    }
    
    .ai-speech-bubble {
        max-width: 200px;
        padding: 10px 15px;
        font-size: 0.8rem;
    }
    
    .fractal-avatar {
        top: 20px;
        right: 20px;
        padding: 10px;
    }
    
    #avatar-canvas {
        width: 70px;
        height: 70px;
    }
    
    .emotion-scanner {
        bottom: 20px;
        left: 20px;
        min-width: 150px;
    }
    
    .spatial-anchor {
        width: 30px;
        height: 30px;
    }
    
    .room-projection {
        width: 120px;
        height: 90px;
        top: 15%;
        right: 5%;
    }
}