/**
 * Notifications - Whisp It
 * Cloche (barre du haut), liste (menu sous la cloche sur PC, tiroir sur mobile) et fenetre d'avertissement.
 * La fenetre reprend la base de la fenetre de regroupement (merge-modal-backdrop / merge-sheet-dialog).
 */

/* ---------- Cloche ---------- */
.ntf-bell {
  position: relative;
  margin-left: auto;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-card, #e2e8f0);
  border-radius: 50%;
  background: var(--bg-card, #ffffff);
  color: var(--text-primary, #0f172a);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color var(--transition-fast, 0.15s);
}

.ntf-bell:hover {
  background: var(--bg-hover, #f1f5f9);
}

.ntf-bell:focus-visible {
  outline: 2px solid #0f172a;
  outline-offset: 2px;
}

.ntf-dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-orange, #ff5e3a);
  box-shadow: 0 0 0 2px var(--bg-card, #ffffff);
  display: none;
}

.ntf-bell.has-unseen .ntf-dot {
  display: block;
}

@media (min-width: 1024px) {
  .top-navbar .navbar-desktop-nav {
    margin-left: auto;
  }

  .ntf-bell {
    margin-left: 6px;
    width: 34px;
    height: 34px;
  }

  .ntf-dot {
    top: 6px;
    right: 7px;
  }
}

/* ---------- Couche et liste ---------- */
.ntf-layer {
  position: fixed;
  inset: 0;
  z-index: 2300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.ntf-layer.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.ntf-panel {
  width: 100%;
  max-height: 80dvh;
  overflow-y: auto;
  background: var(--bg-app, #f4f6f9);
  border-radius: 24px 24px 0 0;
  padding: 16px 14px max(18px, env(safe-area-inset-bottom, 18px));
  box-sizing: border-box;
  transform: translateY(24px);
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

.ntf-layer.active .ntf-panel {
  transform: translateY(0);
}

/* PC : petit menu sous la cloche, sans voile sombre */
.ntf-layer.is-desktop {
  background: transparent;
  display: block;
}

.ntf-layer.is-desktop .ntf-panel {
  position: fixed;
  width: 360px;
  max-height: min(480px, 70vh);
  border: 1px solid var(--border-card, #e2e8f0);
  border-radius: 18px;
  padding: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  transform: translateY(-6px);
}

.ntf-layer.is-desktop.active .ntf-panel {
  transform: translateY(0);
}

.ntf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 10px;
}

.ntf-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary, #0f172a);
}

.ntf-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-card, #e2e8f0);
  border-radius: 50%;
  background: var(--bg-card, #ffffff);
  color: var(--text-secondary, #475569);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.ntf-close:focus-visible,
.ntf-btn:focus-visible {
  outline: 2px solid #0f172a;
  outline-offset: 2px;
}

.ntf-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.ntf-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 14px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-card, #e2e8f0);
  border-radius: 16px;
  min-width: 0;
}

.ntf-item-text {
  flex: 1;
  min-width: 0;
}

.ntf-item-text strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ntf-item-text small {
  display: block;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-secondary, #475569);
}

.ntf-item.is-urgent .ntf-item-text small {
  color: var(--accent-orange, #ff5e3a);
  font-weight: 700;
}

.ntf-empty {
  padding: 26px 12px;
  text-align: center;
}

.ntf-empty strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
}

.ntf-empty small {
  font-size: 12.5px;
  color: var(--text-secondary, #475569);
}

/* ---------- Boutons ---------- */
.ntf-btn {
  height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill, 9999px);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}

.ntf-btn-dark {
  background: var(--btn-primary-bg, #0f172a);
  color: var(--btn-primary-text, #ffffff);
}

.ntf-btn-dark:hover {
  background: var(--btn-primary-hover, #1e293b);
}

.ntf-btn-line {
  height: 46px;
  width: 100%;
  background: var(--bg-card, #ffffff);
  border-color: var(--border-card, #e2e8f0);
  color: var(--text-primary, #0f172a);
}

.ntf-btn-line:hover {
  background: var(--bg-hover, #f1f5f9);
}

/* ---------- Fenetre d'avertissement ---------- */
.ntf-modal .merge-sheet-dialog.ntf-dialog {
  background: var(--bg-app, #f4f6f9);
  border: 0;
  gap: 14px;
}

.ntf-kick {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-orange, #ff5e3a);
}

.ntf-dialog-title {
  margin: 3px 0 4px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text-primary, #0f172a);
}

.ntf-dialog-sum {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary, #475569);
}

.ntf-dialog .ntf-list {
  max-height: 46dvh;
  overflow-y: auto;
}

@media (min-width: 680px) {
  .ntf-modal .merge-sheet-dialog.ntf-dialog {
    max-width: 460px;
  }

  .ntf-dialog-foot {
    display: flex;
    justify-content: flex-end;
  }

  .ntf-dialog-foot .ntf-btn-line {
    width: auto;
    height: 42px;
    padding: 0 22px;
  }
}
