<!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>Studios</h2>
            <form class="search-form" action="/studios" method="get">
                <input type="text" name="q" class="input" placeholder="Search studios..." value="{{.Query}}">
                <button type="submit" class="btn">Search<div class="hoverEffect"><div></div></div></button>
            </form>
        </div>

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

                <div class="gx-card-body">
                    <div class="gx-card-title">{{.Studio.Name}}</div>
                    <div class="gx-card-meta">{{.SceneCount}} scenes</div>

                    {{if .Studio.Description}}
                    <div class="gx-card-meta studio-card-description">{{.Studio.Description}}</div>
                    {{end}}

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