/* ═══════════════════════════════════════════════════════════════════
   delete-cascade.css — Styles popup + toast undo
   v753 — Anthony 5mai26. Cf delete-cascade.js pour le contexte.
   Reprend les variables Margot existantes (--surface, --border, etc.).
   ═══════════════════════════════════════════════════════════════════ */

/* Overlay backdrop */
.dd-overlay {
  position: fixed; inset: 0; z-index: 100020;
  background: rgba(20,22,31,.45);
  display: flex; align-items: flex-end; justify-content: center;
  animation: ddFadeIn .18s ease-out;
}
@keyframes ddFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Modal — bottom sheet sur mobile, centré sur desktop */
.dd-modal {
  width: 100%; max-width: 560px;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom)) 16px;
  box-shadow: 0 -8px 30px rgba(20,22,31,.18);
  max-height: 90vh; overflow-y: auto;
  animation: ddSlideUp .26s cubic-bezier(.4,0,.2,1);
}
@keyframes ddSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* [v756] Anthony 6mai26 : "la popup sur desktop s'ouvre comme pwa, faut une
   popup classique [centrée]". Sur desktop, on bascule en popup centrée avec
   animation fade + scale (au lieu du slide-up bottom sheet). On garde la
   drag handle visible (.dd-grabber) pour le feeling tactile cohérent avec
   le reste de l'UI Margot. Les coins sont arrondis sur les 4 côtés. */
@media (min-width: 720px) {
  .dd-overlay { align-items: center; }
  .dd-modal {
    border-radius: 16px;
    max-width: 480px;
    padding: 8px 20px 20px;
    box-shadow: 0 24px 60px rgba(20,22,31,.18);
    animation: ddFadeScale .22s cubic-bezier(.2,.8,.2,1);
  }
}
@keyframes ddFadeScale {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

/* Drag handle (PWA — utilisé par le sheet swipe-down v751) */
.dd-grabber {
  width: 36px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 8px;
}

.dd-h1 { font-size: 16px; font-weight: 600; margin: 0 0 4px; color: var(--text); }
.dd-sub { font-size: 12.5px; color: var(--muted); margin: 0 0 14px; }

/* Liste des entités */
.dd-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }

.dd-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.dd-card.entry {
  border-color: #E24B4A;
  background: #FCEBEB22;
}
.dd-card.section {
  background: transparent;
  border-style: dashed;
  border-color: var(--border);
}

.dd-row { display: flex; align-items: flex-start; gap: 10px; }
.dd-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0; margin-top: 6px;
  background: var(--muted);
}
.dd-dot.entry { background: #E24B4A; }

.dd-name { font-size: 14px; font-weight: 500; line-height: 1.3; color: var(--text); }
.dd-meta { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.4; }

/* Boutons d'action par entité */
.dd-actions { display: flex; gap: 6px; margin-top: 10px; }
.dd-btn {
  flex: 1; padding: 7px 10px;
  font-size: 12px; font-family: inherit;
  border-radius: 8px;
  border: 0.5px solid var(--border);
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  transition: all .12s;
}
.dd-btn.active.del {
  background: #FCEBEB;
  border-color: #E24B4A;
  color: #A32D2D;
  font-weight: 500;
}
.dd-btn.active.unl {
  background: #FAEEDA;
  border-color: #BA7517;
  color: #854F0B;
  font-weight: 500;
}
/* [v1091] 3ème état : "Ne rien faire" — gris neutre, distinct des autres */
.dd-btn.active.none {
  background: var(--s2);
  border-color: var(--border);
  color: var(--text);
  font-weight: 500;
}
.dd-btn.locked {
  cursor: not-allowed;
  background: #FCEBEB;
  border-color: #E24B4A;
  color: #A32D2D;
  font-weight: 500;
}

.dd-hint {
  font-size: 11px; color: var(--muted);
  margin: 8px 0 0; line-height: 1.5;
  font-style: italic;
}

/* Sous-dépendances */
.dd-deps {
  margin-top: 10px; padding-top: 10px;
  border-top: 0.5px dashed var(--border);
  display: flex; flex-direction: column; gap: 7px;
  transition: opacity .15s;
}
.dd-dep {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; cursor: pointer;
  color: var(--muted);
}
.dd-dep input[type=checkbox] {
  margin: 0; cursor: pointer;
  accent-color: #E24B4A;
}
.dd-dep input[type=checkbox]:disabled { cursor: not-allowed; }

/* Résumé en bas */
.dd-summary {
  background: var(--s2);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 12px 0;
  font-size: 13px; line-height: 1.6;
  color: var(--text);
}
.dd-num-del { color: #A32D2D; font-weight: 600; }
.dd-num-unl { color: #854F0B; font-weight: 600; }

/* Boutons CTA */
.dd-cta { display: flex; gap: 10px; }
.dd-cta button {
  flex: 1; padding: 12px;
  border-radius: 10px;
  font-size: 13.5px; font-weight: 500;
  cursor: pointer; font-family: inherit;
  border: none;
  transition: opacity .12s;
}
.dd-cancel {
  background: var(--s2) !important;
  border: 0.5px solid var(--border) !important;
  color: var(--muted);
}
.dd-confirm {
  background: #E24B4A !important;
  color: #fff;
  font-weight: 600;
}
.dd-cancel:active, .dd-confirm:active { opacity: 0.8; }

/* ═══════════════════ Toast Undo ═══════════════════ */
.dd-undo-toast {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
  z-index: 100025;
  background: #14161f;
  color: #fff;
  border-radius: 12px;
  padding: 12px 14px 12px 18px;
  display: flex; align-items: center; gap: 12px;
  font-size: 13.5px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  max-width: calc(100vw - 32px);
  animation: ddToastIn .22s cubic-bezier(.4,0,.2,1);
}
@keyframes ddToastIn {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.dd-undo-msg {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dd-undo-btn {
  background: transparent;
  border: 0.5px solid rgba(255,255,255,.3);
  color: #fff;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12.5px; font-weight: 500;
  cursor: pointer; font-family: inherit;
  transition: background .12s;
  flex-shrink: 0;
}
.dd-undo-btn:hover, .dd-undo-btn:active {
  background: rgba(255,255,255,.12);
}
.dd-undo-timer {
  font-size: 12px;
  color: rgba(255,255,255,.55);
  font-variant-numeric: tabular-nums;
  min-width: 14px; text-align: center;
  flex-shrink: 0;
}

/* Mobile : bottom sheet style pour l'overlay déjà défini.
   PWA : compatible avec le swipe-down sheet (v751) car .dd-modal a un
   .dd-grabber. Le module pwaInitSheetSwipeDown détecte le drag handle
   dans le top 60px → fermeture par swipe-down. À voir au testing si
   on doit ajouter l'overlay dans la liste SHEETS de pwa-swipe-back.js
   (l'ID est dynamique cf #dd-cascade-overlay donc il faudra une
   approche par sélecteur plutôt qu'ID fixe — Phase D si demandé). */
