/* ==========================================================================
   KSB MART FLAT DESIGN SWEETALERT2 THEME
   Desain modern flat card sesuai referensi UI:
   - Header hero banner berwarna solid dengan sudut atas membulat
   - Segitiga penunjuk (downward notch) di bagian bawah header
   - Icon flat vector 2D tematik di tengah header
   - Body card putih membulat (border-radius: 28px)
   - Judul tebal & deskripsi teks bersih
   - Tombol aksi berbentuk kapsul (pill-shaped) dengan warna serasi
   ========================================================================== */

:root {
  --swal-success-color: #10b981;
  --swal-success-dark: #059669;
  --swal-error-color: #ef4444;
  --swal-error-dark: #dc2626;
  --swal-warning-color: #f59e0b;
  --swal-warning-dark: #d97706;
  --swal-info-color: #2563eb;
  --swal-info-dark: #1d4ed8;
  --swal-question-color: #6366f1;
  --swal-question-dark: #4f46e5;
}

/* Container & Backdrop blur overlay */
.swal2-container {
  z-index: 2147483647 !important;
  pointer-events: auto !important;
}

.swal2-container.swal2-backdrop-show {
  background: rgba(15, 23, 42, 0.65) !important;
  backdrop-filter: blur(5px) !important;
  -webkit-backdrop-filter: blur(5px) !important;
  z-index: 2147483647 !important;
  pointer-events: auto !important;
}

/* Toast popup styling */
.swal2-popup.swal2-toast {
  border-radius: 18px !important;
  padding: 12px 18px !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
  background: #ffffff !important;
}

/* Main Modal Card */
.swal2-popup.swal-flat-popup,
.swal2-popup:not(.swal2-toast) {
  border-radius: 28px !important;
  padding: 0 0 28px 0 !important;
  overflow: hidden !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.04) !important;
  border: none !important;
  font-family: 'Urbanist', 'Segoe UI', system-ui, -apple-system, sans-serif !important;
  width: 380px !important;
  max-width: 90vw !important;
  background: #ffffff !important;
}

/* Top Hero Header Band */
.swal2-popup:not(.swal2-toast) .swal2-icon {
  width: 100% !important;
  height: 148px !important;
  margin: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  transform: none !important;
}

/* Downward speech bubble triangle notch */
.swal2-popup:not(.swal2-toast) .swal2-icon::after {
  content: '' !important;
  position: absolute !important;
  bottom: -12px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 0 !important;
  height: 0 !important;
  border-left: 14px solid transparent !important;
  border-right: 14px solid transparent !important;
  z-index: 20 !important;
  pointer-events: none !important;
}

/* Colors per notification type */
/* 1. SUCCESS (Green) */
.swal2-popup:not(.swal2-toast) .swal2-icon.swal2-success,
.swal-flat-success .swal2-icon {
  background: linear-gradient(145deg, #10b981 0%, #059669 100%) !important;
}
.swal2-popup:not(.swal2-toast) .swal2-icon.swal2-success::after,
.swal-flat-success .swal2-icon::after {
  border-top: 13px solid #059669 !important;
}

/* 2. ERROR (Red) */
.swal2-popup:not(.swal2-toast) .swal2-icon.swal2-error,
.swal-flat-error .swal2-icon {
  background: linear-gradient(145deg, #ef4444 0%, #dc2626 100%) !important;
}
.swal2-popup:not(.swal2-toast) .swal2-icon.swal2-error::after,
.swal-flat-error .swal2-icon::after {
  border-top: 13px solid #dc2626 !important;
}

/* 3. WARNING (Amber / Orange) */
.swal2-popup:not(.swal2-toast) .swal2-icon.swal2-warning,
.swal-flat-warning .swal2-icon {
  background: linear-gradient(145deg, #f59e0b 0%, #d97706 100%) !important;
}
.swal2-popup:not(.swal2-toast) .swal2-icon.swal2-warning::after,
.swal-flat-warning .swal2-icon::after {
  border-top: 13px solid #d97706 !important;
}

/* 4. INFO (Royal Blue - exact match to user reference image) */
.swal2-popup:not(.swal2-toast) .swal2-icon.swal2-info,
.swal-flat-info .swal2-icon {
  background: linear-gradient(145deg, #3b82f6 0%, #2563eb 100%) !important;
}
.swal2-popup:not(.swal2-toast) .swal2-icon.swal2-info::after,
.swal-flat-info .swal2-icon::after {
  border-top: 13px solid #2563eb !important;
}

/* 5. QUESTION (Indigo / Purple) */
.swal2-popup:not(.swal2-toast) .swal2-icon.swal2-question,
.swal-flat-question .swal2-icon {
  background: linear-gradient(145deg, #6366f1 0%, #4f46e5 100%) !important;
}
.swal2-popup:not(.swal2-toast) .swal2-icon.swal2-question::after,
.swal-flat-question .swal2-icon::after {
  border-top: 13px solid #4f46e5 !important;
}

/* Hide default SweetAlert inner animated line elements */
.swal2-popup:not(.swal2-toast) .swal2-success-circular-line-left,
.swal2-popup:not(.swal2-toast) .swal2-success-circular-line-right,
.swal2-popup:not(.swal2-toast) .swal2-success-fix,
.swal2-popup:not(.swal2-toast) .swal2-success-ring,
.swal2-popup:not(.swal2-toast) .swal2-success-line-tip,
.swal2-popup:not(.swal2-toast) .swal2-success-line-long,
.swal2-popup:not(.swal2-toast) .swal2-x-mark-line-left,
.swal2-popup:not(.swal2-toast) .swal2-x-mark-line-right {
  display: none !important;
}

/* Flat Icon Container */
.swal-flat-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  animation: swalFlatBounce 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes swalFlatBounce {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Title Styling */
.swal2-popup:not(.swal2-toast) .swal2-title {
  font-size: 22px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  margin: 24px 20px 8px 20px !important;
  padding: 0 !important;
  line-height: 1.3 !important;
  letter-spacing: -0.3px !important;
}

/* Description / Text Content */
.swal2-popup:not(.swal2-toast) .swal2-html-container {
  font-size: 13.5px !important;
  color: #64748b !important;
  line-height: 1.6 !important;
  margin: 0 24px 20px 24px !important;
  padding: 0 !important;
}

/* Buttons Container */
.swal2-popup:not(.swal2-toast) .swal2-actions {
  margin: 6px 20px 4px 20px !important;
  gap: 12px !important;
  width: calc(100% - 40px) !important;
  justify-content: center !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 50 !important;
}

/* Confirm Button (Full pill shaped) */
.swal2-popup:not(.swal2-toast) .swal2-confirm,
.swal-flat-btn {
  border-radius: 9999px !important;
  padding: 12px 36px !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  letter-spacing: 0.5px !important;
  border: none !important;
  min-height: 46px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18) !important;
  transition: all 0.2s ease !important;
  color: #ffffff !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  position: relative !important;
  z-index: 55 !important;
}

.swal2-popup:not(.swal2-toast) .swal2-confirm:hover,
.swal-flat-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24) !important;
}

/* Dynamic button color matching popup icon */
.swal2-popup:has(.swal2-success) .swal2-confirm,
.swal-flat-success .swal2-confirm,
.swal-flat-btn-success {
  background-color: var(--swal-success-color) !important;
}

.swal2-popup:has(.swal2-error) .swal2-confirm,
.swal-flat-error .swal2-confirm,
.swal-flat-btn-error {
  background-color: var(--swal-error-color) !important;
}

.swal2-popup:has(.swal2-warning) .swal2-confirm,
.swal-flat-warning .swal2-confirm,
.swal-flat-btn-warning {
  background-color: var(--swal-warning-color) !important;
}

.swal2-popup:has(.swal2-info) .swal2-confirm,
.swal-flat-info .swal2-confirm,
.swal-flat-btn-info {
  background-color: var(--swal-info-color) !important;
}

.swal2-popup:has(.swal2-question) .swal2-confirm,
.swal-flat-question .swal2-confirm,
.swal-flat-btn-question {
  background-color: var(--swal-question-color) !important;
}

/* Cancel Button */
.swal2-popup:not(.swal2-toast) .swal2-cancel {
  border-radius: 9999px !important;
  padding: 12px 26px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  background-color: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
  min-height: 46px !important;
  box-shadow: none !important;
  transition: all 0.2s ease !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  position: relative !important;
  z-index: 55 !important;
}
.swal2-popup:not(.swal2-toast) .swal2-cancel:hover {
  background-color: #e2e8f0 !important;
  color: #1e293b !important;
  transform: translateY(-1px) !important;
}

/* Input Fields inside SweetAlert */
.swal2-popup:not(.swal2-toast) .swal2-input,
.swal2-popup:not(.swal2-toast) .swal2-textarea,
.swal2-popup:not(.swal2-toast) .swal2-select {
  border-radius: 14px !important;
  border: 1.5px solid #e2e8f0 !important;
  background-color: #f8fafc !important;
  font-size: 13.5px !important;
  padding: 11px 16px !important;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.04) !important;
  width: calc(100% - 48px) !important;
  margin: 10px auto !important;
}
.swal2-popup:not(.swal2-toast) .swal2-input:focus,
.swal2-popup:not(.swal2-toast) .swal2-textarea:focus,
.swal2-popup:not(.swal2-toast) .swal2-select:focus {
  border-color: #2563eb !important;
  background-color: #ffffff !important;
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.15) !important;
  outline: none !important;
}

/* Waiting Adjustment View Flat Animations */
@keyframes waitingPulseRing {
  0% {
    transform: scale(0.85);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.18);
    opacity: 0.35;
  }
  100% {
    transform: scale(0.85);
    opacity: 0.9;
  }
}

@keyframes waitingDotBlink {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(0.8);
  }
}


