/* ============================================================
   notifications-ui.css — la cloche du professeur (04/10/2026)
   Chargé APRÈS styles.css : `#notif-dropdown.nc-panel` reprend la main sur
   l'ancien `.notif-dropdown` (360 px, 480 px de haut) sans le modifier.
   Couleurs : encres ≥ 4,5:1 sur leur fond (vérifiées une à une).
   ============================================================ */

#notif-dropdown.nc-panel {
  width: 430px;
  max-height: min(680px, calc(100vh - 90px));
  padding: 0;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .18), 0 2px 6px rgba(15, 23, 42, .06);
  background: #fff;
  color: #1f2937;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-top: 8px;
  text-align: left;
}

.nc-chargement { padding: 28px; text-align: center; color: #6b7280; }

/* --- tête --- */
.nc-tete { display: flex; align-items: center; gap: 8px; padding: 14px 16px 10px; flex-shrink: 0; }
.nc-tete h4 { margin: 0; font-size: 17px; font-weight: 700; color: #111827; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nc-lien { white-space: nowrap; font-size: 13px; font-weight: 600; color: #1d4ed8; background: none; border: 0; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.nc-lien:hover { background: #eff6ff; }
.nc-ibtn { width: 32px; height: 32px; border-radius: 9px; border: 1px solid #e5e7eb; background: #fff; display: grid; place-items: center; font-size: 15px; cursor: pointer; color: #4b5563; flex-shrink: 0; }
.nc-ibtn:hover { background: #f9fafb; }
.nc-fermer { display: none; }

/* --- résumé du jour --- */
.nc-resume { margin: 0 16px 10px; padding: 9px 12px; border-radius: 12px; background: linear-gradient(135deg, #f0fdfa, #ecfeff); border: 1px solid #ccfbf1; font-size: 13px; color: #374151; display: flex; gap: 14px; flex-wrap: wrap; flex-shrink: 0; }
.nc-resume b { font-size: 16px; color: #0f766e; margin-right: 3px; }
.nc-resume .nc-resume-alerte b { color: #b91c1c; }

/* --- filtres --- */
.nc-chips { display: flex; gap: 6px; padding: 0 16px 10px; flex-wrap: wrap; flex-shrink: 0; }
.nc-chip { font-size: 13px; padding: 4px 11px; border-radius: 999px; border: 1px solid #e5e7eb; color: #374151; background: #fff; cursor: pointer; white-space: nowrap; }
.nc-chip:hover { background: #f9fafb; }
.nc-chip--act, .nc-chip--act:hover { background: #1f2937; color: #fff; border-color: #1f2937; }
.nc-chip i { font-style: normal; opacity: .75; margin-left: 4px; }

/* --- liste --- */
.nc-liste { flex: 1 1 auto; min-height: 0; overflow-y: auto; border-top: 1px solid #e5e7eb; overscroll-behavior: contain; }
.nc-jour { position: sticky; top: 0; z-index: 1; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #4b5563; padding: 8px 16px 6px; background: #f9fafb; border-bottom: 1px solid #f1f5f9; }
.nc-vide { padding: 36px 16px; text-align: center; color: #6b7280; font-size: 14px; }
.nc-vide-ico { font-size: 30px; margin-bottom: 6px; }

.nc-it { display: flex; gap: 11px; padding: 11px 16px; border-bottom: 1px solid #f1f5f9; position: relative; cursor: pointer; background: #fff; transition: background .12s; }
.nc-it:hover, .nc-it:focus-visible { background: #f8fafc; outline: none; }
.nc-it--nonlu { background: #eff6ff; }
.nc-it--nonlu:hover { background: #dbeafe; }
.nc-it--nonlu::before { content: ""; position: absolute; left: 5px; top: 24px; width: 6px; height: 6px; border-radius: 50%; background: #2563eb; }

.nc-av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; flex-shrink: 0; position: relative; background: var(--nc-av, #64748b); }
.nc-av--eleves { background: #e0f2fe; }
.nc-av--gestion { background: #fef3c7; }
.nc-av-ico { font-size: 18px; line-height: 1; }
.nc-av-type { position: absolute; right: -4px; bottom: -4px; width: 19px; height: 19px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 11px; box-shadow: 0 0 0 1px #e5e7eb; }
.nc-av--petit { width: 32px; height: 32px; }

.nc-c { flex: 1; min-width: 0; }
.nc-ti { font-size: 14px; font-weight: 600; line-height: 1.25; color: #111827; padding-right: 64px; }
.nc-bo { font-size: 13px; color: #4b5563; margin-top: 2px; line-height: 1.35; overflow-wrap: anywhere; }
.nc-meta { display: flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 12px; color: #6b7280; flex-wrap: wrap; }

.nc-tag { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: #f1f5f9; color: #475569; }
.nc-tag--eleves { background: #e0f2fe; color: #075985; }
.nc-tag--gestion { background: #fef3c7; color: #92400e; }
.nc-tag--pass { background: #f3e8ff; color: #6b21a8; }

.nc-score { flex-shrink: 0; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.nc-score--r { background: #fee2e2; color: #b91c1c; }
.nc-score--o { background: #ffedd5; color: #9a3412; }
.nc-score--v { background: #dcfce7; color: #166534; }

.nc-grp { list-style: none; margin: 7px 0 0; padding: 0 0 0 9px; border-left: 2px solid #e9d5ff; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; font-size: 12.5px; color: #4b5563; }
.nc-grp li { min-width: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.nc-grp-lib { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* actions : au survol sur ordinateur, toujours visibles au toucher */
.nc-acts { position: absolute; top: 9px; right: 12px; display: flex; gap: 4px; opacity: 0; transition: opacity .12s; }
.nc-it:hover .nc-acts, .nc-it:focus-within .nc-acts { opacity: 1; }
.nc-mini { width: 28px; height: 28px; border-radius: 8px; border: 1px solid #e5e7eb; background: #fff; display: grid; place-items: center; font-size: 13px; color: #4b5563; cursor: pointer; }
.nc-mini:hover { background: #f3f4f6; color: #111827; }
/* au toucher, pas de survol : les boutons prennent leur colonne à droite */
@media (hover: none) {
  .nc-acts { position: static; opacity: 1; flex-direction: column; align-self: center; }
  .nc-ti, .nc-it .nc-ti { padding-right: 0; }
}

/* --- pied --- */
.nc-pied { padding: 10px 16px; border-top: 1px solid #e5e7eb; background: #fafafa; flex-shrink: 0; }
.nc-btn { width: 100%; background: #1f2937; color: #fff; border: 0; border-radius: 10px; padding: 9px; font-weight: 600; font-size: 14px; cursor: pointer; }
.nc-btn:hover { background: #111827; }

/* --- téléphone : plein écran --- */
@media (max-width: 640px) {
  #notif-dropdown.nc-panel {
    position: fixed; inset: 0; width: auto; max-height: none; height: 100%; height: 100dvh;
    margin: 0; border-radius: 0; border: 0; z-index: 10000;
    padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
  }
  .nc-fermer { display: grid; }
  .nc-long { display: none; }
  .nc-tete { padding: 14px 16px 12px; border-bottom: 1px solid #e5e7eb; }
  .nc-tete h4 { font-size: 19px; }
  .nc-resume { margin-top: 12px; }
  .nc-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .nc-it { padding: 13px 16px; }
  html.nc-ouvert, html.nc-ouvert body { overflow: hidden; }
}

/* --- alertes en temps réel --- */
#nc-alertes { position: fixed; left: 20px; bottom: 20px; z-index: 10001; display: flex; flex-direction: column; gap: 8px; width: 350px; max-width: calc(100vw - 32px); pointer-events: none; }
.nc-alerte { pointer-events: auto; background: #fff; border-radius: 14px; border: 1px solid #e5e7eb; box-shadow: 0 10px 30px rgba(15, 23, 42, .16); padding: 11px 12px; display: flex; gap: 10px; align-items: flex-start; cursor: pointer; animation: nc-entree .25s ease-out; }
.nc-alerte .nc-ti { padding-right: 0; font-size: 13.5px; }
.nc-alerte--sort { opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; }
.nc-alerte-x { background: none; border: 0; color: #6b7280; cursor: pointer; font-size: 14px; padding: 2px 4px; border-radius: 6px; }
.nc-alerte-x:hover { background: #f3f4f6; color: #111827; }
.nc-alerte-barre { height: 3px; border-radius: 3px; background: #e5e7eb; margin-top: 7px; overflow: hidden; }
.nc-alerte-barre i { display: block; height: 100%; background: #0d9488; transform-origin: left; transform: scaleX(1); }
@keyframes nc-entree { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) {
  #nc-alertes { left: 12px; right: 12px; width: auto; bottom: calc(12px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .nc-alerte { animation: none; }
  .nc-alerte-barre i { transition: none !important; }
}
