/* Custom CSS for AutoPAR Web App */

/* Base styles for 3D model viewer */
model-viewer {
    --poster-color: transparent;
    --progress-bar-color: #3b82f6;
    --progress-bar-height: 2px;
}

/* Loading state for model viewer */
model-viewer:not([data-loaded="true"]) {
    background-color: #f3f4f6;
    background-image: radial-gradient(circle at center, #e5e7eb 0%, transparent 70%);
    background-size: 40px 40px;
    animation: loading-pulse 2s ease-in-out infinite;
}

@keyframes loading-pulse {
    0%, 100% { 
        opacity: 1; 
    }
    50% { 
        opacity: 0.7; 
    }
}

/* Error handling for model viewer */
model-viewer[error] {
    background-color: #fef2f2;
    border: 2px dashed #fca5a5;
    position: relative;
}

model-viewer[error]::before {
    content: "Failed to load 3D model";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #dc2626;
    font-size: 14px;
    font-weight: 500;
}

/* WebSocket connection status indicator */
.ws-status {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.ws-status.connected {
    background-color: #10b981;
    color: white;
}

.ws-status.disconnected {
    background-color: #ef4444;
    color: white;
}

.ws-status.connecting {
    background-color: #f59e0b;
    color: white;
}

/* Enhanced viewer controls */
.viewer-controls {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.viewer-control-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.viewer-control-btn:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Debug console for development */
.debug-console {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 300px;
    max-height: 200px;
    background: rgba(0, 0, 0, 0.9);
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    padding: 10px;
    border-radius: 4px;
    z-index: 9999;
    overflow-y: auto;
    display: none;
}

.debug-console.show {
    display: block;
}

.debug-console .log-entry {
    margin-bottom: 4px;
    word-break: break-all;
}

.debug-console .log-error {
    color: #ff4444;
}

.debug-console .log-warn {
    color: #ffaa00;
}

.debug-console .log-info {
    color: #00aaff;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ws-status {
        top: 10px;
        right: 10px;
        font-size: 11px;
        padding: 6px 10px;
    }
    
    .viewer-controls {
        top: 10px;
        left: 10px;
        gap: 6px;
    }
    
    .viewer-control-btn {
        padding: 6px;
    }
    
    .debug-console {
        width: 250px;
        bottom: 10px;
        left: 10px;
        font-size: 10px;
    }
}
