<!DOCTYPE html>
<html lang="{{.CurrentSiteLang}}">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    {{ if .IsThemeDark }}
    <meta name="darkreader-lock">
    {{ end }}
    <title>{{ translate "settings_title" }}</title>
    <link rel="stylesheet" href="/static/css/style.css">
    <link rel="stylesheet" href="/static/css/{{.Theme}}.css">
    <link rel="stylesheet" href="/static/css/style-settings.css">
    <link rel="stylesheet" href="/static/css/style-fonts.css">
    <link rel="search" type="application/opensearchdescription+xml" title="{{ translate "site_name" }}" href="/opensearch.xml">    
    <!-- Icons -->
    <link rel="icon" href="{{ .IconPathSVG }}" type="image/svg+xml">
    <link rel="icon" href="{{ .IconPathPNG }}" type="image/png">
    <link rel="apple-touch-icon" href="{{ .IconPathPNG }}">
</head>
<body>
    <div class="settings-nav">
        <h1 class="logomobile"><a class="no-decoration" href="./">{{ translate "settings" }}</a></h1>
    </div>

    <div class="settings-container">
        <form action="/save-settings" method="post">
            <div class="settings">
                <div class="settings-row">
                    <span class="highlight"><p>{{ translate "theme" }}</p></span>
                </div>

                <div class="theme-settings">
                    <div class="themes-settings-menu">
                        <a href="/search?theme=dark" class="theme-link">
                            <div class="view-image-search clickable" id="dark">
                                <img src="/static/images/dark.webp" alt="{{ translate "theme_dark" }}">
                                <div class="theme-tooltip">🌆 {{ translate "theme_dark" }}</div>
                            </div>
                        </a>
                        <a href="/search?theme=light" class="theme-link">
                            <div class="view-image-search clickable" id="light">
                                <img src="/static/images/light.webp" alt="{{ translate "theme_light" }}">
                                <div class="theme-tooltip">🌇 {{ translate "theme_light" }}</div>
                            </div>
                        </a>
                        <a href="/search?theme=night" class="theme-link">
                            <div class="view-image-search clickable" id="night">
                                <img src="/static/images/night.webp" alt="{{ translate "theme_night" }}">
                                <div class="theme-tooltip">🌃 {{ translate "theme_night" }}</div>
                            </div>
                        </a>
                        <a href="/search?theme=black" class="theme-link">
                            <div class="view-image-search clickable" id="black">
                                <img src="/static/images/black.webp" alt="🕶️ {{ translate "theme_black" }}">
                                <div class="theme-tooltip">🐈‍⬛ {{ translate "theme_black" }}</div>
                            </div>
                        </a>
                        <a href="/search?theme=mocha" class="theme-link">
                            <div class="view-image-search clickable" id="mocha">
                                <img src="/static/images/mocha.webp" alt="🌿 {{ translate "theme_mocha" }}">
                                <div class="theme-tooltip">🌿 {{ translate "theme_mocha" }}</div>
                            </div>
                        </a>
                        <a href="/search?theme=latte" class="theme-link">
                            <div class="view-image-search clickable" id="latte">
                                <img src="/static/images/latte.webp" alt="🌻 {{ translate "theme_latte" }}">
                                <div class="theme-tooltip">🌻 {{ translate "theme_latte" }}</div>
                            </div>
                        </a>
                    </div>
                </div>

                <div class="settings-row">
                    <p>{{ translate "safe_search" }}</p>
                    <select class="results-settings" name="safe" id="safeSearchSelect">
                        <option value="disabled" {{if eq .Safe "disabled"}}selected{{end}}>{{ translate "off" }}</option>
                        <option value="active" {{if eq .Safe "active"}}selected{{end}}>{{ translate "on" }}</option>
                    </select>
                </div>

                <div class="settings-row">
                    <p>{{ translate "site_language" }}</p>
                    <select class="results-settings" name="site_lang" id="siteLanguageSelect">
                        {{range .LanguageOptions}}
                        <option value="{{.Code}}" {{if eq .Code $.CurrentSiteLang}}selected{{end}}>{{.Name}}</option>
                        {{end}}
                    </select>
                </div>

                <div class="settings-row">
                    <p>{{ translate "search_language" }}</p>
                    <select class="results-settings" name="search_lang" id="searchLanguageSelect">
                        {{range .LanguageOptions}}
                        <option value="{{.Code}}" {{if eq .Code $.CurrentSearchLang}}selected{{end}}>{{.Name}}</option>
                        {{end}}
                    </select>
                </div>

                <div class="settings-row">
                    <p class="font-hide">‎ </p>
                    <button class="save save-settings-page" type="submit">{{ translate "save_settings" }}</button>
                </div>
            </div>
        </form>
    </div>
</body>
</html>