<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{.Query}} - Ocásek</title>
    <link rel="stylesheet" href="/static/css/style.css">
</head>
<body>
    <form action="/search" id="prev-next-form" class="results-search-container" method="GET" autocomplete="off">
        <h1 class="logomobile"><a class="no-decoration" href="./">Ocásek</a></h1>
        <div class="wrapper-results">
        <input type="text" name="q" value="{{ .Query }}" id="search-input" placeholder="Type to search..." />
        <button id="search-wrapper-ico" class="material-icons-round" name="t" value="video">search</button>
        <input type="submit" class="hide" name="t" value="video" />
    </div>
        <div class="sub-search-button-wrapper">
            <div class="search-container-results-btn">
                <button id="sub-search-wrapper-ico" class="material-icons-round clickable" name="t" value="text">search</button>
                <button name="t" value="text" class="clickable">Web</button>
            </div>                  
            <div class="search-container-results-btn">
                <button id="sub-search-wrapper-ico" class="material-icons-round clickable" name="t" value="image">image</button>
                <button name="t" value="image" class="clickable">Images</button>
            </div>
            <div class="search-container-results-btn">
                <button id="sub-search-wrapper-ico" class="material-icons-round clickable search-active" name="t" value="video">movie</button>
                <button name="t" value="video" class="clickable search-active">Videos</button>
            </div>
            <div class="search-container-results-btn">
                <button id="sub-search-wrapper-ico" class="material-icons-round clickable" name="t" value="reddit">forum</button>
                <button name="t" value="forum" class="clickable">Forums</button>
            </div>
            <div id="content" class="js-enabled">
            <div class="search-container-results-btn">
                <button id="sub-search-wrapper-ico" class="material-icons-round clickable" name="t" value="map">map</button>
                <button name="t" value="map" class="clickable">Map</button>
            </div>
        </div>
            <div class="search-container-results-btn">
                <button id="sub-search-wrapper-ico" class="material-icons-round clickable" name="t" value="torrent">share</button>
                <button name="t" value="torrent" class="clickable">Torrents</button>
            </div>
        </div>
        </div>
    </form>
    <!-- Results go here -->
    <p class="fetched fetched_dif fetched_vid"><!-- { fetched } --></p>
    {{ if .Results }}
        {{ range .Results }}
        <div>
            <div class="video__results">
                <div class="video__img__results">
            <a href="{{ .Href }}"> <img src="{{ .Image }}">
                <div class="duration">{{ .Duration }}</div>
            </img></a>
                </div>
                    <div class="results video-results-margin">
                    <h3 class="video_title" href="{{ .Href }}">{{ .Title }}</h3></a>
                    <p class="stats">{{ .Views }} <span class="pipe">|</span> {{ .Date }}</p>
                    <p class="publish__info">YouTube <span class="pipe">|</span> {{ .Creator }}</p>
                </div>
            </div>
        </div>
        {{ end }}
    {{ else }}
        <div class="no-results">No results found for '{{ .Query }}'. Try different keywords.</div>>
    {{ end }}

    <script>
        // Check if JavaScript is enabled and modify the DOM accordingly
        document.getElementById('content').classList.remove('js-enabled');
    </script>
</body>
</html>