{{showFile "templates/section/head.tmpl"}}
<body class="bg-[#0b0d12] text-white font-sans min-h-screen">
  <div class="max-w-5xl mx-auto px-6 py-10">

    <div class="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-10">
      <div>
        <h1 class="text-3xl md:text-4xl font-bold tracking-tight text-white">
          Lista notițelor
        </h1>
        <p class="text-gray-400 mt-2 text-sm md:text-base">
          Explorează folderele și deschide sau editează notițele.
        </p>
      </div>

      <a href="/index.html"
        class="inline-flex items-center justify-center rounded-xl border border-[#313846] bg-[#171b22] px-4 py-3 text-sm font-semibold text-gray-200 transition hover:bg-[#20252f] hover:text-white">
        Notă nouă
      </a>
    </div>

    <div class="rounded-2xl border border-[#262c36] bg-[#11151b] p-6 md:p-8 shadow-2xl">
      {{template "folder" .}}
    </div>
  </div>

</body>
</html>


{{define "folder"}}
<div class="ml-0 md:ml-4 mb-6">

  <div class="rounded-2xl border border-[#2a3140] bg-[#151922] overflow-hidden shadow-lg">
    <div class="px-5 py-4 border-b border-[#252b37] bg-[#181d27]">
      <h2 class="text-lg md:text-xl font-bold text-[#b899ff] break-words flex items-center gap-2">
        📁 {{.Nume}}
      </h2>
    </div>

    <div class="p-4 md:p-5">

      {{if .Fisiere}}
      <div class="space-y-3 mb-4">
        {{range .Fisiere}}

        <div
          class="flex items-center justify-between rounded-xl border border-[#323949] bg-[#1a1f29] px-4 py-3 transition hover:border-[#7b58ad] hover:bg-[#202634]">

          <a href="/notes/?note={{.Path}}"
            class="flex items-center gap-3 text-gray-200 hover:text-white font-medium">
            📄 {{.Nume}}
          </a>

          <a href="/edit/?note={{.Path}}"
            class="text-xs px-3 py-1 rounded-lg bg-[#2a2f3a] text-gray-300 hover:bg-[#7b58ad] hover:text-white transition">
            Edit
          </a>

        </div>

        {{end}}
      </div>
      {{end}}

      {{if .Subfoldere}}
      <div class="mt-4 space-y-4 border-l border-[#2b3140] pl-4">
        {{range .Subfoldere}}
          {{template "folder" .}}
        {{end}}
      </div>
      {{end}}

    </div>
  </div>

  
</div>
{{end}}
{{range $val:= (genSeriesInt 50 10) }}
  {{$val}},
  {{end}}