/* ============================================================
   Trash Lid FX v4 — animasi "Tutup Tong Terbuka" di TOMBOL HAPUS PERTAMA
   Versi poles: tutup membuka LALU MENUTUP lagi, kertas memudar masuk,
   status "Terhapus" muncul memantul dengan glow yang memudar halus.
   Lapisan animasi selalu merah solid (#dc2626), ikon & teks putih.

   Alur: tombol hapus pertama diklik -> modal konfirmasi -> klik
   "Ya, Hapus" -> modal tertutup & request hapus dikirim -> animasi
   main di tombol pertama -> baris hilang.
   Tombol di dalam modal TIDAK diubah sama sekali.
   Butuh pasangan: trash-lid-fx-v4.js
   ============================================================ */

.lid-fx {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: inherit;
  pointer-events: none;
  background: #dc2626;
  color: #fff;
  transition: box-shadow .3s ease;
}

.lid-fx .lid-ic { position: relative; display: inline-flex; flex: none; }
.lid-fx .lid-bin { width: 18px; height: 18px; overflow: visible; display: block; }

/* Tutup: membuka -> menahan terbuka -> menutup lagi */
.lid-fx .lid-lid {
  transform-box: fill-box;
  transform-origin: 12% 90%;
}
.lid-fx.is-playing .lid-lid { animation: lid-open-close 1.05s cubic-bezier(.34, 1.3, .64, 1) forwards; }

@keyframes lid-open-close {
  0%   { transform: rotate(0deg) translateY(0); }
  22%  { transform: rotate(-34deg) translateY(-1px); }
  62%  { transform: rotate(-34deg) translateY(-1px); }
  100% { transform: rotate(0deg) translateY(0); }
}

.lid-fx .lid-paper {
  position: absolute;
  left: 50%;
  top: -3px;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 2.5px;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}
.lid-fx.is-playing .lid-paper { animation: lid-paper-drop .6s .22s ease-in forwards; }

@keyframes lid-paper-drop {
  0%   { opacity: 0; transform: translateY(-13px) rotate(-8deg) scale(1); }
  18%  { opacity: 1; }
  75%  { opacity: 1; transform: translateY(2px) rotate(38deg) scale(.72); }
  100% { opacity: 0; transform: translateY(5px) rotate(52deg) scale(.45); }
}

.lid-fx.is-playing .lid-bin { animation: lid-bin-shake .3s .85s ease; }

@keyframes lid-bin-shake {
  0%, 100% { transform: rotate(0deg); }
  30% { transform: rotate(-5deg); }
  65% { transform: rotate(4deg); }
}

.lid-fx .lid-done { display: none; align-items: center; gap: 8px; white-space: nowrap; }
.lid-fx .lid-done svg { width: 18px; height: 18px; flex: none; }
.lid-fx.is-done .lid-ic { display: none; }
.lid-fx.is-done .lid-done { display: inline-flex; animation: lid-done-pop .32s cubic-bezier(.34, 1.56, .64, 1); }
.lid-fx.is-done { box-shadow: 0 0 22px 4px rgba(220, 38, 38, .55); border-radius: inherit; }

@keyframes lid-done-pop {
  0%   { opacity: 0; transform: scale(.55); }
  100% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .lid-fx.is-playing .lid-lid,
  .lid-fx.is-playing .lid-paper,
  .lid-fx.is-playing .lid-bin,
  .lid-fx.is-done .lid-done { animation: none; }
}
