/* public/css/app-nav.css — gedeelde navigatiebalk (zie public/js/app-nav.js)
   Los van app.css en style.css, zodat de balk op elke pagina gelijk is. */

#app-nav {
  --an-bg: #131c36;
  --an-bg-sub: #172344;
  --an-rand: #2a3b60;
  --an-tekst: #e8ecf5;
  --an-tekst-2: #c3cbe0;
  --an-coral: #ff6b5a;
  --an-coral-licht: #ff8a7c;
  --an-groen: #7fd1a8;
  position: sticky;
  top: 0;
  z-index: 900;
  font-family: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  min-height: calc(68px + env(safe-area-inset-top, 0px));
}

#app-nav *, .an-tabbalk * { box-sizing: border-box; }

.an-balk {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 68px;
  padding: env(safe-area-inset-top, 0px) max(28px, env(safe-area-inset-right, 0px)) 0 max(28px, env(safe-area-inset-left, 0px));
  background: var(--an-bg);
  border-bottom: 1px solid var(--an-rand);
}

.an-logo {
  font-weight: 700;
  font-style: italic;
  font-size: 26px;
  letter-spacing: -0.5px;
  color: var(--an-coral);
  text-decoration: none;
  margin-right: 28px;
}

.an-items { display: flex; align-items: center; gap: 4px; }

.an-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  color: var(--an-tekst-2);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.an-item:hover { background: rgba(255,255,255,.05); color: var(--an-tekst); }
.an-item.an-actief { background: rgba(255,107,90,.14); color: var(--an-coral-licht); }

.an-rechts { margin-left: auto; display: flex; align-items: center; gap: 20px; }

.an-naam {
  color: var(--an-groen);
  font-weight: 500;
  font-size: 16px;
  text-decoration: none;
  padding: 10px 0;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.an-naam:hover { text-decoration: underline; }

.an-uitloggen, .an-inloggen {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid var(--an-coral);
  background: transparent;
  color: var(--an-coral-licht);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.an-uitloggen svg { display: none; }
.an-uitloggen:hover, .an-inloggen:hover { background: rgba(255,107,90,.1); }

/* ── Subbalk ─────────────────────────────────────────── */

.an-sub {
  display: flex;
  align-items: center;
  gap: 4px 12px;
  flex-wrap: wrap;
  min-height: 52px;
  padding: 0 max(28px, env(safe-area-inset-right, 0px)) 0 max(28px, env(safe-area-inset-left, 0px));
  background: var(--an-bg-sub);
  border-bottom: 1px solid var(--an-rand);
}

.an-sub-links { display: flex; align-items: center; gap: 4px; }

.an-sublink {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  color: var(--an-tekst-2);
  text-decoration: none;
  font-size: 15px;
  border-bottom: 2px solid transparent;
}
.an-sublink:hover { color: var(--an-tekst); }
.an-sublink.an-actief { color: #ffffff; font-weight: 500; border-bottom-color: var(--an-coral); }

.an-sub-rechts { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.an-sub-rechts:empty { display: none; }

.an-toernooi-kop { display: flex; align-items: center; min-height: 44px; }

.an-terug {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--an-tekst-2);
  text-decoration: none;
  font-size: 15px;
}
.an-terug:hover { color: var(--an-tekst); }

.an-scheiding { width: 1px; height: 22px; background: var(--an-rand); margin: 0 12px; }
.an-toernooinaam { font-weight: 700; font-size: 15px; color: var(--an-tekst); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }

/* ── Tabbalk (alleen telefoon) ───────────────────────── */

.an-tabbalk { display: none; }

@media (max-width: 720px) {
  #app-nav { min-height: calc(56px + env(safe-area-inset-top, 0px)); }

  .an-balk { min-height: 56px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); gap: 12px; }
  .an-logo { font-size: 22px; margin-right: 0; }
  .an-items { display: none; }
  .an-rechts { gap: 8px; }
  .an-naam { font-size: 15px; max-width: 140px; }
  .an-uitloggen { width: 44px; padding: 0; justify-content: center; border-color: var(--an-rand); color: var(--an-tekst-2); }
  .an-uitloggen span { display: none; }
  .an-uitloggen svg { display: block; }
  .an-inloggen { min-height: 40px; padding: 0 14px; }

  .an-sub { padding: 0 0 8px; display: block; min-height: 0; }
  .an-sub-links { overflow-x: auto; padding: 0 12px; gap: 6px; scrollbar-width: none; }
  .an-sub-links::-webkit-scrollbar { display: none; }
  .an-sublink {
    flex-shrink: 0;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--an-rand);
    border-radius: 999px;
    font-size: 14px;
    margin-top: 8px;
  }
  .an-sublink.an-actief { background: var(--an-coral); border-color: var(--an-coral); color: #0f172e; font-weight: 700; }
  .an-toernooi-kop { padding: 0 16px; }
  .an-toernooi-kop .an-terug span, .an-toernooi-kop .an-scheiding { display: none; }
  .an-toernooi-kop .an-terug { min-width: 44px; margin-left: -12px; justify-content: center; }
  .an-toernooinaam { max-width: none; }
  .an-sub-rechts { padding: 8px 16px 0; justify-content: flex-start; }

  .an-tabbalk {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    /* Bewust zonder safe-area onderin: zo staat de balk op elke pagina
       gelijk, ook op Spelen (die pagina heeft viewport-fit=cover). */
    min-height: 64px;
    background: #131c36;
    border-top: 1px solid #2a3b60;
    font-family: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  }
  .an-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #c3cbe0;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
  }
  .an-tab svg { width: 22px; height: 22px; }
  .an-tab.an-actief { color: #ff8a7c; font-weight: 700; }

  body.an-heeft-tabbalk { padding-bottom: 72px; }
}
