/* =========================================
   SWEETALERT2 CUSTOM STYLES
   ========================================= */

/* TOAST (Top Right Alert) */
div.swal2-popup.swal2-toast {
    background: #ffffff !important;
    color: #1e293b !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid var(--primary-soft) !important;
    border-radius: 50px !important;
    /* Perfect Pill */
    padding: 0.5rem 1.5rem !important;
    display: flex !important;
    align-items: center !important;
    
    /* Position the individual toast popup below the header without breaking the container grid */
    position: relative !important;
    top: 80px !important;
    right: 20px !important;
    z-index: 6000 !important;
}

/* Custom premium sliding transitions for toasts (Slide in/out from right) */
.swal2-pill-show {
    animation: swal2-toast-slide-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

.swal2-pill-hide {
    animation: swal2-toast-slide-out 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes swal2-toast-slide-in {
    0% {
        transform: translateX(120%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes swal2-toast-slide-out {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(120%);
        opacity: 0;
    }
}

div.swal2-popup.swal2-toast .swal2-title {
    color: #1e293b !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    margin: 0 !important;
}

/* CENTER MODAL/ALERT */
div.swal2-popup {
    border-radius: var(--radius) !important;
    padding: 0.8rem !important;
    font-family: var(--font-body) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-float) !important;
}

div.swal2-title {
    color: #1e293b !important;
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.5px !important;
}

div.swal2-html-container {
    color: #64748b !important;
    font-size: 1rem !important;
}

div.swal2-actions {
    gap: 10px !important;
}

div.swal2-styled.swal2-confirm {
    background: var(--primary) !important;
    color: #ffffff !important;
    border-radius: var(--radius-pill) !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    padding: 0.8rem 2.2rem !important;
    box-shadow: var(--shadow-primary) !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

div.swal2-styled.swal2-confirm:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(211, 22, 40, 0.4) !important;
}

div.swal2-styled.swal2-cancel {
    background: #f1f5f9 !important;
    color: #64748b !important;
    border-radius: 50px !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    padding: 0.75rem 2rem !important;
}

/* Helper for exact width consistency with app drawers */
.swal2-popup.swal-width-900 {
    width: 940px !important;
    max-width: 98vw !important;
    display: flex !important;
    flex-direction: column !important;
}

@media (max-width: 768px) {
    div.swal2-popup:not(.swal2-toast) {
        padding: 1rem !important;
        border-radius: 20px 20px 0 0 !important;
        width: 100% !important;
        margin: 0 !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        max-height: 95vh !important;
        overflow: visible !important;
    }

    div.swal2-popup.swal2-show:not(.swal2-toast) {
        animation: swal2-show-bottom 0.3s ease-out !important;
    }

    @keyframes swal2-show-bottom {
        0% {
            transform: translateY(100%);
        }

        100% {
            transform: translateY(0);
        }
    }

    div.swal2-title {
        font-size: 1.25rem !important;
    }

    div.swal2-html-container {
        font-size: 0.9rem !important;
        margin: 10px 0 !important;
    }

    div.swal2-actions {
        flex-direction: column-reverse !important;
        width: 100% !important;
        gap: 8px !important;
    }

    div.swal2-styled {
        width: 100% !important;
        margin: 0 !important;
    }
}

/* WHATSAPP MODAL PREMIUM */
.swal-premium-popup {
    border: none !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    border-radius: 28px !important;
    overflow: hidden !important;
}

.swal-premium-actions-vertical {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 8px !important;
    padding: 0 20px 20px 20px !important;
}

.swal-premium-icon {
    border: 3px solid #eef2f6 !important;
    margin-top: 1.5rem !important;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05) !important;
    transform: scale(1.1) !important;
}

.swal2-close {
    position: absolute !important;
    right: 12px !important;
    top: 12px !important;
    width: 34px !important;
    height: 34px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    color: #94a3b8 !important;
    background: #f1f5f9 !important;
    z-index: 100005 !important;
    pointer-events: auto !important;
    transition: all 0.2s !important;
}

.swal2-close:hover {
    background: #f1f5f9 !important;
    color: #1e293b !important;
}

.swal-premium-btn-regular,
.swal-premium-btn-tech {
    width: 100% !important; /* FULL WIDTH TO STACK */
    max-width: 320px !important;
    padding: 16px 24px !important;
    border-radius: 16px !important;
    font-weight: 850 !important;
    font-size: 0.95rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: none !important;
    margin: 6px auto !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.swal-premium-btn-regular {
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important; /* Brand Red */
    color: white !important;
    box-shadow: 0 10px 20px rgba(220, 38, 38, 0.2) !important;
}

.swal-premium-btn-regular:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 15px 30px rgba(220, 38, 38, 0.3) !important;
    background: #dc2626 !important;
}

.swal-premium-btn-tech {
    background: linear-gradient(135deg, #64748b, #475569) !important; /* Brand Gray */
    color: white !important;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

.swal-premium-btn-tech:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15) !important;
    background: #64748b !important;
}

@media (max-width: 480px) {
    .swal-premium-btn-regular,
    .swal-premium-btn-tech {
        width: 100% !important;
        margin: 5px 0 !important;
    }
}

/* 💎 LAYER HIERARCHY: Always on top of core modals (2000) and headers */
.swal2-container {
    z-index: 99999 !important;
}

/* 🎨 PREMIUM SWEETALERT OVERRIDE (RepaSaaS Elite Style) */
.swal2-popup {
    border-radius: 32px !important;
    padding: 2.5rem !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    font-family: 'Outfit', sans-serif !important;
}

.swal2-title {
    font-weight: 800 !important;
    letter-spacing: -1px !important;
    color: #0f172a !important;
    font-size: 1.8rem !important;
    margin-bottom: 0.5rem !important;
}

.swal2-html-container {
    font-family: 'Inter', sans-serif !important;
    font-size: 1.05rem !important;
    color: #475569 !important;
    line-height: 1.6 !important;
}

/* BUTTONS REDESIGN */
.swal2-actions {
    margin-top: 2rem !important;
    gap: 12px !important;
}

.swal2-confirm {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: #ffffff !important;
    border-radius: 100px !important;
    padding: 14px 32px !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    box-shadow: 0 10px 20px rgba(239, 68, 68, 0.25) !important;
    border: none !important;
    transition: all 0.3s ease !important;
}

.swal2-confirm:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 15px 30px rgba(239, 68, 68, 0.35) !important;
}

.swal2-cancel {
    background: #f1f5f9 !important;
    color: #64748b !important;
    border-radius: 100px !important;
    padding: 14px 32px !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    border: none !important;
    transition: all 0.2s ease !important;
}

.swal2-cancel:hover {
    background: #e2e8f0 !important;
    color: #1e293b !important;
}

/* CUSTOM ICON STYLES */
.swal2-icon.swal2-question {
    border-color: #ef4444 !important;
    color: #ef4444 !important;
    transform: scale(0.9) !important;
    margin-bottom: 2rem !important;
}

.swal2-icon.swal2-question .swal2-icon-content {
    font-family: 'Outfit' !important;
    font-weight: 900 !important;
}

/* Center and scale the user profile modal on mobile */
@media (max-width: 768px) {
    .swal2-container .swal2-popup.modal-mobile-fix {
        position: relative !important;
        top: auto !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        margin: auto !important;
        width: 90% !important;
        max-width: 400px !important;
        border-radius: 28px !important;
        max-height: 85vh !important;
        overflow: visible !important;
        padding: 1.5rem !important;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2) !important;
    }

    .swal2-container .swal2-popup.modal-mobile-fix.swal2-show {
        animation: swal2-show-center 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }

    /* Compact wallet banner inside profile modal on mobile */
    .modal-mobile-fix #profile-wallet-banner {
        flex-direction: row !important;
        align-items: center !important;
        gap: 12px !important;
        padding: 12px 16px !important;
        text-align: left !important;
        border-radius: 16px !important;
    }

    .modal-mobile-fix #profile-wallet-banner .wallet-main-info {
        flex-direction: row !important;
        gap: 12px !important;
        width: 100% !important;
    }

    .modal-mobile-fix #profile-wallet-banner .wallet-icon-circle {
        width: 36px !important;
        height: 36px !important;
        border-radius: 10px !important;
        font-size: 1.1rem !important;
    }

    .modal-mobile-fix #profile-wallet-banner .wallet-value-group {
        gap: 6px !important;
    }

    .modal-mobile-fix #profile-wallet-banner .wallet-value {
        font-size: 1.3rem !important;
    }

    .modal-mobile-fix #profile-wallet-banner .wallet-currency {
        font-size: 0.75rem !important;
    }

    .modal-mobile-fix #profile-wallet-banner .wallet-status-card {
        display: none !important;
    }
}

@keyframes swal2-show-center {
    0% {
        transform: scale(0.9);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Scrollable HTML container to prevent close button overlap */
div.swal2-html-container {
    max-height: 65vh !important;
    overflow-y: auto !important;
    margin-top: 1.5rem !important;
}