<!DOCTYPE html>
<html lang="en" dir="ltr" id="main_html">
    <head>
        <meta name="viewport" content="width=device-width, initial-scale=1.0" charset="utf-8" />
        <title id="title"></title>
        
        
        <!-- Material Icons -->
        <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
        <!-- Material Symbols - Outlined Set -->
        <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined" rel="stylesheet" />
        <!-- Material Symbols - Rounded Set -->
        <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded" rel="stylesheet" />
        <!-- Material Symbols - Sharp Set -->
        <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp" rel="stylesheet" />
        
        <link rel="stylesheet" href="{{ url_for('static', filename='css/uikit.min.css') }}"/>
        <link id="dark-mode" rel="stylesheet" href="{{ url_for('static', filename='css/dark-mode.css') }}" disabled/>


        <script src="{{ url_for('static', filename='js/uikit.min.js') }}"></script>
        <script src="{{ url_for('static', filename='js/uikit-icons.min.js') }}"></script>

    </head>
    <body>
        <div uk-sticky="sel-target: .uk-navbar-container; cls-active: uk-navbar-sticky">
            <nav id="navbar" class="uk-navbar-container">
                <div class="uk-container uk-container-expand">
                    <div uk-navbar="dropbar: true">
                        <div id="offcanvas-slide" uk-offcanvas="mode: slide; overlay: true">
                            <div class="uk-offcanvas-bar uk-flex uk-flex-column">
                                <ul class="uk-nav uk-nav-secondary">  
                                    <img class="uk-align-center uk-border-circle" data-src="{{ url_for('static', filename='pictures/logo.jpg') }}" style="width: 150px; height: auto;" uk-img />
                                    <li class="uk-nav-header">Apps</li>
                                    <li>
                                        <a href="/shopping-lists">
                                            <div class="uk-active">Shopping Lists<div class="uk-nav-subtitle" disabled>You are currently browsing shopping lists here...</div></div>
                                        </a>
                                    </li>
                                    <li><a href="/recipes">Recipes</a></li>
                                    <li class="uk-nav-header">Logistics</li>
                                    <li><a href="/items">Items</a></li>
                                    <li><a href="/transaction">Add Transaction</a></li>
                                    <li><a href="/workshop">Workshop</a></li>
                                    <li><a href="/receipts">Receipts</a></li>
                                    <li class="uk-nav-header">System Management</li>
                                    <li><a><div>{{current_site}}<div class="uk-nav-subtitle">This is the current site you are viewing...</div></div></a>
                                        <div uk-dropdown="mode: click">
                                            <ul class="uk-nav uk-dropdown-nav">
                                                {% for site in sites %}
                                                {% if site == current_site  %}
                                                <li><a class="uk-disabled" href="#">{{site}}</a></li>
                                                {% else %}
                                                <li><a onclick="changeSite('{{site}}')">{{site}}</a></li>
                                                {% endif %}
                                                {% endfor %}
                                            </ul>
                                        </div>
                                    </li>
                                    {% if system_admin %}
                                    <li><a href="/admin">Administration</a></li>
                                    {% endif %}
                                    <li><a href="" class="">{{username}}</a></li>
                                </ul>
                                <button class="uk-button uk-margin-small uk-position-top-right" uk-icon="icon: close" href=""></button>
                            </div>
                        </div>
                        <div class="uk-navbar-left uk-margin-small">
                            <a href="#offcanvas-slide" class="uk-button uk-button-default uk-button-small" uk-icon="icon: menu" uk-toggle> Menu</a>
                        </div>
                        <div class="uk-navbar-center uk-margin-small uk-visible@m">
                            <ul class="uk-breadcrumb">
                                <li style="cursor: pointer;"><span><strong>{{current_site}}</strong></span>
                                    <div uk-dropdown="mode: hover">
                                        <ul class="uk-nav uk-dropdown-nav">
                                            {% for site in sites %}
                                            {% if site == current_site  %}
                                            <li><a class="uk-disabled" href="#">{{site}}</a></li>
                                            {% else %}
                                            <li><a onclick="changeSite('{{site}}')">{{site}}</a></li>
                                            {% endif %}
                                            {% endfor %}
                                        </ul>
                                    </div>
                                </li>
                                <li style="cursor: default; user-select: none;"><span>Apps</span></li>
                                <li class="uk-disabled"><span>Shopping Lists</span></li>
                            </ul>
                        </div>
                        <div class="uk-navbar-right">
                            <div>
                                <a onclick="toggleDarkMode()" class="uk-button uk-button-small"><span id="modeToggle" class="uk-flex material-symbols-outlined">dark_mode</span></a>
                            </div>
                            <div>
                                <a href="" class="" uk-icon="icon: user" uk-toggle>{{username}}</a>
                            </div>
                        </div>
                    </div>
                </div>
            </nav>
        </div>
        <div class="uk-container">
            <div class="uk-section">
                <div uk-grid>
                    <div class="uk-width-1-2@m">
                        <ul class="uk-iconnav uk-flex-center uk-flex-left@m">
                            <li><a onclick="openAddListModal()" uk-icon="icon: plus">Add List</a></li>
                            <li><a href="#" uk-icon="icon: cloud-download">download</a></li>
                        </ul>
                    </div>
                    <div class="uk-width-1-1 uk-flex uk-flex-center uk-padding-small">
                        <nav aria-label="Pagination">
                            <ul id="paginationElement" class="uk-pagination" uk-margin>
                                <li><a href="#"><span uk-pagination-previous></span></a></li>
                                <li><a href="#">1</a></li>
                                <li class="uk-disabled"><span>…</span></li>
                                <li><a href="#">5</a></li>
                                <li><a href="#">6</a></li>
                                <li class="uk-active"><span aria-current="page">7</span></li>
                                <li><a href="#">8</a></li>
                                <li><a href="#"><span uk-pagination-next></span></a></li>
                            </ul>
                        </nav>
                    </div>
                    <div class="uk-width-1-1">
                        <div id="shopping_list_lists" class="uk-child-width-1-1">
                            <!-- populates through javascript -->
                        </div>
                        <a class="uk-margin" href="" uk-totop uk-scroll></a>
                    </div>
                </div>
            </div>
            <!-- Add Item Modal -->
            <div id="addListModal" uk-modal>
                <div class="uk-modal-dialog uk-modal-body">
                    <h2 class="uk-modal-title">Adding Shopping List...</h2>
                    <div class="uk-margin">
                        <label class="uk-form-label" for="addListName">Name</label>
                        <input id="addListName" class="uk-input" type="text" placeholder="Input" aria-label="Input">
                    </div>
                    <div class="uk-margin">
                        <label class="uk-form-label" for="addListDescription">Description</label>
                        <input id="addListDescription" class="uk-input" type="text" placeholder="Input" aria-label="Input">
                    </div>
                    <div class="uk-margin">
                        <label class="uk-form-label" for="list_type">Type</label>
                        <select id="list_type" class="uk-select" aria-label="Select">
                            <option value="plain">Plain List</option>
                            <option class="uk-disabled" value="hybrid">Hybrid List</option>
                            <option value="partial_calculated">Partial Calculated List</option>
                            <option value="full_calculated">Full Calculated List</option>
                        </select>
                    </div>
                    <button onclick="addList()" class="uk-button uk-button-default uk-flex-right" type="button">Add Item</button>
                </div>
            </div>
        </div>
    </body>
    <script src="{{ url_for('static', filename='handlers/shoppingListsHandler.js') }}"></script>
</html>