/* ==========================================================================
   SILEK - Ultra-Modern SweetAlert2 "Berhasil" / Success Popup Theme
   Design: Emerald Luxury & Glassmorphic Celebration
   ========================================================================== */

/* 1. Backdrop Glassmorphism */
.swal2-container {
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  background: rgba(15, 23, 42, 0.55) !important;
  z-index: 99999 !important;
}

/* 2. Main Popup Card */
.swal2-popup {
  border-radius: 28px !important;
  padding: 2.25rem 2rem 2rem !important;
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  background: #ffffff !important;
  border: 1px solid rgba(226, 232, 240, 0.9) !important;
  box-shadow: 
    0 25px 60px -12px rgba(15, 23, 42, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.8) inset !important;
  position: relative !important;
  overflow: hidden !important;
  max-width: 440px !important;
  width: 90% !important;
}

/* Spring Entrance & Exit Animations */
.swal2-popup.swal2-show {
  -webkit-animation: swal2-spring-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards !important;
  animation: swal2-spring-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards !important;
}

.swal2-popup.swal2-hide {
  -webkit-animation: swal2-spring-out 0.2s cubic-bezier(0.4, 0, 1, 1) forwards !important;
  animation: swal2-spring-out 0.2s cubic-bezier(0.4, 0, 1, 1) forwards !important;
}

@keyframes swal2-spring-in {
  0% {
    opacity: 0;
    transform: scale(0.82) translateY(18px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes swal2-spring-out {
  0% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.88) translateY(10px);
  }
}

/* 3. SUCCESS POPUP SPECIFIC STYLING (.swal2-icon-success or .swal2-success-popup) */
.swal2-popup.swal2-icon-success,
.swal2-popup.swal2-success-popup,
.swal2-popup:has(.swal2-icon.swal2-success) {
  border: 1px solid rgba(16, 185, 129, 0.25) !important;
  box-shadow: 
    0 25px 70px -12px rgba(16, 185, 129, 0.22),
    0 15px 35px -5px rgba(15, 23, 42, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.9) inset !important;
}

/* Glowing Top Accent Bar for Success */
.swal2-popup.swal2-icon-success::before,
.swal2-popup.swal2-success-popup::before,
.swal2-popup:has(.swal2-icon.swal2-success)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #10b981 0%, #34d399 50%, #059669 100%);
  box-shadow: 0 2px 12px rgba(16, 185, 129, 0.5);
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
}

/* Subtle background glow inside success card */
.swal2-popup.swal2-icon-success::after,
.swal2-popup.swal2-success-popup::after,
.swal2-popup:has(.swal2-icon.swal2-success)::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  height: 140px;
  background: radial-gradient(ellipse at top, rgba(16, 185, 129, 0.12) 0%, rgba(16, 185, 129, 0.03) 60%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.swal2-header,
.swal2-content,
.swal2-html-container,
.swal2-actions {
  position: relative;
  z-index: 1;
}

/* 4. SUCCESS ICON - Ultra Modern Animated Checkmark */
.swal2-icon.swal2-success {
  width: 82px !important;
  height: 82px !important;
  margin: 0.5rem auto 1.25rem !important;
  border: 3.5px solid #10b981 !important;
  border-radius: 50% !important;
  color: #10b981 !important;
  background: radial-gradient(circle, #ecfdf5 0%, #d1fae5 60%, rgba(209, 250, 229, 0.4) 100%) !important;
  box-shadow: 
    0 0 0 8px rgba(16, 185, 129, 0.12),
    0 8px 24px -4px rgba(16, 185, 129, 0.35) !important;
  animation: swal2-success-halo 2.5s infinite ease-in-out !important;
  position: relative !important;
  box-sizing: border-box !important;
}

/* Halo Pulse Animation */
@keyframes swal2-success-halo {
  0% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.15), 0 8px 20px -4px rgba(16, 185, 129, 0.35);
  }
  50% {
    box-shadow: 0 0 0 14px rgba(16, 185, 129, 0.04), 0 12px 28px -4px rgba(16, 185, 129, 0.45);
  }
  100% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.15), 0 8px 20px -4px rgba(16, 185, 129, 0.35);
  }
}

/* Transparentize SweetAlert's default white mask artifacts */
.swal2-icon.swal2-success [class^='swal2-success-circular-line'],
.swal2-icon.swal2-success .swal2-success-fix {
  background: transparent !important;
}

.swal2-icon.swal2-success .swal2-success-ring {
  border-color: rgba(16, 185, 129, 0.4) !important;
  width: 100% !important;
  height: 100% !important;
}

.swal2-icon.swal2-success [class^='swal2-success-line'] {
  background-color: #059669 !important;
  height: 5px !important;
  border-radius: 4px !important;
  z-index: 3 !important;
}

/* 5. SUCCESS BADGE PILL (Berhasil / Sukses) */
.swal2-success-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 14px;
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 9999px;
  margin-bottom: 0.65rem;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.25);
  animation: swal2-badge-pop 0.35s ease-out;
}

.swal2-success-pill i {
  font-size: 0.85rem;
  color: #059669;
}

@keyframes swal2-badge-pop {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* 6. TITLE & BODY TYPOGRAPHY */
.swal2-title {
  color: #0f172a !important;
  font-size: 1.5rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.025em !important;
  line-height: 1.3 !important;
  margin: 0.25rem 0 0.5rem !important;
  padding: 0 !important;
}

.swal2-html-container {
  color: #475569 !important;
  font-size: 0.95rem !important;
  font-weight: 450 !important;
  line-height: 1.6 !important;
  margin: 0.5rem 0 1rem !important;
  padding: 0 0.25rem !important;
}

/* 7. PROGRESS BAR (Timer) */
.swal2-timer-progress-bar-container {
  background: rgba(226, 232, 240, 0.6) !important;
  height: 5px !important;
  border-radius: 9999px !important;
  margin: 0 1.5rem 0.5rem !important;
  overflow: hidden !important;
}

.swal2-timer-progress-bar {
  background: linear-gradient(90deg, #10b981 0%, #34d399 50%, #059669 100%) !important;
  height: 5px !important;
  border-radius: 9999px !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5) !important;
}

/* 8. ACTIONS & BUTTONS */
.swal2-actions {
  margin-top: 1.5rem !important;
  gap: 12px !important;
  width: 100% !important;
  justify-content: center !important;
}

/* Confirm Button - Emerald Gradient for Success */
.swal2-styled.swal2-confirm {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  border-radius: 14px !important;
  padding: 0.75rem 2rem !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em !important;
  border: none !important;
  box-shadow: 0 8px 20px -4px rgba(16, 185, 129, 0.45) !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  cursor: pointer !important;
  outline: none !important;
}

.swal2-styled.swal2-confirm:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 12px 25px -4px rgba(16, 185, 129, 0.6) !important;
  filter: brightness(1.05) !important;
}

.swal2-styled.swal2-confirm:active {
  transform: translateY(0) !important;
  box-shadow: 0 4px 12px -2px rgba(16, 185, 129, 0.4) !important;
}

.swal2-styled.swal2-confirm:focus {
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.3) !important;
}

/* Cancel & Deny Button */
.swal2-styled.swal2-cancel,
.swal2-styled.swal2-deny {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border-radius: 14px !important;
  padding: 0.75rem 1.5rem !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  border: 1px solid #e2e8f0 !important;
  transition: all 0.2s ease !important;
  box-shadow: none !important;
}

.swal2-styled.swal2-cancel:hover,
.swal2-styled.swal2-deny:hover {
  background: #e2e8f0 !important;
  color: #1e293b !important;
  transform: translateY(-1px) !important;
}

/* Close Button */
.swal2-close {
  color: #94a3b8 !important;
  font-size: 1.75rem !important;
  border-radius: 50% !important;
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  transition: all 0.2s ease !important;
  top: 14px !important;
  right: 14px !important;
}

.swal2-close:hover {
  color: #0f172a !important;
  background: #f1f5f9 !important;
}

/* 9. Confetti Canvas for Celebratory Success */
#swal2-confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 100000;
}

/* 10. Mobile Responsiveness */
@media (max-width: 576px) {
  .swal2-popup {
    border-radius: 24px !important;
    padding: 1.75rem 1.25rem 1.5rem !important;
    width: 92% !important;
  }
  .swal2-icon.swal2-success {
    width: 70px !important;
    height: 70px !important;
  }
  .swal2-title {
    font-size: 1.3rem !important;
  }
  .swal2-html-container {
    font-size: 0.9rem !important;
  }
  .swal2-styled.swal2-confirm {
    width: 100% !important;
    padding: 0.75rem 1.5rem !important;
  }
}
