<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Kubernetes Cluster Visualization - K8s Pulse 3D</title>
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="/static/style.css">
    <!-- D3.js for 2D floor layout computation -->
    <script src="https://d3js.org/d3.v7.min.js"></script>
    <!-- Three.js & OrbitControls for 3D rendering and mouse navigation -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/three@0.128.0/examples/js/controls/OrbitControls.js"></script>
</head>
<body>
    <div class="app-container">
        <header class="glass-panel header">
            <div class="logo">
                <img src="/static/k8spulselogo-sm.png" alt="K8s Pulse Logo" class="logo-icon">
                <h1>K8s Pulse <span class="badge-3d">3D</span></h1>
            </div>
            <div class="controls">
                <div class="search-container">
                    <input type="text" id="pod-search" class="search-input glass-panel" placeholder="Search Pods..." autocomplete="off">
                </div>
                <div class="toggle-container">
                    <button class="toggle-btn active" id="btn-cpu">CPU Consumption</button>
                    <button class="toggle-btn" id="btn-mem">Memory Consumption</button>
                </div>
                <div class="theme-selector">
                    <select id="theme-select" class="theme-select glass-panel">
                        <option value="dark">Dark Theme</option>
                        <option value="neon">Neon Theme</option>
                        <option value="light">Light Theme</option>
                        <option value="gray">Gray Theme</option>
                        <option value="bw">Black & White</option>
                    </select>
                </div>
                <div class="action-buttons">
                    <button class="icon-btn" id="btn-reset-cam" title="Reset Camera View">
                        <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                            <path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/>
                            <path d="M3 3v5h5"/>
                        </svg>
                        <span>Reset View</span>
                    </button>
                    <button class="icon-btn" id="btn-auto-rotate" title="Toggle 3D Auto-Rotation">
                        <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                            <path d="M21.5 2v6h-6M21.34 15.57a10 10 0 1 1-.57-8.38l5.67-5.67"/>
                        </svg>
                        <span id="auto-rotate-text">Auto Rotate</span>
                    </button>
                    <button class="icon-btn" id="btn-speed-down" title="Slow Down Rotation">
                        <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                            <path d="M15 18l-6-6 6-6"/>
                        </svg>
                    </button>
                    <button class="icon-btn" id="btn-speed-up" title="Speed Up Rotation">
                        <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                            <path d="M9 18l6-6-6-6"/>
                        </svg>
                    </button>
                </div>
            </div>
        </header>
        
        <main class="main-content">
            <div id="loading" class="loading glass-panel">
                <div class="spinner"></div>
                <p>Building 3D Pod Topology...</p>
            </div>
            
            <div id="chart-container" class="chart-container"></div>
            
            <!-- 3D Navigation Hint -->
            <div class="navigation-hint glass-panel">
                <span><kbd>Left Drag</kbd> Rotate</span>
                <span><kbd>Right Drag</kbd> Pan</span>
                <span><kbd>Scroll</kbd> Zoom</span>
            </div>

            <!-- Legend Panel -->
            <div class="legend-panel glass-panel">
                <div class="legend-item"><span class="legend-dot running"></span> Running Pod</div>
                <div class="legend-item"><span class="legend-dot pending"></span> Pending Pod</div>
                <div class="legend-item"><span class="legend-dot succeeded"></span> Succeeded Pod</div>
                <div class="legend-item"><span class="legend-dot failed"></span> Failed Pod</div>
                <div class="legend-item"><span class="legend-dot unused"></span> Available Capacity</div>
                <div class="legend-divider"></div>
                <div class="legend-note">📐 <strong>Tower Height</strong> = Resource Usage</div>
            </div>

            <!-- Version Footer Overlay -->
            <div class="version-overlay glass-panel">
                <span>v: {{ version }}</span>
            </div>
        </main>
    </div>
    
    <div id="tooltip" class="tooltip glass-panel hidden"></div>

    <script src="/static/app.js"></script>
</body>
</html>

