/* 3D Robot Viewer Styles */

.robot-3d-viewer {
    position: relative;
    background: linear-gradient(135deg, 
        rgba(26, 26, 46, 0.95),
        rgba(15, 15, 30, 0.95)
    );
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(0, 212, 170, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(74, 158, 255, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, #1a1a2e, #0f0f1e);
    box-shadow: inset 0 0 100px rgba(0, 212, 170, 0.05);
}

#threejs-container canvas {
    display: block;
    cursor: grab;
}

#threejs-container canvas:active {
    cursor: grabbing;
}

/* Grid floor effect */
.grid-floor {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 212, 170, 0.3) 50%, 
        transparent 100%
    );
    animation: gridPulse 3s ease-in-out infinite;
}

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

/* Loading state */
.robot-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.robot-loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(0, 212, 170, 0.3);
    border-top-color: var(--accent-robotics);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.robot-loading-text {
    margin-top: 1rem;
    color: var(--text-secondary);
}

/* Info overlay */
.robot-info {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    background: rgba(26, 26, 46, 0.9);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    max-width: 300px;
    backdrop-filter: blur(10px);
}

.robot-info h4 {
    color: var(--accent-robotics);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.robot-info-item {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.robot-info-value {
    color: var(--text-primary);
    font-weight: 600;
}

/* Control hints */
.control-hints {
    position: absolute;
    top: 1rem;
    left: 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.control-hints:hover {
    opacity: 1;
}

.control-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.control-key {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.8rem;
}

/* Sensor visualization */
.sensor-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.sensor-beam {
    position: absolute;
    background: linear-gradient(90deg, 
        rgba(255, 107, 107, 0.3),
        transparent
    );
    transform-origin: left center;
    animation: sensorScan 2s linear infinite;
}

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

.lidar-points {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--accent-robotics);
    border-radius: 50%;
    box-shadow: 0 0 4px var(--accent-robotics);
    animation: lidarPulse 1s ease-out infinite;
}

@keyframes lidarPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(3);
        opacity: 0;
    }
}

/* Path visualization */
.path-line {
    stroke: var(--accent-robotics);
    stroke-width: 2;
    fill: none;
    stroke-dasharray: 5, 5;
    animation: pathFlow 1s linear infinite;
}

@keyframes pathFlow {
    to {
        stroke-dashoffset: -10;
    }
}

/* Robot parts highlighting */
.part-highlight {
    position: absolute;
    border: 2px solid var(--accent-vision);
    border-radius: 4px;
    pointer-events: none;
    animation: highlightPulse 1s ease-in-out infinite;
}

@keyframes highlightPulse {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* Coordinate system */
.coordinate-axes {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    width: 100px;
    height: 100px;
}

.axis-x {
    stroke: #ff0000;
    stroke-width: 2;
}

.axis-y {
    stroke: #00ff00;
    stroke-width: 2;
}

.axis-z {
    stroke: #0000ff;
    stroke-width: 2;
}

/* Performance stats */
.performance-stats {
    position: absolute;
    top: 60px;
    right: 1rem;
    background: rgba(26, 26, 46, 0.9);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.5rem;
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.stat-line {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

/* Mobile touch controls */
@media (max-width: 768px) {
    .viewer-controls {
        bottom: 1rem;
        top: auto;
        right: 50%;
        transform: translateX(50%);
    }
    
    .control-hints {
        display: none;
    }
    
    .robot-info {
        font-size: 0.8rem;
        max-width: 200px;
    }
}