<!DOCTYPE html>
<html lang="en">
<head>
    {{template "html-head" .}}
</head>
<body class="app-shell">
    {{template "navbar" .}}

    <div class="app-body container-fluid px-3 px-lg-4 px-xxl-5">
        <main class="container">
        <div class="page-header">
            <h2>Scenes</h2>
            <form class="search-form" action="/scenes" method="get">
                <input type="text" name="q" class="input" placeholder="Search scenes..." value="{{.Query}}">
                <button type="submit" class="btn">Search<div class="hoverEffect"><div></div></div></button>
            </form>
        </div>

        {{if .Scenes}}
        <div class="gx-card-grid scene-card-grid">
            {{range .Scenes}}
            <div class="gx-card scene-card" onclick="location.href='/scenes/{{.Scene.ID}}'">
                <div class="gx-card-thumb"
                     style="background-image: url('{{if .Scene.ImageURL}}{{.Scene.ImageURL}}{{else}}/static/img/placeholder-scene.jpg{{end}}'); background-color: #1a1a1a;">
                </div>

                <div class="gx-card-body">
                    <div class="gx-card-title">{{.Scene.Title}}</div>

                    {{if .Scene.Date}}
                    <div class="gx-card-meta">📅 {{.Scene.Date}}</div>
                    {{end}}

                    {{if .StudioName}}
                    <div class="gx-card-meta">
                        🏢 {{.StudioName}}
                    </div>
                    {{end}}

                    <div class="gx-card-tags">
                        {{if .Scene.Code}}
                        <span class="gx-card-tag">{{.Scene.Code}}</span>
                        {{end}}
                        {{if .Scene.Source}}
                        <span class="gx-card-tag">{{.Scene.Source}}</span>
                        {{end}}
                    </div>
                </div>
            </div>
            {{end}}
        </div>
        {{else}}
        <div class="empty-state">
            <p>No scenes found.</p>
            <div class="empty-import-actions">
                <p class="hint">Import scenes now.</p>
                <div class="action-buttons">
                    <button type="button" class="btn" onclick="bulkImportScenes()">Import all scenes</button>
                </div>
                <div id="scene-import-status" class="status-banner"></div>
            </div>
        </div>
        {{end}}
        </main>
    </div>
    {{template "html-scripts" .}}
</body>
</html>
