/* In-App-Benachrichtigungszentrale (Glocke neben Burger-Icon). */

.muveup-notif {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.muveup-notif__btn {
  background: transparent;
  border: 0;
  padding: 6px;
  margin: 0;
  cursor: pointer;
  color: #815da7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  transition: background-color 0.15s ease;
}
.muveup-notif__btn:hover,
.muveup-notif__btn:focus-visible {
  background: rgba(129, 93, 167, 0.1);
  outline: none;
}
.muveup-notif__btn svg {
  width: 24px;
  height: 24px;
  display: block;
}

.muveup-notif__badge {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #e38722;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 0 0 2px #ffffff;
}
.muveup-notif__badge[hidden] {
  display: none;
}

.muveup-notif__panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(380px, calc(100vw - 24px));
  max-height: min(70vh, 560px);
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 2101;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.muveup-notif__panel.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.muveup-notif__backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: transparent;
  pointer-events: none;
  visibility: hidden;
}
.muveup-notif__backdrop.is-open {
  pointer-events: auto;
  visibility: visible;
}

.muveup-notif.is-panel-open {
  z-index: 2102;
  position: relative;
}

body.muveup-notif-open header {
  position: fixed;
  z-index: 2102;
}

body.muveup-notif-open .muveup-notif__panel {
  z-index: 2101;
}

body.muveup-notif-open .muveup-notif__backdrop {
  z-index: 2000;
}

.muveup-notif__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid #f0eef5;
}
.muveup-notif__title {
  font-size: 16px;
  font-weight: 600;
  color: #815da7;
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}
.muveup-notif__header-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, max-content));
  gap: 6px;
  justify-content: end;
  align-items: center;
  width: 100%;
  min-width: 0;
}
.muveup-notif__mark-all,
.muveup-notif__clear-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 5px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.muveup-notif__btn-icon {
  font-size: 12px;
  line-height: 1;
}
.muveup-notif__btn-label {
  line-height: 1;
}
.muveup-notif__mark-all {
  color: #e38722;
}
.muveup-notif__mark-all:hover {
  background: rgba(227, 135, 34, 0.1);
}
.muveup-notif__clear-all {
  color: #888888;
}
.muveup-notif__clear-all:hover {
  background: rgba(136, 136, 136, 0.12);
}
.muveup-notif__mark-all[disabled],
.muveup-notif__clear-all[disabled] {
  color: #c0c0c0;
  cursor: default;
  background: transparent;
}

.muveup-notif__list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1 1 auto;
}

.muveup-notif__empty,
.muveup-notif__loading {
  padding: 30px 16px;
  text-align: center;
  color: #999999;
  font-size: 14px;
  line-height: 1.5;
}

.muveup-notif__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  border-bottom: 1px solid #f5f3f9;
  cursor: pointer;
  background: transparent;
  border-left: 3px solid transparent;
  transition: background-color 0.15s ease;
  text-decoration: none;
  color: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .muveup-notif__item:hover {
    background: #faf8ff;
  }
}
.muveup-notif__item.is-unread {
  background: #f7f3ff;
  border-left-color: #815da7;
}
.muveup-notif__item:last-child {
  border-bottom: 0;
}

.muveup-notif__item-profile {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #815da7;
  line-height: 1.3;
  margin-bottom: 4px;
}

.muveup-notif__item-title {
  font-size: 14px;
  font-weight: 600;
  color: #333333;
  line-height: 1.3;
}
.muveup-notif__item-body {
  font-size: 13px;
  color: #666666;
  line-height: 1.4;
  word-break: break-word;
}
.muveup-notif__item-meta {
  font-size: 11px;
  color: #999999;
  margin-top: 2px;
}

.muveup-notif__footer {
  padding: 8px 16px;
  border-top: 1px solid #f0eef5;
  background: #fafafa;
  text-align: center;
  font-size: 11px;
  color: #a0a0a0;
}

/* Mobile: Panel klappt von oben unter dem Header ein */
@media (max-width: 900px) {
  /* Master-Layout: Burger ist mobil absolut (right:15px, Breite 30px → Burger-Innenkante bei right:45px).
     Glocke daneben absolut platzieren; right:65px ergibt einheitliche 20px Lücke zum Burger.
     z-index bewusst < 1000, damit das Slide-Panel (.top-nav, z-index 1000) die Glocke verdeckt, sobald es geöffnet ist.
     Wichtig: KEIN transform setzen — sonst erzeugt der Wrapper einen Containing Block
     und das innere Panel mit position:fixed verhält sich wie position:absolute relativ
     zum ~40px breiten Wrapper (Folge: super schmaler Panel-Streifen auf iOS Safari). */
  /* Auch ohne (noch) gesetztes data-bottom-nav greifen, damit die frisch
     injizierte Glocke nie kurz im normalen Fluss landet (sonst: Kopfzeile
     wird hoeher + Glocke ueberlappt den Burger, bis das Attribut nach dem
     Auth-Check von "public" auf die Rolle wechselt – z. B. profile-artists). */
  header .muveup-notif,
  body[data-bottom-nav="master"] .muveup-notif,
  body[data-bottom-nav="artist"] .muveup-notif,
  body[data-bottom-nav="organizer"] .muveup-notif {
    position: absolute;
    right: 65px;
    top: 0;
    bottom: 0;
    display: inline-flex;
    align-items: center;
    z-index: 1;
  }
  /* Wenn das Benachrichtigungs-Panel offen ist: Wrapper-Stacking-Context
     ueber Floating-Search-Bar (z-index 1080) und Category-Toolbar (1079) heben,
     damit das Panel z. B. auf search-master und map sichtbar bleibt.
     Im Normalzustand bleibt z-index 1, sodass das Slide-Panel (.top-nav, 1000)
     die Glocke wie bisher ueberdeckt. */
  body[data-bottom-nav="master"].muveup-notif-open .muveup-notif,
  body[data-bottom-nav="artist"].muveup-notif-open .muveup-notif,
  body[data-bottom-nav="organizer"].muveup-notif-open .muveup-notif {
    z-index: 2102;
  }

  /* Hintergrund nicht scrollen, solange Benachrichtigungszentrale offen ist */
  html:has(body.muveup-notif-open),
  body.muveup-notif-open {
    overflow: hidden;
    overscroll-behavior: none;
  }
  body.muveup-notif-open main,
  body.muveup-notif-open .main-container,
  body.muveup-notif-open [data-muveup-app-content] {
    overflow: hidden;
  }
}

@media (max-width: 700px) {
  .muveup-notif__panel {
    position: fixed;
    top: calc(var(--muveup-chrome-top, 56px) + 6px);
    right: 12px;
    left: 12px;
    bottom: auto;
    width: auto;
    max-height: min(
      calc(100vh * 2 / 3),
      calc(100vh - var(--muveup-chrome-top, 56px) - 24px)
    );
    transform: translateY(-8px);
  }
  .muveup-notif__panel.is-open {
    transform: translateY(0);
  }
  .muveup-notif__header {
    gap: 8px;
  }
  .muveup-notif__header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    justify-content: stretch;
  }
  .muveup-notif__mark-all,
  .muveup-notif__clear-all {
    width: 100%;
    min-height: 32px;
    text-align: center;
  }
}

/* Header-Wrapper für Layouts ohne .header-icons (Glocke + Burger nebeneinander).
   20px = einheitlicher Abstand Glocke ↔ Burger über alle Seitentypen/Viewports. */
.muveup-notif--wrap {
  display: inline-flex;
  align-items: center;
  gap: 20px;
}

@media (min-width: 901px) {
  header > .muveup-header-actions > .muveup-notif--wrap {
    gap: 0;
    justify-content: center;
  }
}
