/* Enhanced Alert UI/UX theme for both SweetAlert2 and jQuery Toast */

/* ---------- SweetAlert2 (modals) ---------- */
/* High z-index to ensure alerts appear above all content */
.swal2-container {
    z-index: 999999 !important;
}

.swal2-popup {
    z-index: 1000000 !important;
    border-radius: 20px !important;
    padding: 2.5rem 2rem !important;
  box-shadow: 0 25px 70px rgba(0, 0, 0, .2),
  0 10px 25px rgba(0, 0, 0, .1),
  0 0 0 1px rgba(255, 255, 255, .1) inset,
  0 0 60px rgba(79, 70, 229, 0.1) !important;
    border: none !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(249, 250, 251, 0.98) 100%),
  radial-gradient(circle at 20% 80%, rgba(79, 70, 229, 0.03), transparent 50%),
  radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.03), transparent 50%) !important;
    position: relative !important;
  overflow: hidden !important;
}

/* Animated shimmer overlay */
.swal2-popup::after {
  content: '' !important;
  position: absolute !important;
  top: -50% !important;
  left: -50% !important;
  width: 200% !important;
  height: 200% !important;
  background: linear-gradient(
          45deg,
          transparent 30%,
          rgba(255, 255, 255, 0.1) 50%,
          transparent 70%
  ) !important;
  animation: shimmer 3s infinite !important;
  pointer-events: none !important;
}

.swal2-popup.swal2-show {
    animation: swalZoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.swal2-popup.swal2-hide {
    animation: swalZoomOut 0.2s ease-out !important;
}

/* Backdrop: only for centered modals (not toast mode) */
.swal2-container:not(.swal2-top-end):not(.swal2-top-start):not(.swal2-bottom-end):not(.swal2-bottom-start) {
    backdrop-filter: blur(2px) saturate(180%) !important;
    background: radial-gradient(circle at 50% 50%, rgba(131, 34, 34, 0.15), rgba(0, 0, 0, .5)) !important;
    animation: backdropPulse 3s ease-in-out infinite !important;
}

.swal2-container.swal2-backdrop-show {
    animation: backdropFadeIn 0.3s ease-out !important;
}

.swal2-title {
  font-weight: 600 !important;
  letter-spacing: -0.5px !important;
    margin-bottom: 0.75rem !important;
    line-height: 1.3 !important;
    background: linear-gradient(135deg, #1f2937 0%, #4b5563 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
  position: relative !important;
  z-index: 1 !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.05)) !important;
}

.swal2-html-container {
    color: #6b7280 !important;
    font-size: 1rem !important;
    line-height: 1.6 !important;
    margin: 1rem 0 1.5rem !important;
}

.swal2-actions {
    gap: 0.75rem !important;
    margin-top: 2rem !important;
}

.swal2-confirm {
    background: linear-gradient(135deg, #49506e 0%, #5a6180 100%) !important;
    color: #ffffff !important;
    border: 0 !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 20px rgba(73, 80, 110, .4) !important;
    font-weight: 600 !important;
    padding: 0.875rem 2.5rem !important;
    font-size: 1rem !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative !important;
  overflow: hidden !important;
}

.swal2-confirm::before {
  content: '' !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  width: 0 !important;
  height: 0 !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.3) !important;
  transform: translate(-50%, -50%) !important;
  transition: width 0.6s, height 0.6s !important;
}


.swal2-confirm:active {
  transform: translateY(0) scale(0.98) !important;
}

.swal2-cancel {

    border-radius: 12px !important;
    border: 2px solid #e5e7eb !important;
    padding: 0.875rem 2.5rem !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Close button - enhanced styling */
.swal2-close {
    color: #9ca3af !important;
    transition: all 0.2s ease !important;
    font-size: 2rem !important;
}

.swal2-close:hover {
    color: #374151 !important;
    transform: scale(1.1) !important;
}

.swal2-close:active {
    transform: scale(0.95) !important;
}

/* Timer progress bar */
.swal2-timer-progress-bar {
    background: linear-gradient(90deg, #4f46e5, #6366f1) !important;
    height: 4px !important;
}

/* Icon styling - only colors to avoid cutting issues */
.swal2-icon {
    margin: 2rem auto 1.5rem !important;
    position: relative !important;
  animation: iconBreathe 2s ease-in-out infinite !important;
}

.swal2-icon::before {
    content: '' !important;
    position: absolute !important;
    inset: -10px !important;
    border-radius: 50% !important;
    opacity: 0.2 !important;
    filter: blur(20px) !important;
  z-index: -1 !important;
  animation: glowPulse 2s ease-in-out infinite !important;
}

/* Rotating ring decoration around icons */
.swal2-icon::after {
  content: '' !important;
  position: absolute !important;
  inset: -15px !important;
  border-radius: 50% !important;
  border: 2px solid transparent !important;
  border-top-color: currentColor !important;
  opacity: 0.15 !important;
  animation: iconRotate 3s linear infinite !important;
    z-index: -1 !important;
}

.swal2-icon.swal2-success {
    border-color: #10b981 !important;
    animation: iconPulse 0.5s ease-out !important;
}

.swal2-icon.swal2-success::before {
    background: radial-gradient(circle, #10b981, transparent) !important;
}

.swal2-icon.swal2-success [class^='swal2-success-line'] {
    background-color: #10b981 !important;
}

.swal2-icon.swal2-error {
    border-color: #ef4444 !important;
    animation: iconShake 0.5s ease-out !important;
}

.swal2-icon.swal2-error::before {
    background: radial-gradient(circle, #ef4444, transparent) !important;
}

.swal2-icon.swal2-error [class^='swal2-x-mark-line'] {
    background-color: #ef4444 !important;
}

.swal2-icon.swal2-warning {
    border-color: #f59e0b !important;
    color: #f59e0b !important;
    animation: iconPulse 0.5s ease-out !important;
}

.swal2-icon.swal2-warning::before {
    background: radial-gradient(circle, #f59e0b, transparent) !important;
}

.swal2-icon.swal2-info {
    border-color: #3b82f6 !important;
    color: #3b82f6 !important;
    animation: iconPulse 0.5s ease-out !important;
}

.swal2-icon.swal2-info::before {
    background: radial-gradient(circle, #3b82f6, transparent) !important;
}

/* Keyframe animations */
@keyframes swalZoomIn {
    0% {
        transform: scale(0.7);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes swalZoomOut {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.8);
        opacity: 0;
    }
}

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

@keyframes iconShake {
    0%, 100% {
        transform: translateX(0) rotate(0deg);
    }
    25% {
        transform: translateX(-8px) rotate(-5deg);
    }
    50% {
        transform: translateX(8px) rotate(5deg);
    }
    75% {
        transform: translateX(-4px) rotate(-2deg);
    }
}

@keyframes backdropPulse {
    0%, 100% {
        background: radial-gradient(circle at 50% 50%, rgba(79, 70, 229, .15), rgba(0, 0, 0, .5));
    }
    50% {
        background: radial-gradient(circle at 50% 50%, rgba(139, 92, 246, .2), rgba(0, 0, 0, .55));
    }
}

@keyframes backdropFadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* ---------- jQuery Toast ---------- */
.jq-toast-wrap {
    z-index: 999999 !important;
}

.jq-toast-single {
    border-radius: 16px !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .25), 0 5px 15px rgba(0, 0, 0, .1) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, .2) !important;
    animation: toastSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.jq-toast-single h2 {
    font-size: 16px !important;
    margin-bottom: 8px !important;
    font-weight: 700 !important;
    letter-spacing: -0.2px !important;
}

.jq-toast-single .close-jq-toast-single {
    font-size: 20px !important;
    font-weight: 700 !important;
    opacity: 0.6 !important;
    transition: opacity 0.2s !important;
}

.jq-toast-single .close-jq-toast-single:hover {
    opacity: 1 !important;
}

/* Variants with enhanced gradients and borders */
.jq-has-icon.jq-icon-success {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%) !important;
    color: #065f46 !important;
    border-left: 5px solid #10b981 !important;
}

.jq-has-icon.jq-icon-error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%) !important;
    color: #991b1b !important;
    border-left: 5px solid #ef4444 !important;
}

.jq-has-icon.jq-icon-info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%) !important;
    color: #1e40af !important;
    border-left: 5px solid #3b82f6 !important;
}

.jq-has-icon.jq-icon-warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
    color: #92400e !important;
    border-left: 5px solid #f59e0b !important;
}

/* RTL tweaks */
[dir='rtl'] .jq-toast-single {
    direction: rtl;
    text-align: right;
}

[dir='rtl'] .jq-has-icon.jq-icon-success,
[dir='rtl'] .jq-has-icon.jq-icon-error,
[dir='rtl'] .jq-has-icon.jq-icon-info,
[dir='rtl'] .jq-has-icon.jq-icon-warning {
    border-left: none !important;
    border-right: 5px solid !important;
}

/* Enhanced entrance animation */
@keyframes toastSlideIn {
    0% {
        transform: translateX(100%) scale(0.9);
        opacity: 0;
    }
    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

[dir='rtl'] .jq-toast-single {
    animation: toastSlideInRTL 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

@keyframes toastSlideInRTL {
    0% {
        transform: translateX(-100%) scale(0.9);
        opacity: 0;
    }
    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}
