/* ════════════════════════════════════════════════════════════════════════
   Liseuse v2 — annotations.css : compléments du module surlignage/annotations
   ─────────────────────────────────────────────────────────────────────────
   NE redéfinit PAS les classes de base de v2.css (.selection-toolbar,
   .tools-rail, .hl-dot, .panel, .iconbtn) : uniquement les éléments propres
   au module (pastille couleur active de la toolbar, items du panneau, section
   partagée, barre de confirmation, états vide/erreur). Tokens :root exclusifs.
   ════════════════════════════════════════════════════════════════════════ */

/* ─────────────────── A) toolbar de sélection : pastille couleur ─────── */
/* Le bouton « Surligner » porte une pastille de la couleur active, pour que
   l'utilisateur sache dans quelle couleur il va surligner (sans dupliquer le rail). */
.selection-toolbar .seltb__hl { position: relative; }
.selection-toolbar .seltb__hl::after {
  content: ''; position: absolute; right: 5px; bottom: 5px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--hl, var(--hl-yellow));
  box-shadow: 0 0 0 1.5px var(--glass-3);
}

/* ─────────────────────────── C) panneau annotations ────────────────── */
.ann-share-btn { color: var(--text-2); }
.ann-share-btn:hover { color: var(--acc-3); }

.ann-loading, .ann-error {
  padding: 26px 10px; text-align: center; color: var(--text-3); font-size: 13.5px; line-height: 1.6;
}
.ann-error { color: var(--text-2); }

/* état vide */
.ann-empty { text-align: center; padding: 40px 18px 30px; color: var(--text-3); }
.ann-empty__ico {
  display: inline-flex; width: 46px; height: 46px; margin-bottom: 12px;
  align-items: center; justify-content: center; border-radius: 14px;
  background: var(--glass-1); border: 1px solid var(--stroke); color: var(--text-2);
}
.ann-empty__ico svg { width: 22px; height: 22px; }
.ann-empty p { margin: 0 0 5px; color: var(--text-2); font-weight: 600; font-size: 14px; }
.ann-empty small { font-size: 12.5px; color: var(--text-3); }

/* liste */
.ann-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.ann-item {
  position: relative; display: flex; align-items: stretch; gap: 10px;
  padding: 11px 10px 11px 12px; border-radius: var(--r-m);
  background: var(--glass-1); border: 1px solid var(--stroke);
  transition: border-color .18s var(--ease), background .18s var(--ease), opacity .18s var(--ease), transform .18s var(--ease);
}
.ann-item:hover { border-color: var(--stroke-lit); background: var(--glass-2); }
.ann-item.is-removing { opacity: 0; transform: translateX(14px); }

/* pastille couleur (barre à gauche du texte) */
.ann-item__dot {
  flex-shrink: 0; width: 5px; align-self: stretch; border-radius: 3px;
  background: var(--c, var(--hl-yellow));
}

/* zone cliquable « aller à » : occupe l'espace restant */
.ann-item__go {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px;
  text-align: left; padding: 0; background: none; color: inherit;
}
.ann-item__text {
  font-size: 13.5px; line-height: 1.5; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.ann-item__meta { font-size: 11.5px; color: var(--text-3); }
.ann-item__go:hover .ann-item__text { color: #fff; }

/* bouton supprimer */
.ann-item__del {
  flex-shrink: 0; width: 34px; height: 34px; align-self: center;
  background: transparent; border: 0; color: var(--text-3);
}
.ann-item__del:hover { color: var(--err); background: var(--glass-2); transform: none; }
.ann-item__del svg { width: 17px; height: 17px; }

/* barre de confirmation de suppression (inline, pas de confirm() natif) */
.ann-item__confirm {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 0 12px; border-radius: var(--r-m);
  background: var(--glass-3); backdrop-filter: var(--blur-2); -webkit-backdrop-filter: var(--blur-2);
  border: 1px solid var(--stroke-lit);
  animation: pop .16s var(--spring) both;
}
.ann-item__confirm > span { margin-right: auto; font-size: 13px; color: var(--text-2); font-weight: 600; }
.ann-item__confirm .btn { min-height: 34px; padding: 0 13px; font-size: 12.5px; }
.ann-confirm-yes { color: #fff; background: rgba(248, 113, 113, .2); border-color: rgba(248, 113, 113, .45); }
.ann-confirm-yes:hover { background: rgba(248, 113, 113, .3); box-shadow: none; }
.ann-confirm-yes:disabled { opacity: .55; }

/* section « Partagées avec moi » */
.ann-shared { margin-top: 22px; }
.ann-shared__title {
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-3); margin: 0 0 10px; padding-top: 14px; border-top: 1px solid var(--stroke);
}
.ann-item--shared { background: transparent; border-style: dashed; }
.ann-item--shared:hover { background: var(--glass-1); }
.ann-item--shared .ann-item__meta { color: var(--acc-3); }

/* ─────────────────────────── responsive mobile ─────────────────────── */
@media (max-width: 640px) {
  /* la toolbar de sélection ne doit jamais déborder sur petit écran */
  .selection-toolbar { max-width: calc(100vw - 16px); flex-wrap: wrap; justify-content: center; }
  .ann-item__text { -webkit-line-clamp: 4; }
}
