<!DOCTYPE html>
<html lang="en" data-bs-theme="light">
<head>
  <meta charset="utf-8"/>
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  <title>@ViewData["Title"] - FretBadger</title>
  <link rel="preload" href="/css/BravuraText.woff2" as="font" type="font/woff2" crossorigin="anonymous">
  <link rel="stylesheet" href="/css/styles.css" id="theme-stylesheet" asp-append-version="true"/>
  <link rel="stylesheet" href="/css/site.css" asp-append-version="true"/>
  <link rel="stylesheet" href="/css/fretboard.css" asp-append-version="true" id="fretboard-stylesheet"/>
  @if (Environment.GetEnvironmentVariable("UMAMI_URL") is {Length: > 0} umamiUrl && Environment.GetEnvironmentVariable("UMAMI_WEBSITE_ID") is {Length: > 0} umamiWebsiteId)
  {
  <script async src="@umamiUrl" data-website-id="@umamiWebsiteId"></script>
  }
  <script>
  const theme = localStorage.getItem('theme');
  const html = document.querySelector('html');
  if (html) {
    if (theme === 'dark') {
      html.setAttribute('data-bs-theme', 'dark');
    } else if (theme === 'light') {
      html.setAttribute('data-bs-theme', 'light');
    }
  }
  </script>
</head>
<body>
<header>
  <nav class="navbar navbar-expand-sm navbar-toggleable-sm border-bottom box-shadow mb-3" id="main-nav">
    <div class="container">
      <a class="navbar-brand"  asp-controller="Home" asp-action="Index"><div class="nav-logo"></div></a>
      <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
              aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
      </button>
      <div class="navbar-collapse collapse d-sm-inline-flex justify-content-start">
        <div class="dropdown show">
          <button class="btn btn-primary dropdown-toggle mx-2" type="button" id="dropdownFretboards" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
            Fretboards
          </button>
          <div class="dropdown-menu" aria-labelledby="dropdownFretboards">
            @foreach(var t in StandardTunings.Dropdown())
            {
            <a class="dropdown-item" asp-controller="Fretboards" asp-action="Get" asp-route-tuning="@t.Tuning">@t.Group @t.Name</a>
            }
            <a class="dropdown-item" asp-controller="Fretboards" asp-action="Index">More...</a>
          </div>
        </div>

        <div class="dropdown show">
          <button class="btn btn-primary dropdown-toggle mx-2" type="button" id="dropdownScales" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
            Scales
          </button>
          <div class="dropdown-menu" aria-labelledby="dropdownScales">
            @foreach (var scale in Scales.EnumerateScales())
            {
              <a class="dropdown-item" asp-controller="Scales" asp-action="Get" asp-route-id="@scale.Id">@scale.Name</a>
            }
          </div>
        </div>

        <div class="dropdown show">
          <button class="btn btn-primary dropdown-toggle mx-2" type="button" id="dropdownModes" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
            Modes
          </button>
          <div class="dropdown-menu" aria-labelledby="dropdownModes">
            @foreach (var scale in Scales.EnumerateModes())
            {
              <a class="dropdown-item" asp-controller="Scales" asp-action="Get" asp-route-id="@scale.Id">@scale.Name</a>
            }
          </div>
        </div>

        <div class="dropdown show">
          <button class="btn btn-primary dropdown-toggle mx-2" type="button" id="dropdownChords" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
            Chords
          </button>
          <div class="dropdown-menu" aria-labelledby="dropdownChords">
            @foreach (var arpeggio in Arpeggios.All())
            {
              <a class="dropdown-item" asp-controller="ChordExplorer" asp-action="Get" asp-route-id="@arpeggio.Id">@arpeggio.Name</a>
            }
          </div>
        </div>
        
        <div class="dropdown show">
          <button class="btn btn-primary dropdown-toggle mx-2" type="button" id="dropdownKeys" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
            Keys
          </button>
          <div class="dropdown-menu" aria-labelledby="dropdownKeys" style="min-width: 240px">
            <div class="row">
              <div class="col-6">
                @foreach (var note in KeyRoots.Major)
                {
                  <a class="note dropdown-item" asp-controller="Key" asp-action="Detail" asp-route-tone="major" asp-route-noteStr="@note.Text">@note.Display Major</a>
                }
              </div>
              <div class="col-6">
                @foreach (var note in KeyRoots.Minor)
                {
                  <a class="note dropdown-item" asp-controller="Key" asp-action="Detail" asp-route-tone="minor" asp-route-noteStr="@note.Text">@note.Display Minor</a>
                }
              </div>
            </div>
          </div>
        </div>
        
        <div class="dropdown show">
          <button class="btn btn-primary dropdown-toggle mx-2" type="button" id="dropdownBuilder" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
            Builder
          </button>
          <div class="dropdown-menu" aria-labelledby="dropdownBuilder">
            <a class="dropdown-item" asp-controller="Builder" asp-action="Scales">Scales</a>
            <a class="dropdown-item" asp-controller="Builder" asp-action="Arpeggios">Arpeggios</a>
          </div>
        </div>

      </div>
      <ul class="navbar-nav flex-row flex-wrap ms-md-auto">
        <li class="nav-item">
          <a href="#" id="theme-light-link" class="nav-link btn btn-outline-light d-none" title="Switch theme">
            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-sun-fill" viewBox="0 0 16 16">
              <path d="M8 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z"/>
            </svg>
          </a>
          <a href="#" id="theme-dark-link" class="nav-link btn btn-outline-dark d-none" title="Switch theme">
            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-moon-stars-fill" viewBox="0 0 16 16">
              <path d="M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278z"/>
              <path d="M10.794 3.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387a1.734 1.734 0 0 0-1.097 1.097l-.387 1.162a.217.217 0 0 1-.412 0l-.387-1.162A1.734 1.734 0 0 0 9.31 6.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387a1.734 1.734 0 0 0 1.097-1.097l.387-1.162zM13.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.156 1.156 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.156 1.156 0 0 0-.732-.732l-.774-.258a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732L13.863.1z"/>
            </svg>
          </a>
        </li>
        <li class="nav-item">
          <a class="btn btn-primary mx-2" asp-controller="Home" asp-action="Feedback">Feedback</a>
        </li>
      </ul>
    </div>
  </nav>
</header>
<div class="container">
  <main role="main" class="pb-3">
    @RenderBody()
  </main>
</div>

<footer class="border-top footer text-muted">
  <div class="container">
    &copy; 2023 - <a href="https://twitter.com/markrendle" target="_blank">Mark Rendle</a>
    - FretBadger logo by <a href="https://www.fiverr.com/ingeniousarts" target="_blank">Moon</a>
    - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
  </div>
</footer>
<script src="~/lib/jquery/dist/jquery.min.js" asp-append-version="true"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js" asp-append-version="true"></script>
<script src="~/js/site.js" asp-append-version="true"></script>
@await RenderSectionAsync("Scripts", required: false)
</body>
</html>