/* =========================================================================
 * notifications.css — Notifications obligatoires par enfant (3.21)
 *  badges des cartes de profil, récapitulatif du code, boîte de l'enfant, alerte « bloquées », aide, onglet parent
 * ========================================================================= */

/* ---- Carte de profil : badges visibles AVANT le code (compteurs seulement) ---- */
.profile-card { position: relative; }
.notif-count {
  position: absolute; top: -12px; right: -10px; min-width: 40px; height: 40px; padding: 0 10px; border-radius: 999px;
  display: grid; place-items: center; background: var(--danger); color: #fff; font-weight: 700; font-size: 1.2rem;
  border: 4px solid #fff; box-shadow: 0 3px 0 rgba(0, 0, 0, .15); animation: nbPop .4s ease-out;
}
.notif-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 0 8px; }
.nbadge {
  display: inline-flex; align-items: center; gap: 3px; padding: 3px 9px; border-radius: 999px; font-size: 1rem;
  background: color-mix(in srgb, var(--c, var(--primary)) 14%, white); border: 2px solid color-mix(in srgb, var(--c, var(--primary)) 40%, white);
}
.nbadge b { font-size: .95rem; }
@keyframes nbPop { from { transform: scale(.4); } 70% { transform: scale(1.15); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .notif-count { animation: none; } }

/* ---- Écran du code : récapitulatif ---- */
.pin-recap {
  margin: 4px auto 8px; max-width: 420px; padding: 10px 16px; border-radius: 16px; text-align: center;
  background: #fff6d6; color: var(--ink); font-weight: 600; line-height: 1.35;
}
.pin-recap small { font-weight: 400; color: var(--muted); }

/* ---- Cloche du tableau de bord enfant ---- */
.kid-bell { position: relative; font-size: 1.5rem; }
.kid-bell .hw-count { top: -10px; right: -10px; min-width: 28px; height: 28px; font-size: .95rem; }

/* ---- Alerte : notifications bloquées sur cette tablette ---- */
.notif-blocked {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 12px auto; max-width: 900px;
  padding: 12px 16px; border-radius: 16px; background: #fff1e6; border: 3px solid var(--orange); color: var(--ink);
}
.notif-blocked p { margin: 0; flex: 1 1 240px; }
.notif-blocked .nb-icon { font-size: 1.8rem; }

/* ---- Boîte de notifications ---- */
.notif-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 8px 0; }
.notif-toolbar p { margin: 0; font-size: 1.15rem; }
.notif-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.notif-item {
  width: 100%; display: flex; align-items: flex-start; gap: 12px; text-align: left; font: inherit; color: var(--ink);
  background: var(--card); border: 3px solid var(--line); border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow); cursor: pointer;
}
.notif-list.parent .notif-item { cursor: default; }
.notif-item.unread { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, white); }
.ni-emoji { font-size: 1.8rem; line-height: 1; }
.ni-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ni-body b { font-size: 1.1rem; }
.ni-body small { color: var(--muted); }
.ni-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--danger); flex: none; margin-top: 6px; }
.nt-points_gain.unread, .nt-recompense.unread { border-color: var(--ok); }
.nt-points_perte.unread { border-color: var(--yellow); }  /* ton neutre : jamais de rouge pour une perte de points */
.nt-correction.unread { border-color: var(--orange); }
.nd.ok { color: #15803d; }
.nd.ko { color: #b45309; }
.nd.wait { color: var(--muted); }
.notif-filter { margin: 10px 0 14px; }
.notif-filter .chip.on { background: var(--primary); color: #fff; }

/* ---- Aide ---- */
.notif-help { max-width: 760px; margin: 0 auto; padding: 0 16px 32px; }
.notif-help ol { padding-left: 1.3em; line-height: 1.5; }
.notif-help .card { margin: 12px 0; }
.nh-state { font-weight: 700; font-size: 1.1rem; }

@media (max-width: 520px) {
  .notif-count { min-width: 32px; height: 32px; font-size: 1rem; top: -8px; right: -6px; }
  .nbadge { font-size: .85rem; padding: 2px 7px; }
}
