/**
 * Toko Kita - Marketplace UMKM Batam
 * Custom SweetAlert2 & Toast Styling
 * High-end aesthetic with brand green #00826b / #08795f, soft backdrop, modern typography & micro-animations.
 */

/* Backdrop overlay with blur - ONLY for standard modal dialogs, NOT for toast notifications */
body:not(.swal2-toast-shown) .swal2-container.swal2-backdrop-show {
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    background: rgba(8, 40, 32, 0.4) !important;
    z-index: 10000 !important;
}

/* Explicitly ensure toast containers have zero background overlay, blur, or shadow box */
body.swal2-toast-shown .swal2-container,
body.swal2-toast-shown .swal2-container.swal2-backdrop-show,
.swal2-container.swal2-top-end,
.swal2-container.swal2-top-start,
.swal2-container.swal2-top,
.swal2-container.swal2-bottom-end,
.swal2-container.swal2-bottom-start,
.swal2-container.swal2-bottom,
.swal2-container:has(.ci-toast-popup),
.swal2-container:has(.swal2-toast) {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    pointer-events: none !important;
    z-index: 10001 !important;
}

body.swal2-toast-shown .swal2-popup,
.swal2-container .swal2-popup.ci-toast-popup {
    pointer-events: auto !important;
}

/* Main Modal Card */
.swal2-popup.ci-modal-popup {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    border-radius: 20px !important;
    padding: 2rem 2.2rem 1.8rem 2.2rem !important;
    background: #ffffff !important;
    box-shadow: 0 25px 50px -12px rgba(8, 121, 95, 0.25), 0 0 0 1px rgba(8, 121, 95, 0.08) !important;
    max-width: 440px !important;
    border: none !important;
}

/* Modal Title */
.swal2-popup.ci-modal-popup .swal2-title {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    padding: 0.5rem 0 0 0 !important;
    margin-bottom: 0.5rem !important;
    letter-spacing: -0.02em !important;
}

/* Modal Content HTML / Text */
.swal2-popup.ci-modal-popup .swal2-html-container {
    font-size: 0.935rem !important;
    line-height: 1.55 !important;
    color: #475569 !important;
    margin: 0.4rem 0 1.2rem 0 !important;
    font-weight: 400 !important;
}

/* SweetAlert Icons Styling */
.swal2-popup.ci-modal-popup .swal2-icon {
    width: 64px !important;
    height: 64px !important;
    margin: 0.5rem auto 1rem auto !important;
    border-width: 3px !important;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.swal2-popup.ci-modal-popup:hover .swal2-icon {
    transform: scale(1.03);
}

/* Success Icon */
.swal2-popup.ci-modal-popup .swal2-icon.swal2-success {
    border-color: #00826b !important;
    color: #00826b !important;
}
.swal2-popup.ci-modal-popup .swal2-icon.swal2-success [class^='swal2-success-line'] {
    background-color: #00826b !important;
}
.swal2-popup.ci-modal-popup .swal2-icon.swal2-success .swal2-success-ring {
    border-color: rgba(0, 130, 107, 0.25) !important;
}

/* Warning Icon */
.swal2-popup.ci-modal-popup .swal2-icon.swal2-warning {
    border-color: #f59e0b !important;
    color: #f59e0b !important;
    background: rgba(245, 158, 11, 0.06) !important;
}

/* Error Icon */
.swal2-popup.ci-modal-popup .swal2-icon.swal2-error {
    border-color: #ef4444 !important;
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.06) !important;
}
.swal2-popup.ci-modal-popup .swal2-icon.swal2-error [class^='swal2-x-mark-line'] {
    background-color: #ef4444 !important;
}

/* Info Icon */
.swal2-popup.ci-modal-popup .swal2-icon.swal2-info {
    border-color: #0284c7 !important;
    color: #0284c7 !important;
    background: rgba(2, 132, 199, 0.06) !important;
}

/* Question Icon */
.swal2-popup.ci-modal-popup .swal2-icon.swal2-question {
    border-color: #00826b !important;
    color: #00826b !important;
    background: rgba(0, 130, 107, 0.06) !important;
}

/* Action Buttons Container */
.swal2-popup.ci-modal-popup .swal2-actions {
    margin-top: 1rem !important;
    gap: 10px !important;
    width: 100% !important;
    justify-content: center !important;
}

/* Primary / Confirm Button */
.swal2-popup.ci-modal-popup .swal2-confirm.ci-btn-confirm {
    background: #00826b !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 0.925rem !important;
    font-weight: 600 !important;
    padding: 10px 24px !important;
    min-width: 110px !important;
    box-shadow: 0 4px 14px rgba(0, 130, 107, 0.3) !important;
    transition: all 0.25s ease !important;
    cursor: pointer !important;
}

.swal2-popup.ci-modal-popup .swal2-confirm.ci-btn-confirm:hover {
    background: #006856 !important;
    box-shadow: 0 6px 18px rgba(0, 130, 107, 0.4) !important;
    transform: translateY(-1px) !important;
}

.swal2-popup.ci-modal-popup .swal2-confirm.ci-btn-danger {
    background: #e11d48 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 0.925rem !important;
    font-weight: 600 !important;
    padding: 10px 24px !important;
    box-shadow: 0 4px 14px rgba(225, 29, 72, 0.3) !important;
    transition: all 0.25s ease !important;
}

.swal2-popup.ci-modal-popup .swal2-confirm.ci-btn-danger:hover {
    background: #be123c !important;
    box-shadow: 0 6px 18px rgba(225, 29, 72, 0.4) !important;
    transform: translateY(-1px) !important;
}

/* Secondary / Cancel Button */
.swal2-popup.ci-modal-popup .swal2-cancel.ci-btn-cancel {
    background: #f8fafc !important;
    color: #64748b !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 12px !important;
    font-size: 0.925rem !important;
    font-weight: 600 !important;
    padding: 10px 20px !important;
    min-width: 90px !important;
    box-shadow: none !important;
    transition: all 0.25s ease !important;
}

.swal2-popup.ci-modal-popup .swal2-cancel.ci-btn-cancel:hover {
    background: #f1f5f9 !important;
    color: #334155 !important;
    border-color: #cbd5e1 !important;
}

/* ========================================================= */
/* TOAST NOTIFICATION STYLING                                */
/* ========================================================= */

.swal2-popup.ci-toast-popup {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    border-radius: 14px !important;
    padding: 14px 18px !important;
    background: #ffffff !important;
    box-shadow: 0 12px 32px rgba(8, 121, 95, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.06) !important;
    border-left: 5px solid #00826b !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.swal2-popup.ci-toast-popup.swal2-toast-error {
    border-left-color: #ef4444 !important;
}

.swal2-popup.ci-toast-popup.swal2-toast-warning {
    border-left-color: #f59e0b !important;
}

.swal2-popup.ci-toast-popup.swal2-toast-info {
    border-left-color: #0284c7 !important;
}

.swal2-popup.ci-toast-popup .swal2-title {
    font-size: 0.92rem !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    margin: 0 !important;
    line-height: 1.4 !important;
}

.swal2-popup.ci-toast-popup .swal2-html-container {
    font-size: 0.85rem !important;
    color: #64748b !important;
    margin: 2px 0 0 0 !important;
    line-height: 1.4 !important;
}

.swal2-popup.ci-toast-popup .swal2-icon {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    margin: 0 8px 0 0 !important;
    border-width: 2px !important;
}

/* Progress bar inside Toast */
.swal2-popup.ci-toast-popup .swal2-timer-progress-bar {
    background: #00826b !important;
    height: 3px !important;
}

.swal2-popup.ci-toast-popup.swal2-toast-error .swal2-timer-progress-bar {
    background: #ef4444 !important;
}

.swal2-popup.ci-toast-popup.swal2-toast-warning .swal2-timer-progress-bar {
    background: #f59e0b !important;
}

.swal2-popup.ci-toast-popup.swal2-toast-info .swal2-timer-progress-bar {
    background: #0284c7 !important;
}

/* Close Button in Toast */
.swal2-popup.ci-toast-popup .swal2-close {
    font-size: 1.1rem !important;
    color: #94a3b8 !important;
    margin-right: -4px !important;
}

.swal2-popup.ci-toast-popup .swal2-close:hover {
    color: #334155 !important;
}
