<!DOCTYPE html>
<html lang="{{__locale_id}}" dir="{{__locale_direction}}">
    
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0">
        <title>
            OmniSearch Images - {{query}}
        </title>
        <link rel="icon" type="image/x-icon" href="/static/favicon.ico">
        <link rel="stylesheet" href="static/main.css">
        <link rel="stylesheet" href="static/themes/{{theme}}.css">
    </head>
    
    <body class="images-view">
        <header>
            <a href="/" class="logo-link"><h1>
                Omni<span>Search</span>
            </h1></a>
            <form action="/images" method="GET" class="search-form">
                <input name="q" autocomplete="off"="text" class="search-box" placeholder="{{l("search_placeholder")}}"
                value="{{query}}">
            </form>
            <a href="/settings?q={{query}}" class="nav-settings-icon" title="{{l("settings_tab")}}"></a>
        </header>
        <nav class="nav-tabs">
            <div class="nav-container">
                <a href="/search?q={{query}}">
                    {{l("all_tab")}}
                </a>
                <a href="/images?q={{query}}" class="active">
                    {{l("images_tab")}}
                </a>
                <a href="/settings?q={{query}}" class="nav-settings-link">
                    {{l("settings_tab")}}
                </a>
            </div>
        </nav>
        <main class="image-results-container">
            <div class="image-grid">
                {{for img in images}}
                <div class="image-card">
                    <div class="image-wrapper">
                        <img src="{{img[0]}}" alt="{{img[1]}}" loading="lazy">
                        <div class="image-overlay">
                            <div class="overlay-buttons">
                                <a href="{{img[3]}}" target="_blank" class="overlay-btn primary">
                                    {{l("view_image")}}
                                </a>
                                <a href="{{img[2]}}" target="_blank" class="overlay-btn secondary">
                                    {{l("visit_site")}}
                                </a>
                            </div>
                        </div>
                    </div>
                    <div class="image-info">
                        <span class="image-caption">
                            {{img[1]}}
                        </span>
                        <span class="image-source">
                            {{img[2]}}
                        </span>
                    </div>
                </div>
                {{endfor}}
            </div>
            {{if exists pagination_links}}
            <nav class="pagination">
                {{for link in pagination_links}}
                <a class="{{link[2]}}" href="{{link[0]}}">
                    {{link[1]}}
                </a>
                {{endfor}}
            </nav>
            {{endif}}
        </main>
    </body>

</html>