/* public/js/ui/app-modal.css */

/* ============================================================
   CONFIRM MODAL - POUR DELETE / ARCHIVE / ACTION DANGEREUSE
   Style séparé de showAlert()
============================================================ */

#app-confirm-modal.app-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;

  background:
    radial-gradient(circle at top, rgba(255, 205, 90, 0.10), transparent 35%),
    rgba(28, 18, 12, 0.78);

  backdrop-filter: blur(7px);

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 16px;
}

#app-confirm-modal.app-confirm-modal.hidden {
  display: none;
}

#app-confirm-modal .app-confirm-content {
  width: min(430px, 100%);
  max-height: 85vh;

  background: linear-gradient(
    180deg,
    rgba(92, 58, 38, 0.98) 0%,
    rgba(58, 34, 24, 0.98) 100%
  ) !important;

  color: #fff6ef !important;

  border-radius: 20px;
  border: 1px solid rgba(255, 205, 90, 0.26);

  box-shadow:
    0 22px 60px rgba(20, 10, 8, 0.62),
    0 0 22px rgba(255, 205, 90, 0.08);

  overflow: hidden;
}

#app-confirm-modal .app-confirm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  padding: 16px 18px;

  background: rgba(58, 34, 24, 0.82);
  border-bottom: 1px solid rgba(255, 205, 90, 0.16);
}

#app-confirm-modal .app-confirm-header h3 {
  margin: 0;
  font-size: 18px;
  color: #ffd36a !important;
  font-weight: 800;
}

#app-confirm-close {
  width: 36px;
  height: 36px;

  border: none;
  border-radius: 10px;

  background: rgba(255, 244, 236, 0.10);
  color: #fff6ef;

  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

#app-confirm-close:hover {
  background: rgba(255, 244, 236, 0.18);
}

#app-confirm-modal .app-confirm-body {
  padding: 24px 20px;
}

#app-confirm-modal .app-confirm-body p {
  margin: 0;

  color: #fff6ef !important;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.35;

  white-space: pre-wrap;
}

#app-confirm-modal .app-confirm-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;

  padding: 16px 18px 18px;

  background: rgba(42, 25, 18, 0.52);
  border-top: 1px solid rgba(255, 220, 180, 0.10);
}

#app-confirm-modal .modal-btn {
  border: none;
  border-radius: 13px;

  padding: 12px 16px;

  cursor: pointer;

  font-weight: 800;
  font-size: 15px;
}

#app-confirm-modal .modal-btn.secondary {
  background: rgba(74, 45, 33, 0.98) !important;
  color: #fff6ef !important;
}

#app-confirm-modal .modal-btn.primary {
  background: linear-gradient(135deg, #b87922, #6f4214) !important;
  color: #fff6ef !important;
}

#app-confirm-modal .modal-btn.primary.danger {
  background: linear-gradient(135deg, #ff4d67, #a8263a) !important;
  color: #fff !important;
}

/* ============================================================
   ALERT MODAL - AUTO 3 SECONDES, SANS BOUTON
============================================================ */

.app-alert-modal {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 1000000;

  width: min(420px, calc(100vw - 28px));

  display: flex;
  justify-content: center;

  pointer-events: none;
  animation: alertSlideUp 0.25s ease-out;
}

.app-alert-modal.hidden {
  display: none;
}

.app-alert-content {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;

  padding: 14px 16px;

  border-radius: 16px;
  color: #fff;

  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255,255,255,0.16);
  backdrop-filter: blur(10px);
}

.app-alert-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;

  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;

  font-weight: 900;
  font-size: 20px;

  background: rgba(255,255,255,0.18);
}

.app-alert-text {
  min-width: 0;
}

.app-alert-title {
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 2px;
}

.app-alert-message {
  font-size: 14px;
  opacity: 0.95;
  line-height: 1.35;
}

/* ✅ Succès */
.app-alert-modal.success .app-alert-content {
  background: linear-gradient(
    135deg,
    rgba(38, 166, 91, 0.96),
    rgba(29, 120, 73, 0.96)
  );
}

/* ℹ️ Info */
.app-alert-modal.info .app-alert-content {
  background: linear-gradient(
    135deg,
    rgba(143, 96, 18, 0.96),
    rgba(92, 58, 12, 0.96)
  );
  border-color: rgba(255, 205, 90, 0.28);
}

.app-alert-modal.info .app-alert-icon {
  background: rgba(255, 205, 90, 0.22);
  color: #fff7df;
}

/* ❌ Erreur */
.app-alert-modal.error .app-alert-content {
  background: linear-gradient(
    135deg,
    rgba(255, 77, 103, 0.96),
    rgba(145, 35, 55, 0.96)
  );
}

@keyframes alertSlideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ============================================================
   MOBILE
============================================================ */

@media (max-width: 520px) {
  #app-confirm-modal.app-confirm-modal {
    align-items: flex-end;
    padding: 10px;
  }

  #app-confirm-modal .app-confirm-content {
    width: 100%;
    border-radius: 20px 20px 14px 14px;
  }

  #app-confirm-modal .app-confirm-footer {
    flex-direction: column-reverse;
  }

  #app-confirm-modal .modal-btn {
    width: 100%;
    padding: 14px;
  }

  .app-alert-modal {
    bottom: 18px;
    width: calc(100vw - 24px);
  }

  .app-alert-content {
    padding: 13px 14px;
    border-radius: 14px;
  }
}