.nav-lernbereiche {
  display: flex;
  align-items: center;
  justify-content: center;
  /* Zentriert den Inhalt */
  background-color: var(--hauptfarbe);
  padding: 0.5rem 1rem;
  position: relative;
  z-index: 2000;
}

.logo {
  margin: 0 auto;
  text-align: center;
  font-weight: bold;
  color: white;
  font-size: 2rem;
  position: relative;
  left: 0;
  right: 0;
}

.hamburger {
  position: absolute;
  left: 1rem;
  background: none;
  border: 1px solid #ffffff;
  border-radius: 5px;
  font-size: 1.5rem;
  cursor: pointer;
  color: white;
}

.hamburger:hover {
  background: #cfcfcf6a;
}

#account {
  font-size: 1.5rem;
  cursor: pointer;
  color: white;
  background: none;
  border: 0px solid #ffffff;
  border-radius: 5px;
}

#account:hover {
  background: #cfcfcf6a;
}

#account-status-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid white;
  /* optischer Rand */
  background-color: gray;
  /* Standard (neutral) */
}

#account.logged-in #account-status-indicator {
  background-color: #2ecc71;
  /* Grün für eingeloggt */
}

#account.logged-out #account-status-indicator {
  background-color: #e74c3c;
  /* Rot für ausgeloggt */
}

#firebaseui-auth-container button {

  color: white;
  background: var(--hauptfarbe);

  border-radius: 5px;

}


.nav-lernbereiche .menu {
  position: absolute;
  top: 100%;
  left: 20px;
  margin-right: 20px;
  background: #ffffff;
  list-style: none;
  padding: 0.5rem 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: 1px solid #ccc;
  border-radius: 12px;
  max-height: 80vh;
  overflow-y: auto;
  scrollbar-width: thin
}

.menu li {
  margin: 0.5rem 0;
}

.menu li a {
  display: block;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--hauptfarbe);
  border-radius: 12px;
}

.hidden {
  display: none;
}

.trennlinie {
  border: none;
  border-top: 2px dashed #999;
  margin: 0.3em 0;
}

.stochastik a {
  background-color: #fff9c4;
  /* helles Gelb */
  color: #806000;
  /* dunkleres Gelb/Gold */
}

.stochastik a:hover {
  background-color: #fff59d;
  /* etwas intensiveres Gelb beim Hover */
}

.analysis a {
  background-color: #e6ffe0;
  color: #2b7a0b;
}

.analysis a:hover {
  background-color: #c7f5bf;
}

.lineare-algebra a {
  background-color: #fbe0ff;
  color: #800080;
}

.lineare-algebra a:hover {
  background-color: #f3c2ff;
}

.zusatzmaterial a {
  background-color: #ececec;
  color: #585858;
}

.zusatzmaterial a:hover {
  background-color: #e0e0e0;
}

.nav-materialtyp {
  width: 100%;
  display: flex;
  justify-content: center;
  border: none;
  border-bottom: 2px solid #ccc;
  margin: 0 auto;
  box-shadow: none;
  border-radius: 0;
  font-size: 1rem;
}

.nav-materialtyp ul {
  display: flex;
  list-style: none;
  padding: 0;
  margin-top: 0;
  margin-bottom: 0rem;
  gap: 0rem;
  align-items: center;
}

.nav-materialtyp a.nav-link {
  text-decoration: none;
  color: #333;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  transition: background-color 0.1s ease, color 0.1s ease;
  color: var(--hauptfarbe-hover);
  /*background-color: var(--hintergrund-hell);*/
}

.nav-materialtyp a.nav-link:hover {
  background-color: var(--hintergrund-hell);
}

.nav-materialtyp a.ausgewählt {
  background-color: var(--hintergrund-hell-hover);
}

/* Standard: Text sichtbar */
.nav-text {
  display: inline;
}

/* Bei kleiner Bildschirmbreite: Text ausblenden */
@media (max-width: 490px) {
  .nav-text {
    display: none;
  }
}

.nav-toc {
  position: sticky;
  top: 130px;
  z-index: 500;
  background: var(--hintergrundfarbe);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid #ccc;
  justify-content: center;
}

.scroll-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 0.5rem;
  user-select: none;
  flex-shrink: 0;
  color: #666;
}

.scroll-btn:hover {
  color: #000;
}

#toc {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding: 0.5rem 1rem;
  list-style: none;
  scrollbar-width: none;
  white-space: nowrap;
}

#toc ul,
#toc li {
  all: unset;
  display: contents;
  /* trennt die Struktur, aber behält die Links */
}

#toc a {
  text-decoration: none;
  color: var(--hauptfarbe);
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: background-color 0.3s, color 0.3s;
  white-space: nowrap;
}

#toc a:hover {
  background-color: var(--hintergrund-hell);
}

#toc a.aktiver-link {
  background-color: var(--hintergrund-hell-hover);
}

#toc::-webkit-scrollbar {
  display: none;
}


.nav-lernbereiche .menu {
  max-height: 80vh;
  overflow-y: auto;
  scrollbar-width: thin;
}

/* Optional: Stil für den Scrollbalken (nur für WebKit-basierte Browser) */
.nav-lernbereiche .menu::-webkit-scrollbar {
  width: 8px;
}

.nav-lernbereiche .menu::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

.nav-lernbereiche .menu::-webkit-scrollbar-track {
  background-color: transparent;
}